osgEarth 2.1.1
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes

CustomTerrain Class Reference

Collaboration diagram for CustomTerrain:

List of all members.

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
OSGTileFactorygetTileFactory ()
bool getQuickReleaseGLObjects () const
TaskServicegetImageryTaskService (int layerId)
TaskServicegetElevationTaskService ()
TaskServicegetTileGenerationTaskSerivce ()
const MapFramegetUpdateThreadMapFrame ()
const MapFramegetCullThreadMapFrame ()
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 LoadingPolicygetLoadingPolicy () 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

TaskServicecreateTaskService (const std::string &name, int id, int numThreads)
TaskServicegetTaskService (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

Detailed Description

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.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

CustomTerrain::CustomTerrain ( const MapFrame update_mapf,
const MapFrame cull_mapf,
OSGTileFactory factory,
bool  quickReleaseGLObjects 
)
CustomTerrain::~CustomTerrain ( ) [protected]

Member Function Documentation

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.

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.


Member Data Documentation

Definition at line 165 of file CustomTerrain.

Definition at line 178 of file CustomTerrain.

Definition at line 183 of file CustomTerrain.

Definition at line 174 of file CustomTerrain.

Definition at line 166 of file CustomTerrain.

Definition at line 167 of file CustomTerrain.

osg::ref_ptr<const Profile> CustomTerrain::_profile [private]

Definition at line 162 of file CustomTerrain.

Definition at line 181 of file CustomTerrain.

Definition at line 180 of file CustomTerrain.

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.

Definition at line 160 of file CustomTerrain.

Definition at line 158 of file CustomTerrain.

Definition at line 131 of file CustomTerrain.

Definition at line 130 of file CustomTerrain.

Definition at line 133 of file CustomTerrain.

Definition at line 135 of file CustomTerrain.

Definition at line 132 of file CustomTerrain.

Definition at line 177 of file CustomTerrain.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines