本文整理汇总了C++中MapFrame::elevationLayers方法的典型用法代码示例。如果您正苦于以下问题:C++ MapFrame::elevationLayers方法的具体用法?C++ MapFrame::elevationLayers怎么用?C++ MapFrame::elevationLayers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapFrame
的用法示例。
在下文中一共展示了MapFrame::elevationLayers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
CacheSeed::cacheTile(const MapFrame& mapf, const TileKey& key ) const
{
bool gotData = false;
for( ImageLayerVector::const_iterator i = mapf.imageLayers().begin(); i != mapf.imageLayers().end(); i++ )
{
ImageLayer* layer = i->get();
if ( layer->isKeyValid( key ) )
{
GeoImage image = layer->createImage( key );
if ( image.valid() )
gotData = true;
}
}
if ( mapf.elevationLayers().size() > 0 )
{
osg::ref_ptr<osg::HeightField> hf;
mapf.getHeightField( key, false, hf );
if ( hf.valid() )
gotData = true;
}
return gotData;
}
示例2: getElevationTaskService
void
StreamingTerrainNode::updateTaskServiceThreads( const MapFrame& mapf )
{
//Get the maximum elevation weight
float elevationWeight = 0.0f;
for (ElevationLayerVector::const_iterator itr = mapf.elevationLayers().begin(); itr != mapf.elevationLayers().end(); ++itr)
{
ElevationLayer* layer = itr->get();
float w = layer->getElevationLayerOptions().loadingWeight().value();
if (w > elevationWeight) elevationWeight = w;
}
float totalImageWeight = 0.0f;
for (ImageLayerVector::const_iterator itr = mapf.imageLayers().begin(); itr != mapf.imageLayers().end(); ++itr)
{
totalImageWeight += itr->get()->getImageLayerOptions().loadingWeight().value();
}
float totalWeight = elevationWeight + totalImageWeight;
if (elevationWeight > 0.0f)
{
//Determine how many threads each layer gets
int numElevationThreads = (int)osg::round((float)_numLoadingThreads * (elevationWeight / totalWeight ));
OE_INFO << LC << "Elevation Threads = " << numElevationThreads << std::endl;
getElevationTaskService()->setNumThreads( numElevationThreads );
}
for (ImageLayerVector::const_iterator itr = mapf.imageLayers().begin(); itr != mapf.imageLayers().end(); ++itr)
{
const TerrainLayerOptions& opt = itr->get()->getImageLayerOptions();
int imageThreads = (int)osg::round((float)_numLoadingThreads * (opt.loadingWeight().value() / totalWeight ));
OE_INFO << LC << "Image Threads for " << itr->get()->getName() << " = " << imageThreads << std::endl;
getImageryTaskService( itr->get()->getUID() )->setNumThreads( imageThreads );
}
}