osgEarth 2.1.1
|
Public Member Functions | |
CustomTerrain (const MapFrame &update_mapf, const MapFrame &cull_mapf, OSGTileFactory *factory, bool quickReleaseGLObjects) | |
virtual const char * | libraryName () const |
virtual const char * | className () const |
void | incrementRevision () |
int | getRevision () const |
OSGTileFactory * | getTileFactory () |
bool | getQuickReleaseGLObjects () const |
TaskService * | getImageryTaskService (int layerId) |
TaskService * | getElevationTaskService () |
TaskService * | getTileGenerationTaskSerivce () |
const MapFrame & | getUpdateThreadMapFrame () |
const MapFrame & | getCullThreadMapFrame () |
unsigned int | getNumTasksRemaining () const |
virtual void | traverse (osg::NodeVisitor &nv) |
void | updateTaskServiceThreads (const MapFrame &mapf) |
bool | updateBudgetRemaining () const |
void | releaseGLObjectsForTiles (osg::State *) |
void | registerTile (CustomTile *newTile) |
void | getCustomTile (const osgTerrain::TileID &, osg::ref_ptr< CustomTile > &out_tile, bool lock=true) |
void | getCustomTiles (TileVector &out_tiles) |
const LoadingPolicy & | getLoadingPolicy () const |
Protected Types | |
typedef std::map < osgTerrain::TileID, osg::ref_ptr< CustomTile > > | TileTable |
typedef std::queue < osg::ref_ptr< CustomTile > > | TileQueue |
typedef std::list < osg::ref_ptr< CustomTile > > | TileList |
typedef std::vector < osg::ref_ptr< CustomTile > > | TileVector |
typedef std::queue < osgTerrain::TileID > | TileIDQueue |
Protected Member Functions | |
~CustomTerrain () | |
Protected Attributes | |
Threading::ReadWriteMutex | _tilesMutex |
TileTable | _tiles |
TileList | _tilesToShutDown |
TileQueue | _tilesToRelease |
Threading::Mutex | _tilesToReleaseMutex |
Private Types | |
typedef std::map< int, osg::ref_ptr< TaskService > > | TaskServiceMap |
Private Member Functions | |
TaskService * | createTaskService (const std::string &name, int id, int numThreads) |
TaskService * | getTaskService (int id) |
void | refreshFamily (const MapInfo &info, const TileKey &key, Relative *family, bool tileTableLocked) |
void | setDelay (unsigned frames) |
void | decDelay () |
Private Attributes | |
int | _revision |
OpenThreads::Mutex | _revisionMutex |
osg::ref_ptr< OSGTileFactory > | _tileFactory |
TaskServiceMap | _taskServices |
osg::ref_ptr< const Profile > | _profile |
OpenThreads::Mutex | _taskServiceMutex |
bool | _alwaysUpdate |
int | _numLoadingThreads |
int | _onDemandDelay |
bool | _registeredWithReleaseGLCallback |
LoadingPolicy | _loadingPolicy |
const MapFrame & | _update_mapf |
const MapFrame & | _cull_mapf |
bool | _quickReleaseGLObjects |
bool | _quickReleaseCallbackInstalled |
UID | _elevationTaskServiceUID |
An osgTerrain derivation that tracks a revision number. When the revision number changes, this incidates to member tiles that something substantial (like the map model) has changed and that they need to regenreate, update, or otherwise accomodate the change.
Individual tiles have their own Revision numbers, which are unrelated. These change with every change to the physical tile.
Definition at line 67 of file CustomTerrain.
typedef std::map< int, osg::ref_ptr< TaskService > > CustomTerrain::TaskServiceMap [private] |
Definition at line 159 of file CustomTerrain.
typedef std::queue< osgTerrain::TileID > CustomTerrain::TileIDQueue [protected] |
Definition at line 128 of file CustomTerrain.
typedef std::list< osg::ref_ptr<CustomTile> > CustomTerrain::TileList [protected] |
Definition at line 126 of file CustomTerrain.
typedef std::queue< osg::ref_ptr<CustomTile> > CustomTerrain::TileQueue [protected] |
Definition at line 125 of file CustomTerrain.
typedef std::map< osgTerrain::TileID, osg::ref_ptr<CustomTile> > CustomTerrain::TileTable [protected] |
Definition at line 123 of file CustomTerrain.
typedef std::vector< osg::ref_ptr<CustomTile> > CustomTerrain::TileVector [protected] |
Definition at line 127 of file CustomTerrain.
CustomTerrain::CustomTerrain | ( | const MapFrame & | update_mapf, |
const MapFrame & | cull_mapf, | ||
OSGTileFactory * | factory, | ||
bool | quickReleaseGLObjects | ||
) |
CustomTerrain::~CustomTerrain | ( | ) | [protected] |
virtual const char* CustomTerrain::className | ( | ) | const [inline, virtual] |
Definition at line 77 of file CustomTerrain.
{ return "CustomTerrain"; }
TaskService* CustomTerrain::createTaskService | ( | const std::string & | name, |
int | id, | ||
int | numThreads | ||
) | [private] |
void CustomTerrain::decDelay | ( | ) | [private] |
const MapFrame& CustomTerrain::getCullThreadMapFrame | ( | ) | [inline] |
Definition at line 99 of file CustomTerrain.
{ return _cull_mapf; }
void CustomTerrain::getCustomTile | ( | const osgTerrain::TileID & | , |
osg::ref_ptr< CustomTile > & | out_tile, | ||
bool | lock = true |
||
) |
void CustomTerrain::getCustomTiles | ( | TileVector & | out_tiles | ) |
TaskService* CustomTerrain::getElevationTaskService | ( | ) |
TaskService* CustomTerrain::getImageryTaskService | ( | int | layerId | ) |
const LoadingPolicy& CustomTerrain::getLoadingPolicy | ( | ) | const |
unsigned int CustomTerrain::getNumTasksRemaining | ( | ) | const |
Gets the total number of tasks remaining in all of the TaskServices this CustomTerrain is managing
bool CustomTerrain::getQuickReleaseGLObjects | ( | ) | const [inline] |
Definition at line 92 of file CustomTerrain.
{ return _quickReleaseGLObjects; }
int CustomTerrain::getRevision | ( | ) | const |
Gets the current terrain configuration revision.
TaskService* CustomTerrain::getTaskService | ( | int | id | ) | [private] |
OSGTileFactory* CustomTerrain::getTileFactory | ( | ) |
TaskService* CustomTerrain::getTileGenerationTaskSerivce | ( | ) |
const MapFrame& CustomTerrain::getUpdateThreadMapFrame | ( | ) | [inline] |
Definition at line 98 of file CustomTerrain.
{ return _update_mapf; }
void CustomTerrain::incrementRevision | ( | ) |
Bumps the version number up by one. Versioned Tiles attached to this terrain will detect the mismatch and regenerate themselves.
virtual const char* CustomTerrain::libraryName | ( | ) | const [inline, virtual] |
Definition at line 76 of file CustomTerrain.
{ return "osgEarth"; }
void CustomTerrain::refreshFamily | ( | const MapInfo & | info, |
const TileKey & | key, | ||
Relative * | family, | ||
bool | tileTableLocked | ||
) | [private] |
void CustomTerrain::registerTile | ( | CustomTile * | newTile | ) |
void CustomTerrain::releaseGLObjectsForTiles | ( | osg::State * | ) |
void CustomTerrain::setDelay | ( | unsigned | frames | ) | [private] |
virtual void CustomTerrain::traverse | ( | osg::NodeVisitor & | nv | ) | [virtual] |
bool CustomTerrain::updateBudgetRemaining | ( | ) | const |
void CustomTerrain::updateTaskServiceThreads | ( | const MapFrame & | mapf | ) |
Updates the catalog of task service threads - this gets called by the OSGTerrainEngine in response to a change in the Map's data model. The map frame is that of the terrain engine.
bool CustomTerrain::_alwaysUpdate [private] |
Definition at line 165 of file CustomTerrain.
const MapFrame& CustomTerrain::_cull_mapf [private] |
Definition at line 178 of file CustomTerrain.
UID CustomTerrain::_elevationTaskServiceUID [private] |
Definition at line 183 of file CustomTerrain.
LoadingPolicy CustomTerrain::_loadingPolicy [private] |
Definition at line 174 of file CustomTerrain.
int CustomTerrain::_numLoadingThreads [private] |
Definition at line 166 of file CustomTerrain.
int CustomTerrain::_onDemandDelay [private] |
Definition at line 167 of file CustomTerrain.
osg::ref_ptr<const Profile> CustomTerrain::_profile [private] |
Definition at line 162 of file CustomTerrain.
bool CustomTerrain::_quickReleaseCallbackInstalled [private] |
Definition at line 181 of file CustomTerrain.
bool CustomTerrain::_quickReleaseGLObjects [private] |
Definition at line 180 of file CustomTerrain.
bool CustomTerrain::_registeredWithReleaseGLCallback [private] |
Definition at line 171 of file CustomTerrain.
int CustomTerrain::_revision [private] |
Definition at line 155 of file CustomTerrain.
OpenThreads::Mutex CustomTerrain::_revisionMutex [private] |
Definition at line 156 of file CustomTerrain.
OpenThreads::Mutex CustomTerrain::_taskServiceMutex [private] |
Definition at line 163 of file CustomTerrain.
TaskServiceMap CustomTerrain::_taskServices [private] |
Definition at line 160 of file CustomTerrain.
osg::ref_ptr<OSGTileFactory> CustomTerrain::_tileFactory [private] |
Definition at line 158 of file CustomTerrain.
TileTable CustomTerrain::_tiles [protected] |
Definition at line 131 of file CustomTerrain.
Threading::ReadWriteMutex CustomTerrain::_tilesMutex [protected] |
Definition at line 130 of file CustomTerrain.
TileQueue CustomTerrain::_tilesToRelease [protected] |
Definition at line 133 of file CustomTerrain.
Threading::Mutex CustomTerrain::_tilesToReleaseMutex [protected] |
Definition at line 135 of file CustomTerrain.
TileList CustomTerrain::_tilesToShutDown [protected] |
Definition at line 132 of file CustomTerrain.
const MapFrame& CustomTerrain::_update_mapf [private] |
Definition at line 177 of file CustomTerrain.