void ImageOverlay::dirty() { { OpenThreads::ScopedLock< OpenThreads::Mutex > lock(_mutex); _dirty = true; } for( CallbackList::iterator i = _callbacks.begin(); i != _callbacks.end(); i++ ) { i->get()->onOverlayChanged(); } }
void Terrain::fireTileAdded( const TileKey& key, osg::Node* node ) { Threading::ScopedReadLock sharedLock( _callbacksMutex ); for( CallbackList::iterator i = _callbacks.begin(); i != _callbacks.end(); ) { TerrainCallbackContext context( this ); i->get()->onTileAdded( key, node, context ); // if the callback set the "remove" flag, discard the callback. if ( !context._remove ) ++i; else i = _callbacks.erase( i ); } }
void Terrain::removeTerrainCallback( TerrainCallback* cb ) { Threading::ScopedWriteLock exclusiveLock( _callbacksMutex ); for( CallbackList::iterator i = _callbacks.begin(); i != _callbacks.end(); ) { if ( i->get() == cb ) { i = _callbacks.erase( i ); } else { ++i; } } }