本文整理汇总了C++中mapcallbacklist::iterator类的典型用法代码示例。如果您正苦于以下问题:C++ iterator类的具体用法?C++ iterator怎么用?C++ iterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了iterator类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lock
void
Map::removeTerrainMaskLayer( MaskLayer* layer )
{
if ( layer )
{
//Take a reference to the layer since we will be deleting it
osg::ref_ptr< MaskLayer > layerRef = layer;
Revision newRevision;
{
Threading::ScopedWriteLock lock( _mapDataMutex );
for( MaskLayerVector::iterator i = _terrainMaskLayers.begin(); i != _terrainMaskLayers.end(); ++i )
{
if ( i->get() == layer )
{
_terrainMaskLayers.erase( i );
newRevision = ++_dataModelRevision;
break;
}
}
}
// a separate block b/c we don't need the mutex
for( MapCallbackList::iterator i = _mapCallbacks.begin(); i != _mapCallbacks.end(); i++ )
{
i->get()->onMapModelChanged( MapModelChange(
MapModelChange::REMOVE_MASK_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: msg
void
Map::endUpdate()
{
MapModelChange msg( MapModelChange::END_BATCH_UPDATE, _dataModelRevision );
for( MapCallbackList::iterator i = _mapCallbacks.begin(); i != _mapCallbacks.end(); i++ )
{
i->get()->onMapModelChanged( msg );
}
}
示例4: lock
void
Map::insertImageLayer( ImageLayer* layer, unsigned int index )
{
osgEarth::Registry::instance()->clearBlacklist();
if ( layer )
{
//Set options for the map from the layer
layer->setDBOptions( _dbOptions.get() );
//propagate the cache to the layer:
if (_mapOptions.cachePolicy().isSet() )
{
layer->overrideCachePolicy( *_mapOptions.cachePolicy() );
}
//Set the Cache for the MapLayer to our cache.
layer->setCache( this->getCache() );
// Tell the layer the map profile, if possible:
if ( _profile.valid() )
layer->setTargetProfileHint( _profile.get() );
int newRevision;
// Add the layer to our stack.
{
Threading::ScopedWriteLock lock( _mapDataMutex );
if (index >= _imageLayers.size())
_imageLayers.push_back(layer);
else
_imageLayers.insert( _imageLayers.begin() + index, layer );
newRevision = ++_dataModelRevision;
}
// a separate block b/c we don't need the mutex
for( MapCallbackList::iterator i = _mapCallbacks.begin(); i != _mapCallbacks.end(); i++ )
{
i->get()->onMapModelChanged( MapModelChange(
MapModelChange::ADD_IMAGE_LAYER, newRevision, layer, index) );
}
}
}
示例5: if
void
Map::calculateProfile()
{
if ( !_profile.valid() )
{
osg::ref_ptr<const Profile> userProfile;
if ( _mapOptions.profile().isSet() )
{
userProfile = Profile::create( _mapOptions.profile().value() );
}
if ( _mapOptions.coordSysType() == MapOptions::CSTYPE_GEOCENTRIC )
{
if ( userProfile.valid() )
{
if ( userProfile->isOK() && userProfile->getSRS()->isGeographic() )
{
_profile = userProfile.get();
}
else
{
OE_WARN << LC
<< "Map is geocentric, but the configured profile SRS ("
<< userProfile->getSRS()->getName() << ") is not geographic; "
<< "it will be ignored."
<< std::endl;
}
}
if ( !_profile.valid() )
{
// by default, set a geocentric map to use global-geodetic WGS84.
_profile = osgEarth::Registry::instance()->getGlobalGeodeticProfile();
}
}
else if ( _mapOptions.coordSysType() == MapOptions::CSTYPE_GEOCENTRIC_CUBE )
{
//If the map type is a Geocentric Cube, set the profile to the cube profile.
_profile = osgEarth::Registry::instance()->getCubeProfile();
}
else // CSTYPE_PROJECTED
{
if ( userProfile.valid() )
{
_profile = userProfile.get();
}
}
// At this point, if we don't have a profile we need to search tile sources until we find one.
if ( !_profile.valid() )
{
Threading::ScopedReadLock lock( _mapDataMutex );
for( ImageLayerVector::iterator i = _imageLayers.begin(); i != _imageLayers.end() && !_profile.valid(); i++ )
{
ImageLayer* layer = i->get();
if ( layer->getTileSource() )
{
_profile = layer->getTileSource()->getProfile();
}
}
for( ElevationLayerVector::iterator i = _elevationLayers.begin(); i != _elevationLayers.end() && !_profile.valid(); i++ )
{
ElevationLayer* layer = i->get();
if ( layer->getTileSource() )
{
_profile = layer->getTileSource()->getProfile();
}
}
}
// convert the profile to Plate Carre if necessary.
if (_profile.valid() &&
_profile->getSRS()->isGeographic() &&
getMapOptions().coordSysType() == MapOptions::CSTYPE_PROJECTED )
{
OE_INFO << LC << "Projected display with geographic SRS; activating Plate Carre mode" << std::endl;
_profile = _profile->overrideSRS( _profile->getSRS()->createPlateCarreGeographicSRS() );
}
// finally, fire an event if the profile has been set.
if ( _profile.valid() )
{
OE_INFO << LC << "Map profile is: " << _profile->toString() << std::endl;
for( MapCallbackList::iterator i = _mapCallbacks.begin(); i != _mapCallbacks.end(); i++ )
{
i->get()->onMapInfoEstablished( MapInfo(this) );
}
}
else
{
OE_WARN << LC << "Warning, not yet able to establish a map profile!" << std::endl;
}
}
//.........这里部分代码省略.........
示例6: if
void
Map::calculateProfile()
{
if ( !_profile.valid() )
{
osg::ref_ptr<const Profile> userProfile;
if ( _mapOptions.profile().isSet() )
{
userProfile = Profile::create( _mapOptions.profile().value() );
}
if ( _mapOptions.coordSysType() == MapOptions::CSTYPE_GEOCENTRIC )
{
if ( userProfile.valid() )
{
if ( userProfile->isOK() && userProfile->getSRS()->isGeographic() )
{
_profile = userProfile.get();
}
else
{
OE_WARN << LC
<< "Map is geocentric, but the configured profile does not "
<< "have a geographic SRS. Falling back on default.."
<< std::endl;
}
}
if ( !_profile.valid() )
{
// by default, set a geocentric map to use global-geodetic WGS84.
_profile = osgEarth::Registry::instance()->getGlobalGeodeticProfile();
}
}
else if ( _mapOptions.coordSysType() == MapOptions::CSTYPE_GEOCENTRIC_CUBE )
{
//If the map type is a Geocentric Cube, set the profile to the cube profile.
_profile = osgEarth::Registry::instance()->getCubeProfile();
}
else // CSTYPE_PROJECTED
{
if ( userProfile.valid() )
{
_profile = userProfile.get();
}
}
// At this point, if we don't have a profile we need to search tile sources until we find one.
if ( !_profile.valid() )
{
Threading::ScopedReadLock lock( _mapDataMutex );
for( ImageLayerVector::iterator i = _imageLayers.begin(); i != _imageLayers.end() && !_profile.valid(); i++ )
{
ImageLayer* layer = i->get();
if ( layer->getTileSource() )
{
_profile = layer->getTileSource()->getProfile();
}
}
for( ElevationLayerVector::iterator i = _elevationLayers.begin(); i != _elevationLayers.end() && !_profile.valid(); i++ )
{
ElevationLayer* layer = i->get();
if ( layer->getTileSource() )
{
_profile = layer->getTileSource()->getProfile();
}
}
}
// finally, fire an event if the profile has been set.
if ( _profile.valid() )
{
OE_INFO << LC << "Map profile is: " << _profile->toString() << std::endl;
for( MapCallbackList::iterator i = _mapCallbacks.begin(); i != _mapCallbacks.end(); i++ )
{
i->get()->onMapInfoEstablished( MapInfo(this) );
}
}
else
{
OE_WARN << LC << "Warning, not yet able to establish a map profile!" << std::endl;
}
}
if ( _profile.valid() )
{
// tell all the loaded layers what the profile is, as a hint
{
Threading::ScopedWriteLock lock( _mapDataMutex );
for( ImageLayerVector::iterator i = _imageLayers.begin(); i != _imageLayers.end(); i++ )
{
ImageLayer* layer = i->get();
layer->setTargetProfileHint( _profile.get() );
//.........这里部分代码省略.........