VR-Forces Developer's Guide
 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) 2023 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 
18 #include <vrvMath/DtOctree.h>
19 #include <vrvMath/DtOctreeNode.h>
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  double myAltitude2D;
43  float myCameraMag;
44  unsigned int myTraversalNum;
46  };
47 
50  class DT_DLL_VRVDIGUY DtDiGuyInstanceTboUpdaterJob : public osg::Operation
51  {
52  public:
54  friend class DtInstanceManagerTboUpdaterCreator;
55 
58 
62  virtual void operator () (osg::Object* sv);
63 
64  private:
65 
72 
73  protected:
74 
77 
78  };
79 
80 
83  class DT_DLL_VRVDIGUY DtDiGuyOctreeCullGroup : public osg::Group
84  {
85  public:
86 
87  DtDiGuyOctreeCullGroup(DtDiGuyScenario& scenario, tbb::concurrent_vector< DtDiGuyOsgRootNode*>& noninstancedarray,
88  DtDiGuyInstanceDrawable& instanceDrawable);
89  virtual ~DtDiGuyOctreeCullGroup();
90 
91  virtual void traverse(osg::NodeVisitor& nv);
92  virtual void precull(const DtDiGuyCullData& pcd, bool async);
93  virtual void setCullNeedsToRun(bool needsToRun);
94 
95  friend class DtDiGuyCullAsyncTask;
96  friend class DtDiguyPreCullJob;
97 
98  protected:
99 
103  tbb::concurrent_vector< DtDiGuyOsgRootNode*>& myNoninstancedNodeArray;
104  tbb::mutex myAsyncMutex;
106  };
107 
108 
109 
112  class DT_DLL_VRVDIGUY DtDiguyPreCullJob : public osg::Operation
113  {
114  public:
117 
118  private:
122  DtDiguyPreCullJob(const DtDiguyPreCullJob &other);
124  DtDiguyPreCullJob &operator=(const DtDiguyPreCullJob &other);
125 
126  public:
127 
129  virtual void operator () (osg::Object* sv);
130 
131  protected:
135 
136  };
137 
138 
141  class DtDiGuyCullAsyncTask : public tbb::task
142  {
143 
144  public:
146  DtDiGuyCullAsyncTask(DtDiGuyOctreeCullGroup& group, DtDiGuyScenario& dtscenario, osg::Object* object);
147 
149  virtual tbb::task* execute();
150 
151  public:
152 
153  protected:
157  };
158 
159 }
data that&#39;s passed around for culling
Definition: DtDiGuyOctreeCullGroup.h:35
DtDiGuyCullData myPrecullData
Definition: DtDiGuyOctreeCullGroup.h:155
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:76
int myMaxThreadCount
Definition: DtDiGuyOctreeCullGroup.h:134
Definition: featureContext.h:37
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:156
bool myOrthoCulling
Definition: DtDiGuyOctreeCullGroup.h:45
custom traversal and timings for diguy attach point
Definition: DtDiGuyOctreeCullGroup.h:83
DtDiGuyOctreeCullGroup & myGroup
Definition: DtDiGuyOctreeCullGroup.h:132
Contains DLL export macros.
async cull task started by DtDiguyPreCullJob
Definition: DtDiGuyOctreeCullGroup.h:141
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:100
responsible for starting culling code off in a seperate thread when culling starts ...
Definition: DtDiGuyOctreeCullGroup.h:112
osg::Matrixd myProjectionMatrix
Definition: DtDiGuyOctreeCullGroup.h:39
osg::ref_ptr< DtDiGuyInstanceTboUpdaterJob > myTboMainThreadUpdaterJob
Definition: DtDiGuyOctreeCullGroup.h:101
osg::Vec3d myCameraPosition
Definition: DtDiGuyOctreeCullGroup.h:41
DtOsgCullVisitor will inspect the camera to see which visual mode is active. If the visual mode is a ...
Definition: DtOsgCullVisitor.h:27
DtOctree class.
OctreeNode class.
DtDe & myDe
Definition: DtDiGuyOctreeCullGroup.h:75
bool myCullNeedsToRun
Definition: DtDiGuyOctreeCullGroup.h:105
osg::Matrixd myViewMatrix
Definition: DtDiGuyOctreeCullGroup.h:40
DtDiGuyCullData()
Definition: DtDiGuyOctreeCullGroup.h:37
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:133
double myAltitude2D
Definition: DtDiGuyOctreeCullGroup.h:42
tbb::concurrent_vector< DtDiGuyOsgRootNode * > & myNoninstancedNodeArray
Definition: DtDiGuyOctreeCullGroup.h:103
unsigned int myTraversalNum
Definition: DtDiGuyOctreeCullGroup.h:44
float myCameraMag
Definition: DtDiGuyOctreeCullGroup.h:43
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:27
DtDiGuyCullAsyncTask(DtDiGuyOctreeCullGroup &group, DtDiGuyScenario &dtscenario, osg::Object *object)
creates the task
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:72
#define DT_DLL_VRVDIGUY
Definition: vrvDiGuy.h:21
DtDiGuyInstanceDrawable & myInstanceDrawable
Definition: DtDiGuyOctreeCullGroup.h:102
responsible for updating the TBO in the main thread spawned when data is ready
Definition: DtDiGuyOctreeCullGroup.h:50
tbb::mutex myAsyncMutex
Definition: DtDiGuyOctreeCullGroup.h:104
Owns a DiGuy scenario for the application.
Definition: DtDiGuyScenario.h:87
DtDiGuyOctreeCullGroup & myGroup
Definition: DtDiGuyOctreeCullGroup.h:154

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)