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) 2024 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_arena.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  virtual tbb::task_arena& taskArena();
96 
97  friend class DtDiGuyCullAsyncTask;
98  friend class DtDiguyPreCullJob;
99 
100  protected:
101 
105  tbb::concurrent_vector< DtDiGuyOsgRootNode*>& myNoninstancedNodeArray;
106  tbb::mutex myAsyncMutex;
108  tbb::task_arena myTaskArena;
109  };
110 
111 
112 
115  class DT_DLL_VRVDIGUY DtDiguyPreCullJob : public osg::Operation
116  {
117  public:
120 
121  private:
125  DtDiguyPreCullJob(const DtDiguyPreCullJob &other);
127  DtDiguyPreCullJob &operator=(const DtDiguyPreCullJob &other);
128 
129  public:
130 
132  virtual void operator () (osg::Object* sv);
133 
134  protected:
138 
139  };
140 }
data that&#39;s passed around for culling
Definition: DtDiGuyOctreeCullGroup.h:35
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:76
int myMaxThreadCount
Definition: DtDiGuyOctreeCullGroup.h:137
Definition: featureContext.h:36
bool myOrthoCulling
Definition: DtDiGuyOctreeCullGroup.h:45
custom traversal and timings for diguy attach point
Definition: DtDiGuyOctreeCullGroup.h:83
DtDiGuyOctreeCullGroup & myGroup
Definition: DtDiGuyOctreeCullGroup.h:135
Contains DLL export macros.
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:102
responsible for starting culling code off in a seperate thread when culling starts ...
Definition: DtDiGuyOctreeCullGroup.h:115
osg::Matrixd myProjectionMatrix
Definition: DtDiGuyOctreeCullGroup.h:39
osg::ref_ptr< DtDiGuyInstanceTboUpdaterJob > myTboMainThreadUpdaterJob
Definition: DtDiGuyOctreeCullGroup.h:103
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
tbb::task_arena myTaskArena
Definition: DtDiGuyOctreeCullGroup.h:108
DtOctree class.
OctreeNode class.
DtDe & myDe
Definition: DtDiGuyOctreeCullGroup.h:75
bool myCullNeedsToRun
Definition: DtDiGuyOctreeCullGroup.h:107
osg::Matrixd myViewMatrix
Definition: DtDiGuyOctreeCullGroup.h:40
DtDiGuyCullData()
Definition: DtDiGuyOctreeCullGroup.h:37
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:136
double myAltitude2D
Definition: DtDiGuyOctreeCullGroup.h:42
tbb::concurrent_vector< DtDiGuyOsgRootNode * > & myNoninstancedNodeArray
Definition: DtDiGuyOctreeCullGroup.h:105
unsigned int myTraversalNum
Definition: DtDiGuyOctreeCullGroup.h:44
float myCameraMag
Definition: DtDiGuyOctreeCullGroup.h:43
Class that renders all the diguy instance objects in one osg drawable, major performance improvement...
Definition: DtDiGuyInstanceDrawable.h:27
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:76
#define DT_DLL_VRVDIGUY
Definition: vrvDiGuy.h:21
DtDiGuyInstanceDrawable & myInstanceDrawable
Definition: DtDiGuyOctreeCullGroup.h:104
responsible for updating the TBO in the main thread spawned when data is ready
Definition: DtDiGuyOctreeCullGroup.h:50
tbb::mutex myAsyncMutex
Definition: DtDiGuyOctreeCullGroup.h:106
Owns a DiGuy scenario for the application.
Definition: DtDiGuyScenario.h:87

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)