20 #include <osg/ref_ptr>
21 #include <osg/OperationThread>
23 #include <OpenThreads/Thread>
24 #include <OpenThreads/Block>
26 #include <boost/thread/mutex.hpp>
27 #include <boost/unordered_set.hpp>
28 #include <tbb/atomic.h>
47 class DtStreamedSpeedTreeForest;
48 class DtSpeedTreeMergeJob;
49 class DtStreamedSpeedTreeThread;
57 virtual void operator () (osg::Object* sv);
60 virtual void release();
72 virtual tbb::task* execute();
125 , myUseScaleRandomization(false)
126 , myUseOrientationRandomization(false)
127 , myTreeMinScale(1.0)
128 , myTreeMaxScale(1.0)
167 typedef boost::unordered_set<const osg::Node*>
NodeSet;
170 typedef boost::unordered_set<DtStreamedSpeedTreeForest*>
ForestSet;
191 void setNodeUnloaded(
const osg::Node* node);
198 const osg::Node* dataNode,
199 bool useScaleRandomization,
200 bool useOrientationRandomization,
214 bool isNodeUnloaded(
const osg::Node* node);
219 static std::size_t
hash_value(
const std::string& modelDefName,
223 void mergeTreeRequests(osg::RenderInfo& renderInfo);
232 virtual void updateBlock();
244 virtual double rotationAngleFromGeocentricQuaternion(
const osg::Quat& rotation,
245 const osg::Vec3d& location);
boost::unordered_set< const osg::Node * > NodeSet
Set of request nodes.
Definition: DtStreamedSpeedTreeThread.h:167
DtDe & myDe
Definition: DtStreamedSpeedTreeThread.h:253
TreeRequestOutput * myOutput
Pointer to an output object.
Definition: DtStreamedSpeedTreeThread.h:140
OpenThreads::Thread Thread
Definition: DtOsgThreadingUtils.h:14
float myTreeMinScale
Definition: DtStreamedSpeedTreeThread.h:149
Virtual base class.
Definition: DtVirtualBaseClass.h:22
float myTreeMaxScale
Definition: DtStreamedSpeedTreeThread.h:150
DtStreamedSpeedTreeForest manages the streaming management for The DtSpeedTreeForest that is contains...
Definition: DtStreamedSpeedTreeForest.h:50
#define DT_DLL_VRVST
Definition: vrvSt.h:23
tbb::atomic< bool > myStopWork
Flag to tell the merging to stop.
Definition: DtStreamedSpeedTreeThread.h:295
osg::ref_ptr< const osgEarth::CustomFeatureNode > myFeatureNode
Request list.
Definition: DtStreamedSpeedTreeThread.h:134
RequestStatus
Status of a request to convert markers.
Definition: DtStreamedSpeedTreeThread.h:90
osg::Operation responsible for launching async tbb task, currently done in swap buffers ...
Definition: DtStreamedSpeedTreeThread.h:53
std::deque< TreeRequestMsg * > myMessageQueue
Queue of marker request messages.
Definition: DtStreamedSpeedTreeThread.h:258
~TreeRequestMsg()
Definition: DtStreamedSpeedTreeThread.h:131
OpenThreads::Block myBlock
Definition: DtStreamedSpeedTreeThread.h:261
virtual bool runningMerge()
Definition: DtStreamedSpeedTreeThread.h:238
Contains DLL export macros.
NodeSet myUnloadedNodes
Set of unloaded feature request nodes.
Definition: DtStreamedSpeedTreeThread.h:287
DtStreamedSpeedTreeThread * myThread
Definition: DtStreamedSpeedTreeThread.h:62
StringSet myValidModelDefinitions
Cache of valid SpeedTree model definitions.
Definition: DtStreamedSpeedTreeThread.h:269
tbb::atomic< bool > myWorkToDo
Definition: DtStreamedSpeedTreeThread.h:296
RequestOutputList myTreeRequestOutput
List of allocated output objects.
Definition: DtStreamedSpeedTreeThread.h:281
The Filter pushes these onto the CustomFeatureNode's MarkerRequestList.
Definition: CustomFeatureNode.h:51
virtual void stopMergingWork()
Tell the SpeedTreeThread merging code to wait till next frame.
Definition: DtStreamedSpeedTreeThread.h:235
osgUtil::SceneView * mySceneView
Definition: DtStreamedSpeedTreeThread.h:75
Contains makVrv::DtVirtualBaseClass class.
osg::EllipsoidModel * myEllipsoidModel
Definition: DtStreamedSpeedTreeThread.h:292
Custom Feature Node.
Definition: CustomFeatureNode.h:43
boost::mutex myMessageQueueMutex
Mutex controlling access to q.
Definition: DtStreamedSpeedTreeThread.h:264
Contains the CustomFeatureNode class declaration.
DtStreamedSpeedTreeThread * myThread
Definition: DtStreamedSpeedTreeThread.h:74
TreeRequestMsg()
Definition: DtStreamedSpeedTreeThread.h:122
A message to convert some tree requests into tree records.
Definition: DtStreamedSpeedTreeThread.h:119
Output of a processed set of marker requests.
Definition: DtStreamedSpeedTreeThread.h:96
bool myTimeToStop
Flag to tell the thread to stop.
Definition: DtStreamedSpeedTreeThread.h:290
bool myUseScaleRandomization
Definition: DtStreamedSpeedTreeThread.h:147
Thread object to convert tree marker requests into tree records in a worker thread.
Definition: DtStreamedSpeedTreeThread.h:80
virtual bool workToDo()
Definition: DtStreamedSpeedTreeThread.h:237
Definition: DtStreamedSpeedTreeThread.h:90
const osg::Node * myDataNode
Node source of the marker requests.
Definition: DtStreamedSpeedTreeThread.h:154
bool myUseOrientationRandomization
Definition: DtStreamedSpeedTreeThread.h:148
boost::unordered_set< std::string > StringSet
Set of model definition names.
Definition: DtStreamedSpeedTreeThread.h:173
tbb::atomic< bool > myRunningMerge
Definition: DtStreamedSpeedTreeThread.h:297
boost::unordered_set< DtStreamedSpeedTreeForest * > ForestSet
Set of forests.
Definition: DtStreamedSpeedTreeThread.h:170
ForestSet myDeletedForests
Set of deleted forest objects.
Definition: DtStreamedSpeedTreeThread.h:275
std::list< TreeRequestOutput > RequestOutputList
List type for output objects.
Definition: DtStreamedSpeedTreeThread.h:164
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
DtStreamedSpeedTreeForest * myForest
The forest making the request.
Definition: DtStreamedSpeedTreeThread.h:102
Async task responsible for adding trees during swap buffers, launched by DtSpeedTreeMergeJob.
Definition: DtStreamedSpeedTreeThread.h:67
DtStreamedSpeedTreeForest * myForest
Forest requesting the markers.
Definition: DtStreamedSpeedTreeThread.h:143
std::vector< DtVectorTreeRecords > myRecordsArray
Record output.
Definition: DtStreamedSpeedTreeThread.h:99
std::size_t hash_value(DtUnicode const &val)
Definition: DtUnicode.h:321
Contains makVrv::DtTreeRecord class.
volatile RequestStatus myStatus
Current status of this output object.
Definition: DtStreamedSpeedTreeThread.h:115
const osg::Node * myDataNode
The request node from osgEarth.
Definition: DtStreamedSpeedTreeThread.h:107