VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtDiGuyOctreeCullGroup.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <osg/Group>
13 #include <osg/OperationThread>
14 #include <osg/Matrix>
15 
16 #include <vrvDiGuy/vrvDiGuy.h>
17 
20 
21 #include <tbb/concurrent_vector.h>
22 #include <tbb/mutex.h>
23 #include <tbb/task.h>
24 
25 namespace makVrv
26 {
27  class DtOsgCullVisitor;
28  class DtDiGuyScenario;
29  class DtDe;
30  class DtDiGuyOsgRootNode;
31  class DtDiGuyInstanceDrawable;
32 
36  {
38  DtDiGuyCullData(DtOsgCullVisitor* dtcv, float culldistance);
39  osg::Matrixd myProjectionMatrix;
40  osg::Matrixd myViewMatrix;
41  osg::Vec3d myCameraPosition;
42  float myCameraMag;
43  unsigned int myTraversalNum;
44  };
45 
48  class DT_DLL_VRVDIGUY DtDiGuyInstanceTboUpdaterJob : public osg::Operation
49  {
50  public:
52  friend class DtInstanceManagerTboUpdaterCreator;
53 
56 
60  virtual void operator () (osg::Object* sv);
61 
62  private:
63 
70 
71  protected:
74  };
75 
78  class DT_DLL_VRVDIGUY DtDiGuyOctreeCullGroup : public osg::Group
79  {
80  public:
81 
82  DtDiGuyOctreeCullGroup(DtDiGuyScenario& scenario, tbb::concurrent_vector< DtDiGuyOsgRootNode*>& noninstancedarray,
83  DtDiGuyInstanceDrawable& instanceDrawable);
84  virtual ~DtDiGuyOctreeCullGroup();
85 
86  virtual void traverse(osg::NodeVisitor& nv);
87  virtual void precull(const DtDiGuyCullData& pcd, bool async);
88  virtual void setCullNeedsToRun(bool needsToRun);
89 
90  friend class DtDiGuyCullAsyncTask;
91  friend class DtDiguyPreCullJob;
92 
93  protected:
94 
98  tbb::concurrent_vector< DtDiGuyOsgRootNode*>& myNoninstancedNodeArray;
99  tbb::mutex myAsyncMutex;
101  };
102 
103 
104 
107  class DT_DLL_VRVDIGUY DtDiguyPreCullJob : public osg::Operation
108  {
109  public:
112 
113  private:
117  DtDiguyPreCullJob(const DtDiguyPreCullJob &other);
119  DtDiguyPreCullJob &operator=(const DtDiguyPreCullJob &other);
120 
121  public:
122 
124  virtual void operator () (osg::Object* sv);
125 
126  protected:
130 
131  };
132 
133 
136  class DtDiGuyCullAsyncTask : public tbb::task
137  {
138 
139  public:
141  DtDiGuyCullAsyncTask(DtDiGuyOctreeCullGroup& group, DtDiGuyScenario& dtscenario, osg::Object* object);
142 
144  virtual tbb::task* execute();
145 
146  public:
147 
148  protected:
152  };
153 
154 }
data that&#39;s passed around for culling
Definition: DtDiGuyOctreeCullGroup.h:35
DtDiGuyCullData myPrecullData
Definition: DtDiGuyOctreeCullGroup.h:150
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:73
int myMaxThreadCount
Definition: DtDiGuyOctreeCullGroup.h:129
Definition: featureContext.h:37
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:151
custom traversal and timings for diguy attach point
Definition: DtDiGuyOctreeCullGroup.h:78
DtDiGuyOctreeCullGroup & myGroup
Definition: DtDiGuyOctreeCullGroup.h:127
Contains DLL export macros.
async cull task started by DtDiguyPreCullJob
Definition: DtDiGuyOctreeCullGroup.h:136
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:95
responsible for starting culling code off in a seperate thread when culling starts ...
Definition: DtDiGuyOctreeCullGroup.h:107
osg::Matrixd myProjectionMatrix
Definition: DtDiGuyOctreeCullGroup.h:39
osg::ref_ptr< DtDiGuyInstanceTboUpdaterJob > myTboMainThreadUpdaterJob
Definition: DtDiGuyOctreeCullGroup.h:96
osg::Vec3d myCameraPosition
Definition: DtDiGuyOctreeCullGroup.h:41
DtOsgCullVisitor will inspect the camera to see which visual mode is active.
Definition: DtOsgCullVisitor.h:25
DtOctree class.
OctreeNode class.
DtDe & myDe
Definition: DtDiGuyOctreeCullGroup.h:72
bool myCullNeedsToRun
Definition: DtDiGuyOctreeCullGroup.h:100
osg::Matrixd myViewMatrix
Definition: DtDiGuyOctreeCullGroup.h:40
DtDiGuyCullData()
Definition: DtDiGuyOctreeCullGroup.h:37
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:128
tbb::concurrent_vector< DtDiGuyOsgRootNode * > & myNoninstancedNodeArray
Definition: DtDiGuyOctreeCullGroup.h:98
unsigned int myTraversalNum
Definition: DtDiGuyOctreeCullGroup.h:43
float myCameraMag
Definition: DtDiGuyOctreeCullGroup.h:42
virtual tbb::task * execute()
runs the task
Class that renders all the diguy instance objects in one osg drawable, major performance improvement...
Definition: DtDiGuyInstanceDrawable.h:26
DtDiGuyCullAsyncTask(DtDiGuyOctreeCullGroup &group, DtDiGuyScenario &dtscenario, osg::Object *object)
creates the task
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
#define DT_DLL_VRVDIGUY
Definition: vrvDiGuy.h:21
DtDiGuyInstanceDrawable & myInstanceDrawable
Definition: DtDiGuyOctreeCullGroup.h:97
responsible for updating the TBO in the main thread spawned when data is ready
Definition: DtDiGuyOctreeCullGroup.h:48
tbb::mutex myAsyncMutex
Definition: DtDiGuyOctreeCullGroup.h:99
Owns a DiGuy scenario for the application.
Definition: DtDiGuyScenario.h:77
DtDiGuyOctreeCullGroup & myGroup
Definition: DtDiGuyOctreeCullGroup.h:149

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)