本文整理汇总了C++中modellayervector::iterator类的典型用法代码示例。如果您正苦于以下问题:C++ iterator类的具体用法?C++ iterator怎么用?C++ iterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了iterator类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lock
void
Map::removeModelLayer( ModelLayer* layer )
{
if ( layer )
{
//Take a reference to the layer since we will be deleting it
osg::ref_ptr< ModelLayer > layerRef = layer;
Revision newRevision;
{
Threading::ScopedWriteLock lock( _mapDataMutex );
for( ModelLayerVector::iterator i = _modelLayers.begin(); i != _modelLayers.end(); ++i )
{
if ( i->get() == layer )
{
_modelLayers.erase( i );
newRevision = ++_dataModelRevision;
break;
}
}
}
for( MapCallbackList::iterator i = _mapCallbacks.begin(); i != _mapCallbacks.end(); ++i )
{
i->get()->onMapModelChanged( MapModelChange(
MapModelChange::REMOVE_MODEL_LAYER, newRevision, layerRef.get()) );
}
}
}
示例2: lock
void
Map::removeModelLayer( ModelLayer* layer )
{
if ( layer )
{
Revision newRevision;
{
Threading::ScopedWriteLock lock( _mapDataMutex );
for( ModelLayerVector::iterator i = _modelLayers.begin(); i != _modelLayers.end(); ++i )
{
if ( i->get() == layer )
{
_modelLayers.erase( i );
newRevision = ++_dataModelRevision;
break;
}
}
}
for( MapCallbackList::iterator i = _mapCallbacks.begin(); i != _mapCallbacks.end(); ++i )
{
i->get()->onMapModelChanged( MapModelChange(
MapModelChange::REMOVE_MODEL_LAYER, newRevision, layer) );
}
}
}
示例3: addImageLayer
void
Map::setLayersFromMap( const Map* map )
{
this->clear();
if ( map )
{
ImageLayerVector newImages;
map->getImageLayers( newImages );
for( ImageLayerVector::iterator i = newImages.begin(); i != newImages.end(); ++i )
addImageLayer( i->get() );
ElevationLayerVector newElev;
map->getElevationLayers( newElev );
for( ElevationLayerVector::iterator i = newElev.begin(); i != newElev.end(); ++i )
addElevationLayer( i->get() );
ModelLayerVector newModels;
map->getModelLayers( newModels );
for( ModelLayerVector::iterator i = newModels.begin(); i != newModels.end(); ++i )
addModelLayer( i->get() );
}
}