![]() |
VR-Forces Development_Version Class Documentation
|
Thread object to convert tree marker requests into tree records in a worker thread. More...

Classes | |
| struct | TreeRequestMsg |
| A message to convert some tree requests into tree records. More... | |
| struct | TreeRequestOutput |
| Output of a processed set of marker requests. More... | |
Public Types | |
| enum | RequestStatus { UNUSED, WORKING, DONE } |
| Status of a request to convert markers. More... | |
| typedef std::list < TreeRequestOutput > | RequestOutputList |
| List type for output objects. | |
| typedef boost::unordered_set < osg::Node * > | NodeSet |
| Set of request nodes. | |
| typedef boost::unordered_set < DtStreamedSpeedTreeForest * > | ForestSet |
| Set of forests. | |
| typedef boost::unordered_set < std::string > | StringSet |
| Set of model definition names. | |
Public Member Functions | |
| virtual | ~DtStreamedSpeedTreeThread () |
| DTOR. | |
| RequestOutputList & | requestOutput () |
| List of allocated output objects. | |
| NodeSet & | unloaded () |
| Set of unloaded feature request nodes. | |
| void | setForestDeleted (DtStreamedSpeedTreeForest *forest) |
| Add a forest object to the deleted set. | |
| void | setNodeUnloaded (osg::Node *node) |
| Add a node to the unloaded set. | |
| void | enqueue (const osgEarth::Features::CustomFeatureNode::MarkerRequestList &requests, TreeRequestOutput *out, DtStreamedSpeedTreeForest *forest, osg::Node *dataNode, bool useScaleRandomization, bool useOrientationRandomization, float treeMinScale, float treeMaxScale) |
| Enqueue a new request message. | |
| virtual void | run () |
| Thread main loop. | |
| void | handleRequest (const TreeRequestMsg &msg) |
| Process the message into tree records. | |
| bool | isForestDeleted (DtStreamedSpeedTreeForest *forest) |
| Check whether a forest is in the deleted set. | |
| bool | isNodeUnloaded (osg::Node *node) |
| Check whether a node is in the unloaded set. | |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| Do nothing constructor. | |
| virtual | ~DtVirtualBaseClass () |
| Virtual do nothing destructor. | |
Static Public Member Functions | |
| static DtStreamedSpeedTreeThread & | instance (DtDe &de) |
| Get the instance of the thread object from its owner de. | |
| static std::size_t | hash_value (const std::string &modelDefName, const osgEarth::Features::CustomFeatureNode::OsgEarthMarkerRequest &val) |
| Marker request hash function. | |
| static void | mergeTreeRequests (DtDe &de) |
| Callback to merge processed tree requests into a SpeedTree forest. | |
Protected Member Functions | |
| DtStreamedSpeedTreeThread (DtDe &de) | |
| CTOR. | |
Protected Attributes | |
| DtDe & | myDe |
| std::deque< TreeRequestMsg > | myMessageQueue |
| Queue of marker request messages. | |
| boost::mutex | myMessageQueueMutex |
| Mutex controlling access to q. | |
| StringSet | myValidModelDefinitions |
| Cache of valid SpeedTree model definitions. | |
| ForestSet | myDeletedForests |
| Set of deleted forest objects. | |
| RequestOutputList | myTreeRequestOutput |
| List of allocated output objects. | |
| NodeSet | myUnloadedNodes |
| Set of unloaded feature request nodes. | |
| bool | myTimeToStop |
| Flag to tell the thread to stop. | |
Thread object to convert tree marker requests into tree records in a worker thread.
| typedef std::list<TreeRequestOutput> makVrv::DtStreamedSpeedTreeThread::RequestOutputList |
List type for output objects.
| typedef boost::unordered_set<osg::Node*> makVrv::DtStreamedSpeedTreeThread::NodeSet |
Set of request nodes.
| typedef boost::unordered_set<DtStreamedSpeedTreeForest*> makVrv::DtStreamedSpeedTreeThread::ForestSet |
Set of forests.
| typedef boost::unordered_set<std::string> makVrv::DtStreamedSpeedTreeThread::StringSet |
Set of model definition names.
|
virtual |
DTOR.
|
protected |
CTOR.
|
static |
Get the instance of the thread object from its owner de.
| RequestOutputList& makVrv::DtStreamedSpeedTreeThread::requestOutput | ( | ) |
List of allocated output objects.
Requestors should find an unused output object if possible and if not, push a new one to the end of the list
| NodeSet& makVrv::DtStreamedSpeedTreeThread::unloaded | ( | ) |
Set of unloaded feature request nodes.
Requestors should add nodes to this set when they are deleted to prevent adding trees after deletion
| void makVrv::DtStreamedSpeedTreeThread::setForestDeleted | ( | DtStreamedSpeedTreeForest * | forest | ) |
Add a forest object to the deleted set.
| void makVrv::DtStreamedSpeedTreeThread::setNodeUnloaded | ( | osg::Node * | node | ) |
Add a node to the unloaded set.
| void makVrv::DtStreamedSpeedTreeThread::enqueue | ( | const osgEarth::Features::CustomFeatureNode::MarkerRequestList & | requests, |
| TreeRequestOutput * | out, | ||
| DtStreamedSpeedTreeForest * | forest, | ||
| osg::Node * | dataNode, | ||
| bool | useScaleRandomization, | ||
| bool | useOrientationRandomization, | ||
| float | treeMinScale, | ||
| float | treeMaxScale | ||
| ) |
Enqueue a new request message.
|
virtual |
Thread main loop.
| void makVrv::DtStreamedSpeedTreeThread::handleRequest | ( | const TreeRequestMsg & | msg | ) |
Process the message into tree records.
| bool makVrv::DtStreamedSpeedTreeThread::isForestDeleted | ( | DtStreamedSpeedTreeForest * | forest | ) |
Check whether a forest is in the deleted set.
| bool makVrv::DtStreamedSpeedTreeThread::isNodeUnloaded | ( | osg::Node * | node | ) |
Check whether a node is in the unloaded set.
|
static |
Marker request hash function.
Hashes on request name and XYZ position
|
static |
Callback to merge processed tree requests into a SpeedTree forest.
Connected to DtDe::signal_postTick
|
protected |
|
protected |
Queue of marker request messages.
Lock qm before using
|
protected |
Mutex controlling access to q.
|
protected |
Cache of valid SpeedTree model definitions.
Allows filtering out requests with invalid model definitions
|
protected |
Set of deleted forest objects.
The forest object adds itself here on deletion to avoid adding trees to a deleted forest
|
protected |
List of allocated output objects.
Requestors should find an unused output object if possible and if not, push a new one to the end of the list
|
protected |
Set of unloaded feature request nodes.
Requestors should add nodes to this set when they are deleted to prevent adding trees after deletion
|
protected |
Flag to tell the thread to stop.