VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCellIndirectGeo.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 <vrvOsg/vrvOsg.h>
13 
18 
19 #include <osg/Matrixd>
20 #include <osg/Group>
21 
22 #include <atomic>
23 #include <unordered_map>
24 #include <functional>
25 
26 #define DTCELLINDIRECTGEO_CONSTRUCT_DESTRUCT_DEBUG 0
27 
28 namespace makVrv
29 {
30  class DtDe;
31  class DtCullShaderConfig;
32  class DtIndirectModelsContainer;
33  class DtIndirectGeometry;
34  class DtIndirectFadeParameters;
35  class DtCullShaderConfig;
36  enum class DtIndirectGeometrySubType;
37 
40  {
41  public:
43  DtCellIndirectGeoInstance(const osg::Matrixd& instanceXForm);
44 
46  virtual ~DtCellIndirectGeoInstance();
47 
48  private:
50  DtCellIndirectGeoInstance() = delete;
54  DtCellIndirectGeoInstance& operator-(const DtCellIndirectGeoInstance& other) = delete;
55 
56  public:
57  int myModelId;
58  const osg::Matrixd& myInstanceXForm;
59  const osg::Node* myModelNode;
60 
61  osg::NodePath myNodePath;
64 
68 
73  std::function<void(const osg::ref_ptr<osg::Group>& origionalNode, osg::ref_ptr<osg::Group>& newRootNode, osg::NodePath& newNodePath)> myNodeInsertionCallback;
74  };
75 
80  {
81  public:
84  , const DtCullShaderConfig& cullShaderConfig
85  , bool includeIntersectionGeoInNodePath
86  , const DtIndirectGeometrySubType& geometrySubType
87  , const DtIndirectFadeParameters& fadeParameters);
88 
90  virtual ~DtCellIndirectGeo();
91 
92  private:
94  DtCellIndirectGeo() = delete;
96  DtCellIndirectGeo(const DtCellIndirectGeo &other) = delete;
98  DtCellIndirectGeo &operator=(const DtCellIndirectGeo &other) = delete;
99 
100  public:
101 
105  virtual void setModelsContainer(DtIndirectModelsContainer* modelsContainer, bool ownsModelsContainer);
106 
108  virtual void setParent(const osg::Group* parent);
109 
115  virtual const osg::BoundingBoxd& boundingBox(void) const;
116 
118  virtual const DtIndirectGeometry* indirectGeometry(void) const;
120  virtual DtIndirectGeometry* indirectGeometry(void);
121 
123  virtual osg::Group* indirectIntersectionGroup();
124 
128  virtual int addInstance(const DtCellIndirectGeoInstance& cellIndirectGeoInstance);
129 
131  virtual const std::unordered_map<int, int>& modelIdToNumInstances(void) const;
132 
134  virtual const std::unordered_map<int, osg::ref_ptr<osg::Node>>& modelIdToModelNodeMap(void) const;
135 
136  protected:
139  virtual void expandBoundingBox(const osg::Node* modelNode, const osg::Matrixd& instanceXForm);
140 
141  protected:
144 
145 #if DTCELLINDIRECTGEO_CONSTRUCT_DESTRUCT_DEBUG
146  static std::atomic<int> myBaseRefCount;
147 #endif
148 
151 
153  osg::BoundingBoxd myBoundingBox;
155 
158 
160 
161  std::unordered_map<int, int> myModelIdToNumInstances;
162  std::unordered_map<int, osg::ref_ptr<osg::Node>> myModelIdToModelNode;
163  };
164 }
DtDe & myDe
Definition: DtCellIndirectGeo.h:156
osg::ref_ptr< osg::Group > myIndirectGeoIntersectionGroup
Definition: DtCellIndirectGeo.h:150
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Helper structure for adding instances to DtCellIndirectGeo.
Definition: DtCellIndirectGeo.h:39
bool myAddTopLevelSwitch
Definition: DtCellIndirectGeo.h:63
std::deque< NodeSwitchInfoPair > DequeNodeSwitchInfoPairs
Definition: DtIndirectSwitchManager.h:76
osg::NodePath myNodePath
Definition: DtCellIndirectGeo.h:61
shader configuration storage class. Has 3 available options which are described in the constructor&#39;s ...
Definition: DtCullShaderConfig.h:21
DtIndirectDofManager::DequeNodeDofInfoPairs myDofStack
Definition: DtCellIndirectGeo.h:67
bool myIncludeIntersectionGeoInNodePath
Definition: DtCellIndirectGeo.h:159
osg::ref_ptr< DtIndirectGeometry > myIndirectGeometry
Definition: DtCellIndirectGeo.h:149
class for holding an indirect geometry registrar (which holds the information about how to draw model...
Definition: DtIndirectModelsContainer.h:55
Helper for managing indirect geometry, its intersection group and registrar corresponding to a &#39;tile ...
Definition: DtCellIndirectGeo.h:79
std::deque< NodeDofInfoPair > DequeNodeDofInfoPairs
Definition: DtIndirectDofManager.h:76
Contains makVrv::DtIndirectDofManager class.
\ ::, which allows us to hook into our indirect engine to render using indirect rendering...
Definition: DtIndirectGeometry.h:120
DtIndirectSwitchManager::DequeNodeSwitchInfoPairs mySwitchStack
Definition: DtCellIndirectGeo.h:66
const osg::Node * myModelNode
Definition: DtCellIndirectGeo.h:59
struct for holding the fade parameters used by the indirect rendering cull compute shader ...
Definition: DtIndirectFadeParameters.h:17
OpenThreads::Mutex Mutex
Definition: DtOsgThreadingUtils.h:12
bool myFirstInstance
Definition: DtCellIndirectGeo.h:157
int myModelId
Definition: DtCellIndirectGeo.h:57
Contains makVrv::DtIndirectSwitchManager class.
DtIndirectLodManager::DequeIndirectLodInfos myLodStack
Definition: DtCellIndirectGeo.h:65
bool myAddToIntersectionGroup
Definition: DtCellIndirectGeo.h:62
osg::BoundingBoxd myBoundingBox
bounding box computation management
Definition: DtCellIndirectGeo.h:153
std::unordered_map< int, osg::ref_ptr< osg::Node > > myModelIdToModelNode
Definition: DtCellIndirectGeo.h:162
DtIndirectGeometrySubType
Definition: DtIndirectGeometrySubType.h:16
Contains makVrv::DtIndirectLodManager class.
Contains DLL export macros.
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
bool myOwnsModelsContainer
Definition: DtCellIndirectGeo.h:143
std::deque< IndirectLodInfo > DequeIndirectLodInfos
Definition: DtIndirectLodManager.h:67
const osg::Matrixd & myInstanceXForm
Definition: DtCellIndirectGeo.h:58
DtIndirectModelsContainer * myModelsContainer
Definition: DtCellIndirectGeo.h:142
std::unordered_map< int, int > myModelIdToNumInstances
Definition: DtCellIndirectGeo.h:161
Threading::Mutex myMutableBoundingBoxMutex
Definition: DtCellIndirectGeo.h:154

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)