本文整理汇总了C++中modellayervector::const_iterator类的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator类的具体用法?C++ const_iterator怎么用?C++ const_iterator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了const_iterator类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1:
ModelLayer*
Map::getModelLayerByUID( UID layerUID ) const
{
Threading::ScopedReadLock( const_cast<Map*>(this)->_mapDataMutex );
for( ModelLayerVector::const_iterator i = _modelLayers.begin(); i != _modelLayers.end(); ++i )
if ( i->get()->getUID() == layerUID )
return i->get();
return 0L;
}
开发者ID:Geo12,项目名称:osgearth,代码行数:9,代码来源:Map.cpp
示例2: mapConf
Config
EarthFileSerializer2::serialize( MapNode* input ) const
{
Config mapConf("map");
mapConf.set("version", "2");
if ( !input || !input->getMap() )
return mapConf;
Map* map = input->getMap();
MapFrame mapf( map, Map::ENTIRE_MODEL );
// the map and node options:
Config optionsConf = map->getInitialMapOptions().getConfig();
optionsConf.merge( input->getMapNodeOptions().getConfig() );
mapConf.add( "options", optionsConf );
// the layers
for( ImageLayerVector::const_iterator i = mapf.imageLayers().begin(); i != mapf.imageLayers().end(); ++i )
{
ImageLayer* layer = i->get();
//Config layerConf = layer->getInitialOptions().getConfig();
Config layerConf = layer->getImageLayerOptions().getConfig();
layerConf.set("name", layer->getName());
layerConf.set("driver", layer->getInitialOptions().driver()->getDriver());
mapConf.add( "image", layerConf );
}
for( ElevationLayerVector::const_iterator i = mapf.elevationLayers().begin(); i != mapf.elevationLayers().end(); ++i )
{
ElevationLayer* layer = i->get();
//Config layerConf = layer->getInitialOptions().getConfig();
Config layerConf = layer->getElevationLayerOptions().getConfig();
layerConf.set("name", layer->getName());
layerConf.set("driver", layer->getInitialOptions().driver()->getDriver());
mapConf.add( "elevation", layerConf );
}
for( ModelLayerVector::const_iterator i = mapf.modelLayers().begin(); i != mapf.modelLayers().end(); ++i )
{
ModelLayer* layer = i->get();
Config layerConf = layer->getModelLayerOptions().getConfig();
layerConf.set("name", layer->getName());
layerConf.set("driver", layer->getModelLayerOptions().driver()->getDriver());
mapConf.add( "model", layerConf );
}
Config ext = input->externalConfig();
if ( !ext.empty() )
{
ext.key() = "external";
mapConf.add( ext );
}
return mapConf;
}
开发者ID:DavidLeehome,项目名称:osgearth,代码行数:56,代码来源:EarthFileSerializer2.cpp
示例3: lock
Revision
Map::getModelLayers( ModelLayerVector& out_list ) const
{
out_list.reserve( _modelLayers.size() );
Threading::ScopedReadLock lock( const_cast<Map*>(this)->_mapDataMutex );
for( ModelLayerVector::const_iterator i = _modelLayers.begin(); i != _modelLayers.end(); ++i )
out_list.push_back( i->get() );
return _dataModelRevision;
}
开发者ID:Geo12,项目名称:osgearth,代码行数:11,代码来源:Map.cpp
示例4:
void
ElevationQuery::gatherPatchLayers()
{
// cache a vector of terrain patch models.
_patchLayers.clear();
for(ModelLayerVector::const_iterator i = _mapf.modelLayers().begin();
i != _mapf.modelLayers().end();
++i)
{
if ( i->get()->isTerrainPatch() )
_patchLayers.push_back( i->get() );
}
}
开发者ID:Vantica,项目名称:osgearth,代码行数:13,代码来源:ElevationQuery.cpp
示例5: setDataVariance
//.........这里部分代码省略.........
// load and attach the terrain engine, but don't initialize it until we need it
const TerrainOptions& terrainOptions = _mapNodeOptions.getTerrainOptions();
_terrainEngine = TerrainEngineNodeFactory::create( _map.get(), terrainOptions );
_terrainEngineInitialized = false;
// the engine needs a container so we can set lighting state on the container and
// not on the terrain engine itself. Setting the dynamic variance will prevent
// an optimizer from collapsing the empty group node.
_terrainEngineContainer = new osg::Group();
_terrainEngineContainer->setDataVariance( osg::Object::DYNAMIC );
this->addChild( _terrainEngineContainer );
// initialize terrain-level lighting:
if ( terrainOptions.enableLighting().isSet() )
{
_terrainEngineContainer->getOrCreateStateSet()->setMode(
GL_LIGHTING,
terrainOptions.enableLighting().value() ? 1 : 0 );
}
if ( _terrainEngine )
{
// inform the terrain engine of the map information now so that it can properly
// initialize it's CoordinateSystemNode. This is necessary in order to support
// manipulators and to set up the texture compositor prior to frame-loop
// initialization.
_terrainEngine->preInitialize( _map.get(), terrainOptions );
_terrainEngineContainer->addChild( _terrainEngine );
}
else
{
OE_WARN << "FAILED to create a terrain engine for this map" << std::endl;
}
// make a group for the model layers.
// NOTE: for now, we are going to nullify any shader programs that occur above the model
// group, since it does not YET support shader composition. Programs defined INSIDE a
// model layer will still work OK though.
_models = new osg::Group();
_models->setName( "osgEarth::MapNode.modelsGroup" );
addChild( _models.get() );
// make a group for overlay model layers:
_overlayModels = new ObserverGroup(); //osg::Group();
_overlayModels->setName( "osgEarth::MapNode.overlayModelsGroup" );
// a decorator for overlay models:
_overlayDecorator = new OverlayDecorator();
_overlayDecorator->setOverlayGraphTraversalMask( terrainOptions.secondaryTraversalMask().value() );
if ( _mapNodeOptions.overlayBlending().isSet() )
_overlayDecorator->setOverlayBlending( *_mapNodeOptions.overlayBlending() );
if ( _mapNodeOptions.overlayTextureSize().isSet() )
_overlayDecorator->setTextureSize( *_mapNodeOptions.overlayTextureSize() );
if ( _mapNodeOptions.overlayMipMapping().isSet() )
_overlayDecorator->setMipMapping( *_mapNodeOptions.overlayMipMapping() );
addTerrainDecorator( _overlayDecorator );
// install any pre-existing model layers:
ModelLayerVector modelLayers;
_map->getModelLayers( modelLayers );
int modelLayerIndex = 0;
for( ModelLayerVector::const_iterator k = modelLayers.begin(); k != modelLayers.end(); k++, modelLayerIndex++ )
{
onModelLayerAdded( k->get(), modelLayerIndex );
}
_mapCallback = new MapNodeMapCallbackProxy(this);
// install a layer callback for processing further map actions:
_map->addMapCallback( _mapCallback.get() );
osg::StateSet* ss = getOrCreateStateSet();
if ( _mapNodeOptions.enableLighting().isSet() )
{
ss->setMode(
GL_LIGHTING,
_mapNodeOptions.enableLighting().value() ? 1 : 0 );
}
dirtyBound();
// Install top-level shader programs:
if ( Registry::capabilities().supportsGLSL() )
{
VirtualProgram* vp = new VirtualProgram();
vp->setName( "MapNode" );
vp->installDefaultColoringAndLightingShaders();
ss->setAttributeAndModes( vp, osg::StateAttribute::ON );
}
// register for event traversals so we can deal with blacklisted filenames
ADJUST_EVENT_TRAV_COUNT( this, 1 );
// remove the temporary reference.
this->unref_nodelete();
}
开发者ID:ender35,项目名称:osgearth,代码行数:101,代码来源:MapNode.cpp
示例6: mapConf
Config
EarthFileSerializer2::serialize(const MapNode* input, const std::string& referrer) const
{
Config mapConf("map");
mapConf.set("version", "2");
if ( !input || !input->getMap() )
return mapConf;
const Map* map = input->getMap();
MapFrame mapf( map, Map::ENTIRE_MODEL );
// the map and node options:
Config optionsConf = map->getInitialMapOptions().getConfig();
optionsConf.merge( input->getMapNodeOptions().getConfig() );
mapConf.add( "options", optionsConf );
// the layers
for( ImageLayerVector::const_iterator i = mapf.imageLayers().begin(); i != mapf.imageLayers().end(); ++i )
{
ImageLayer* layer = i->get();
//Config layerConf = layer->getInitialOptions().getConfig();
Config layerConf = layer->getImageLayerOptions().getConfig();
layerConf.set("name", layer->getName());
layerConf.set("driver", layer->getInitialOptions().driver()->getDriver());
mapConf.add( "image", layerConf );
}
for( ElevationLayerVector::const_iterator i = mapf.elevationLayers().begin(); i != mapf.elevationLayers().end(); ++i )
{
ElevationLayer* layer = i->get();
//Config layerConf = layer->getInitialOptions().getConfig();
Config layerConf = layer->getElevationLayerOptions().getConfig();
layerConf.set("name", layer->getName());
layerConf.set("driver", layer->getInitialOptions().driver()->getDriver());
mapConf.add( "elevation", layerConf );
}
for( ModelLayerVector::const_iterator i = mapf.modelLayers().begin(); i != mapf.modelLayers().end(); ++i )
{
ModelLayer* layer = i->get();
Config layerConf = layer->getModelLayerOptions().getConfig();
layerConf.set("name", layer->getName());
layerConf.set("driver", layer->getModelLayerOptions().driver()->getDriver());
mapConf.add( "model", layerConf );
}
Config ext = input->externalConfig();
if ( !ext.empty() )
{
ext.key() = "extensions";
mapConf.add( ext );
}
#if 1 // removed until it can be debugged.
// Re-write pathnames in the Config so they are relative to the new referrer.
if ( _rewritePaths && !referrer.empty() )
{
RewritePaths rewritePaths( referrer );
rewritePaths.setRewriteAbsolutePaths( _rewriteAbsolutePaths );
rewritePaths.apply( mapConf );
}
#endif
return mapConf;
}
开发者ID:2php,项目名称:osgearth,代码行数:66,代码来源:EarthFileSerializer2.cpp
示例7: if
//.........这里部分代码省略.........
{
OE_WARN << "FAILED to create a terrain engine for this map" << std::endl;
}
// make a group for the model layers.
// NOTE: for now, we are going to nullify any shader programs that occur above the model
// group, since it does not YET support shader composition. Programs defined INSIDE a
// model layer will still work OK though.
_models = new osg::Group();
_models->setName( "osgEarth::MapNode.modelsGroup" );
_models->getOrCreateStateSet()->setRenderBinDetails(2, "RenderBin");
addChild( _models.get() );
// a decorator for overlay models:
_overlayDecorator = new OverlayDecorator();
// install the Draping technique for overlays:
{
DrapingTechnique* draping = new DrapingTechnique();
const char* envOverlayTextureSize = ::getenv("OSGEARTH_OVERLAY_TEXTURE_SIZE");
if ( _mapNodeOptions.overlayBlending().isSet() )
draping->setOverlayBlending( *_mapNodeOptions.overlayBlending() );
if ( envOverlayTextureSize )
draping->setTextureSize( as<int>(envOverlayTextureSize, 1024) );
else if ( _mapNodeOptions.overlayTextureSize().isSet() )
draping->setTextureSize( *_mapNodeOptions.overlayTextureSize() );
if ( _mapNodeOptions.overlayMipMapping().isSet() )
draping->setMipMapping( *_mapNodeOptions.overlayMipMapping() );
if ( _mapNodeOptions.overlayAttachStencil().isSet() )
draping->setAttachStencil( *_mapNodeOptions.overlayAttachStencil() );
if ( _mapNodeOptions.overlayResolutionRatio().isSet() )
draping->setResolutionRatio( *_mapNodeOptions.overlayResolutionRatio() );
_overlayDecorator->addTechnique( draping );
}
// install the Clamping technique for overlays:
{
_overlayDecorator->addTechnique( new ClampingTechnique() );
}
addTerrainDecorator( _overlayDecorator );
// install any pre-existing model layers:
ModelLayerVector modelLayers;
_map->getModelLayers( modelLayers );
int modelLayerIndex = 0;
for( ModelLayerVector::const_iterator k = modelLayers.begin(); k != modelLayers.end(); k++, modelLayerIndex++ )
{
onModelLayerAdded( k->get(), modelLayerIndex );
}
_mapCallback = new MapNodeMapCallbackProxy(this);
// install a layer callback for processing further map actions:
_map->addMapCallback( _mapCallback.get() );
osg::StateSet* stateset = getOrCreateStateSet();
if ( _mapNodeOptions.enableLighting().isSet() )
{
stateset->addUniform(Registry::shaderFactory()->createUniformForGLMode(
GL_LIGHTING,
_mapNodeOptions.enableLighting().value() ? 1 : 0));
stateset->setMode(
GL_LIGHTING,
_mapNodeOptions.enableLighting().value() ? 1 : 0);
}
// Add in some global uniforms
stateset->addUniform( new osg::Uniform("oe_isGeocentric", _map->isGeocentric()) );
if ( _map->isGeocentric() )
{
OE_INFO << LC << "Adding ellipsoid uniforms.\n";
// for a geocentric map, use an ellipsoid unit-frame transform and its inverse:
osg::Vec3d ellipFrameInverse(
_map->getSRS()->getEllipsoid()->getRadiusEquator(),
_map->getSRS()->getEllipsoid()->getRadiusEquator(),
_map->getSRS()->getEllipsoid()->getRadiusPolar());
stateset->addUniform( new osg::Uniform("oe_ellipsoidFrameInverse", osg::Vec3f(ellipFrameInverse)) );
osg::Vec3d ellipFrame = osg::componentDivide(osg::Vec3d(1.0,1.0,1.0), ellipFrameInverse);
stateset->addUniform( new osg::Uniform("oe_ellipsoidFrame", osg::Vec3f(ellipFrame)) );
}
// install the default rendermode uniform:
stateset->addUniform( new osg::Uniform("oe_isPickCamera", false) );
dirtyBound();
// register for event traversals so we can deal with blacklisted filenames
ADJUST_EVENT_TRAV_COUNT( this, 1 );
// remove the temporary reference.
this->unref_nodelete();
}
开发者ID:Brucezhou1979,项目名称:osgearth,代码行数:101,代码来源:MapNode.cpp
示例8: setDataVariance
//.........这里部分代码省略.........
NULL;
if ( local_options.valid() )
{
OE_INFO << LC
<< "Options string = "
<< (local_options.valid()? local_options->getOptionString() : "<empty>")
<< std::endl;
}
// TODO: not sure why we call this here
_map->setGlobalOptions( local_options.get() );
// overlays:
_pendingOverlayAutoSetTextureUnit = true;
// load and attach the terrain engine, but don't initialize it until we need it
const TerrainOptions& terrainOptions = _mapNodeOptions.getTerrainOptions();
_terrainEngine = TerrainEngineNodeFactory::create( _map.get(), terrainOptions );
_terrainEngineInitialized = false;
// the engine needs a container so we can set lighting state on the container and
// not on the terrain engine itself. Setting the dynamic variance will prevent
// an optimizer from collapsing the empty group node.
_terrainEngineContainer = new osg::Group();
_terrainEngineContainer->setDataVariance( osg::Object::DYNAMIC );
this->addChild( _terrainEngineContainer.get() );
// initialize terrain-level lighting:
if ( terrainOptions.enableLighting().isSet() )
{
_terrainEngineContainer->getOrCreateStateSet()->setMode( GL_LIGHTING, terrainOptions.enableLighting().value() ?
osg::StateAttribute::ON | osg::StateAttribute::PROTECTED :
osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED );
}
if ( _terrainEngine.valid() )
{
// inform the terrain engine of the map information now so that it can properly
// initialize it's CoordinateSystemNode. This is necessary in order to support
// manipulators and to set up the texture compositor prior to frame-loop
// initialization.
_terrainEngine->preInitialize( _map.get(), terrainOptions );
_terrainEngineContainer->addChild( _terrainEngine.get() );
}
else
OE_WARN << "FAILED to create a terrain engine for this map" << std::endl;
// make a group for the model layers:
_models = new osg::Group();
_models->setName( "osgEarth::MapNode.modelsGroup" );
addChild( _models.get() );
// make a group for overlay model layers:
_overlayModels = new osg::Group();
_overlayModels->setName( "osgEarth::MapNode.overlayModelsGroup" );
// a decorator for overlay models:
_overlayDecorator = new OverlayDecorator();
if ( _mapNodeOptions.overlayVertexWarping().isSet() )
_overlayDecorator->setVertexWarping( *_mapNodeOptions.overlayVertexWarping() );
if ( _mapNodeOptions.overlayBlending().isSet() )
_overlayDecorator->setOverlayBlending( *_mapNodeOptions.overlayBlending() );
if ( _mapNodeOptions.overlayTextureSize().isSet() )
_overlayDecorator->setTextureSize( *_mapNodeOptions.overlayTextureSize() );
if ( _mapNodeOptions.overlayMipMapping().isSet() )
_overlayDecorator->setMipMapping( *_mapNodeOptions.overlayMipMapping() );
addTerrainDecorator( _overlayDecorator.get() );
// install any pre-existing model layers:
ModelLayerVector modelLayers;
_map->getModelLayers( modelLayers );
int modelLayerIndex = 0;
for( ModelLayerVector::const_iterator k = modelLayers.begin(); k != modelLayers.end(); k++, modelLayerIndex++ )
{
onModelLayerAdded( k->get(), modelLayerIndex );
}
_mapCallback = new MapNodeMapCallbackProxy(this);
// install a layer callback for processing further map actions:
_map->addMapCallback( _mapCallback.get() );
osg::StateSet* ss = getOrCreateStateSet();
//ss->setAttributeAndModes( new osg::CullFace() ); //, osg::StateAttribute::ON);
//ss->setAttributeAndModes( new osg::PolygonOffset( -1, -1 ) );
if ( _mapNodeOptions.enableLighting().isSet() )
{
ss->setMode( GL_LIGHTING, _mapNodeOptions.enableLighting().value() ?
osg::StateAttribute::ON | osg::StateAttribute::PROTECTED :
osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED );
}
dirtyBound();
// register for event traversals so we can deal with blacklisted filenames
ADJUST_EVENT_TRAV_COUNT( this, 1 );
}
开发者ID:nedbrek,项目名称:osgearth,代码行数:101,代码来源:MapNode.cpp
注:本文中的modellayervector::const_iterator类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论