VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Attributes
makVrv::DtStreamedSpeedTreeForest Class Reference

DtStreamedSpeedTreeForest manages the streaming management for the DtSpeedTreeForest that it contains.

Inheritance diagram for makVrv::DtStreamedSpeedTreeForest:
Inheritance graph
[legend]

Public Member Functions

virtual ~DtStreamedSpeedTreeForest ()
 
 DtStreamedSpeedTreeForest ()=delete
 
 DtStreamedSpeedTreeForest (const DtStreamedSpeedTreeForest &other)=delete
 
DtStreamedSpeedTreeForest & operator= (const DtStreamedSpeedTreeForest &other)=delete
 
virtual void onDataLoaded (const DtOsgTerrainPatchObject &patch, const osgEarth::Layer *layer, const osg::Node *data)
 
virtual void onDataUnLoaded (const osgEarth::Layer *layer, const osg::Node *data)
 
virtual void onLayerVisibilityChanged (const osgEarth::VisibleLayer *layer)
 
virtual bool removeForestFromMapData (const osg::Node *dataNode)
 
virtual void addTreesAndMapToCell (const osg::Node *dataNode, DtVectorTreeRecords &treeRecords)
 
virtual void addTreesAndProcessUninitialized (const osg::Node *dataNode, std::unordered_map< std::string, std::vector< DtTreeRecord * >> &modelDefsToTrees)
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Protected Types

typedef std::map< std::string,
std::pair< std::string, bool > > 
MarkerToModelDefinition
 
typedef std::unordered_map
< const osg::Node
*, CellNodeObserver * > 
MapCellsToObservers
 
typedef std::set< DtUniqueID > IdSet
 
typedef std::unordered_map
< const osg::Node *, IdSet > 
MapCellsToSubCells
 

Protected Member Functions

 DtStreamedSpeedTreeForest (DtDe &de, DtUniqueID id)
 
virtual void processNewFeatures (const DtOsgTerrainPatchObject &patch, const osg::Node *data)
 
virtual void processNewFeature (const DtOsgTerrainPatchObject &patch, const osgEarth::CustomFeatureNode *featureNode, const osg::Node *data)
 
virtual bool observerExists (const osg::Node *data) const
 
virtual void createObserver (const osgEarth::Layer *layer, const osg::Node *data)
 
virtual void destroyObserver (const osg::Node *data)
 
virtual void removeAndDestroyAllObservers ()
 
virtual void mapDataToCell (const osg::Node *dataNode, DtUniqueID cellID)
 

Static Protected Member Functions

static bool verifyExists (const osg::Observer *lhs, const osg::Node *data)
 
static bool getValidTreeModelDefinition (DtDe &de, std::string &strCleanModelName, const std::string &strModelName, MarkerToModelDefinition &cache)
 

Protected Attributes

DtDe & myDe
 
DtSpeedTreeForest * myForest
 
MapCellsToObservers myMapCellsToObservers
 
MapCellsToSubCells myMapCellsToSubCells
 
tbb::mutex myMapCellsToSubCellsMutex
 
std::thread::id myOwningThreadId
 

Private Attributes

friend DtStreamedSpeedTreeForestCreator
 

Member Typedef Documentation

typedef std::map<std::string, std::pair<std::string, bool> > makVrv::DtStreamedSpeedTreeForest::MarkerToModelDefinition
protected
typedef std::unordered_map<const osg::Node*, CellNodeObserver*> makVrv::DtStreamedSpeedTreeForest::MapCellsToObservers
protected
typedef std::unordered_map<const osg::Node*, IdSet> makVrv::DtStreamedSpeedTreeForest::MapCellsToSubCells
protected

Constructor & Destructor Documentation

virtual makVrv::DtStreamedSpeedTreeForest::~DtStreamedSpeedTreeForest ( )
virtual

Destructor.

makVrv::DtStreamedSpeedTreeForest::DtStreamedSpeedTreeForest ( )
delete

Default Constructor not implemented.

makVrv::DtStreamedSpeedTreeForest::DtStreamedSpeedTreeForest ( const DtStreamedSpeedTreeForest &  other)
delete

Copy Constructor not implemented – Copy Not Allowed.

makVrv::DtStreamedSpeedTreeForest::DtStreamedSpeedTreeForest ( DtDe &  de,
DtUniqueID  id 
)
protected

Constructor.

Member Function Documentation

DtStreamedSpeedTreeForest& makVrv::DtStreamedSpeedTreeForest::operator= ( const DtStreamedSpeedTreeForest &  other)
delete

Assignment Operator Not implemented Assignment Not Allowed.

virtual void makVrv::DtStreamedSpeedTreeForest::onDataLoaded ( const DtOsgTerrainPatchObject &  patch,
const osgEarth::Layer *  layer,
const osg::Node *  data 
)
virtual

Called to process new data as it is loaded by osgEarth. This is run after the data has been added to the scene graph. Main thread only.

virtual void makVrv::DtStreamedSpeedTreeForest::onDataUnLoaded ( const osgEarth::Layer *  layer,
const osg::Node *  data 
)
virtual

Called to unload data as it is unloaded by osgEarth. Main thread only.

virtual void makVrv::DtStreamedSpeedTreeForest::onLayerVisibilityChanged ( const osgEarth::VisibleLayer *  layer)
virtual

Called when the visibility of a layer changes. Main thread only.

virtual bool makVrv::DtStreamedSpeedTreeForest::removeForestFromMapData ( const osg::Node *  dataNode)
virtual

Un-maps the node from the cellID it is mapped to, if any. Returns true if the node was unmapped, false if the node was not mapped. Main thread only.

virtual void makVrv::DtStreamedSpeedTreeForest::addTreesAndMapToCell ( const osg::Node *  dataNode,
DtVectorTreeRecords &  treeRecords 
)
virtual

Adds unique trees to a unique cell in the underlying forest and maps the data node to the resulting cell ID. Background thread and Main thread.

virtual void makVrv::DtStreamedSpeedTreeForest::addTreesAndProcessUninitialized ( const osg::Node *  dataNode,
std::unordered_map< std::string, std::vector< DtTreeRecord * >> &  modelDefsToTrees 
)
virtual

Adds trees from multiple model definitions to unique cells, maps the data node to each resulting cell ID, and processes any uninitialized trees if the forest is already initialized. Background thread only (called from DtStreamedSpeedTreeThread).

virtual void makVrv::DtStreamedSpeedTreeForest::processNewFeatures ( const DtOsgTerrainPatchObject &  patch,
const osg::Node *  data 
)
protectedvirtual

Called to process features from the given patch from osgEarth. Runs a visitor to find all the features in the patch, and adds them to the forest.

virtual void makVrv::DtStreamedSpeedTreeForest::processNewFeature ( const DtOsgTerrainPatchObject &  patch,
const osgEarth::CustomFeatureNode *  featureNode,
const osg::Node *  data 
)
protectedvirtual

Process a new feature as it is loaded by osgEarth.

virtual bool makVrv::DtStreamedSpeedTreeForest::observerExists ( const osg::Node *  data) const
protectedvirtual

Returns true if an observer for the given data node already exists, false otherwise.

virtual void makVrv::DtStreamedSpeedTreeForest::createObserver ( const osgEarth::Layer *  layer,
const osg::Node *  data 
)
protectedvirtual

Creates an observer for the given data node and adds it to the map of observers.

virtual void makVrv::DtStreamedSpeedTreeForest::destroyObserver ( const osg::Node *  data)
protectedvirtual

Deletes the observer associated with the given node and erases the observer from the map of observers.

virtual void makVrv::DtStreamedSpeedTreeForest::removeAndDestroyAllObservers ( )
protectedvirtual

Destroys all observers (called from the class destructor).

virtual void makVrv::DtStreamedSpeedTreeForest::mapDataToCell ( const osg::Node *  dataNode,
DtUniqueID  cellID 
)
protectedvirtual

Maps the node to the given cellID. Background thread and Main thread.

static bool makVrv::DtStreamedSpeedTreeForest::verifyExists ( const osg::Observer *  lhs,
const osg::Node *  data 
)
staticprotected

Helper function to verify that the given observer is observing the given data node. Only used in assertions.

static bool makVrv::DtStreamedSpeedTreeForest::getValidTreeModelDefinition ( DtDe &  de,
std::string &  strCleanModelName,
const std::string &  strModelName,
MarkerToModelDefinition &  cache 
)
staticprotected

Helper function to get the clean model name and determine if it is a valid speed tree name. Caches results in the given cache. Returns true if the model name is valid, false otherwise.

Member Data Documentation

friend makVrv::DtStreamedSpeedTreeForest::DtStreamedSpeedTreeForestCreator
private
DtDe& makVrv::DtStreamedSpeedTreeForest::myDe
protected
DtSpeedTreeForest* makVrv::DtStreamedSpeedTreeForest::myForest
protected
MapCellsToObservers makVrv::DtStreamedSpeedTreeForest::myMapCellsToObservers
protected
MapCellsToSubCells makVrv::DtStreamedSpeedTreeForest::myMapCellsToSubCells
protected
tbb::mutex makVrv::DtStreamedSpeedTreeForest::myMapCellsToSubCellsMutex
protected
std::thread::id makVrv::DtStreamedSpeedTreeForest::myOwningThreadId
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)