![]() |
VR-Forces 5.0.3 Developer's Guide
|
Thread object to convert tree marker requests into tree records in a worker thread.

Public Types | |
| typedef std::list < DtTreeRequestOutput > | RequestOutputList |
| typedef std::unordered_set < const osg::Node * > | NodeSet |
| typedef std::unordered_set < DtStreamedSpeedTreeForest * > | ForestSet |
| typedef std::unordered_set < std::string > | StringSet |
Public Member Functions | |
| virtual | ~DtStreamedSpeedTreeThread () |
| RequestOutputList & | requestOutput () |
| NodeSet & | unloaded () |
| void | setForestDeleted (DtStreamedSpeedTreeForest *forest) |
| void | setNodeUnloaded (const osg::Node *node) |
| void | enqueue (const osgEarth::CustomFeatureNode *featureNode, DtTreeRequestOutput *out, DtStreamedSpeedTreeForest *forest, const osg::Node *dataNode, bool useScaleRandomization, bool useOrientationRandomization, float treeMinScale, float treeMaxScale) |
| virtual void | run () |
| void | handleRequest (const DtTreeRequestMessage &msg) |
| bool | isForestDeleted (DtStreamedSpeedTreeForest *forest) |
| bool | isNodeUnloaded (const osg::Node *node) |
| void | mergeTreeRequests () |
| void | block () |
| void | release () |
| virtual void | updateBlock () |
| virtual void | stopMergingWork () |
| virtual bool | workToDo () const |
| virtual bool | fetchAndActivateTask () |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| virtual | ~DtVirtualBaseClass () |
Static Public Member Functions | |
| static DtStreamedSpeedTreeThread & | instance (DtDe &de) |
| static std::size_t | hash_value (const std::string &modelDefName, const osgEarth::CustomFeatureNode::OsgEarthMarkerRequest &val) |
Protected Member Functions | |
| DtStreamedSpeedTreeThread (DtDe &de) | |
| virtual double | rotationAngleFromGeocentricQuaternion (const osg::Quat &rotation, const osg::Vec3d &location) |
Protected Attributes | |
| DtDe & | myDe |
| std::deque < DtTreeRequestMessage * > | myMessageQueue |
| OpenThreads::Block | myBlock |
| boost::mutex | myMessageQueueMutex |
| StringSet | myValidModelDefinitions |
| ForestSet | myDeletedForests |
| RequestOutputList | myTreeRequestOutput |
| NodeSet | myUnloadedNodes |
| bool | myTimeToStop |
| osg::EllipsoidModel * | myEllipsoidModel |
| tbb::atomic< bool > | myStopWork |
| tbb::atomic< bool > | myWorkToDo |
| tbb::atomic< bool > | myTbbTaskActive |
Private Member Functions | |
| DtStreamedSpeedTreeThread () | |
| typedef std::list<DtTreeRequestOutput> makVrv::DtStreamedSpeedTreeThread::RequestOutputList |
List type for output objects.
| typedef std::unordered_set<const osg::Node*> makVrv::DtStreamedSpeedTreeThread::NodeSet |
Set of request nodes.
| typedef std::unordered_set<DtStreamedSpeedTreeForest*> makVrv::DtStreamedSpeedTreeThread::ForestSet |
Set of forests.
| typedef std::unordered_set<std::string> makVrv::DtStreamedSpeedTreeThread::StringSet |
Set of model definition names.
|
virtual |
DTOR.
|
protected |
CTOR.
|
private |
Unimplemented default 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 | ( | const osg::Node * | node | ) |
Add a node to the unloaded set.
| void makVrv::DtStreamedSpeedTreeThread::enqueue | ( | const osgEarth::CustomFeatureNode * | featureNode, |
| DtTreeRequestOutput * | out, | ||
| DtStreamedSpeedTreeForest * | forest, | ||
| const 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 DtTreeRequestMessage & | 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 | ( | const osg::Node * | node | ) |
Check whether a node is in the unloaded set.
|
static |
Marker request hash function.
Hashes on request name and XYZ position
| void makVrv::DtStreamedSpeedTreeThread::mergeTreeRequests | ( | ) |
Callback to merge processed tree requests into a SpeedTree forest called by persistent job.
| void makVrv::DtStreamedSpeedTreeThread::block | ( | ) |
Wait, don't process more trees.
| void makVrv::DtStreamedSpeedTreeThread::release | ( | ) |
Allow more tree processing.
|
virtual |
Tell the SpeedTreeThread there are more trees to process.
|
virtual |
Tell the SpeedTreeThread merging code to wait till next frame.
|
virtual |
check if there is work for this thread to merge
|
virtual |
Return the current task active value and set it to true.
|
protectedvirtual |
|
protected |
|
protected |
Queue of marker request messages.
Lock qm before using
|
protected |
|
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.
|
protected |
|
protected |
Flag to tell the merging to stop.
|
protected |
|
protected |