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) 2026 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 <boost/bind/bind.hpp>
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  class DtLightPointNode;
37  enum class DtIndirectGeometrySubType;
38 
41  {
42  public:
44  DtCellIndirectGeoInstance(const osg::Matrixd& instanceXForm);
45 
47  virtual ~DtCellIndirectGeoInstance();
48 
49  private:
51  DtCellIndirectGeoInstance() = delete;
55  DtCellIndirectGeoInstance& operator-(const DtCellIndirectGeoInstance& other) = delete;
56 
57  public:
58  int myModelId;
59  const osg::Matrixd& myInstanceXForm;
60  const osg::Node* myModelNode;
61 
62  osg::NodePath myNodePath;
65 
69 
74  std::function<void(const osg::ref_ptr<osg::Group>& origionalNode, osg::ref_ptr<osg::Group>& newRootNode, osg::NodePath& newNodePath)> myNodeInsertionCallback;
75  };
76 
81  {
82  public:
85  , const DtCullShaderConfig& cullShaderConfig
86  , bool includeIntersectionGeoInNodePath
87  , const DtIndirectGeometrySubType& geometrySubType
88  , const DtIndirectFadeParameters& fadeParameters);
89 
91  virtual ~DtCellIndirectGeo();
92 
93  private:
95  DtCellIndirectGeo() = delete;
97  DtCellIndirectGeo(const DtCellIndirectGeo &other) = delete;
99  DtCellIndirectGeo &operator=(const DtCellIndirectGeo &other) = delete;
100 
101  public:
102 
107  virtual void setModelsContainer(DtIndirectModelsContainer* modelsContainer, bool ownsModelsContainer);
108 
112  virtual DtIndirectModelsContainer* modelsContainer() const;
113 
115  virtual void setParent(const osg::Group* parent);
116 
122  virtual const osg::BoundingBoxd& boundingBox(void) const;
123 
125  virtual const DtIndirectGeometry* indirectGeometry(void) const;
127  virtual DtIndirectGeometry* indirectGeometry(void);
128 
130  virtual osg::Group* indirectIntersectionGroup();
131 
135  virtual int addInstance(const DtCellIndirectGeoInstance& cellIndirectGeoInstance);
136 
138  virtual const std::unordered_map<int, int>& modelIdToNumInstances(void) const;
139 
141  virtual const std::unordered_map<int, osg::ref_ptr<osg::Node>>& modelIdToModelNodeMap(void) const;
142 
143  protected:
146  virtual void expandBoundingBox(const osg::Node* modelNode, const osg::Matrixd& instanceXForm);
147 
149  virtual void expandBoundingBoxByLightPointBounds(const DtLightPointNode* lightPointNode,
150  const osg::Matrixd& instanceXForm);
151 
152  protected:
155 
156 #if DTCELLINDIRECTGEO_CONSTRUCT_DESTRUCT_DEBUG
157  static std::atomic<int> myBaseRefCount;
158 #endif
159 
162 
164  osg::BoundingBoxd myBoundingBox;
166 
169 
171 
172  std::unordered_map<int, int> myModelIdToNumInstances;
173  std::unordered_map<int, osg::ref_ptr<osg::Node>> myModelIdToModelNode;
174  };
175 }
DtDe & myDe
Definition: DtCellIndirectGeo.h:167
osg::ref_ptr< osg::Group > myIndirectGeoIntersectionGroup
Definition: DtCellIndirectGeo.h:161
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Helper structure for adding instances to DtCellIndirectGeo.
Definition: DtCellIndirectGeo.h:40
bool myAddTopLevelSwitch
Definition: DtCellIndirectGeo.h:64
std::deque< NodeSwitchInfoPair > DequeNodeSwitchInfoPairs
Definition: DtIndirectSwitchManager.h:77
osg::NodePath myNodePath
Definition: DtCellIndirectGeo.h:62
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:68
bool myIncludeIntersectionGeoInNodePath
Definition: DtCellIndirectGeo.h:170
osg::ref_ptr< DtIndirectGeometry > myIndirectGeometry
Definition: DtCellIndirectGeo.h:160
class for holding an indirect geometry registrar (which holds the information about how to draw model...
Definition: DtIndirectModelsContainer.h:72
Helper for managing indirect geometry, its intersection group and registrar corresponding to a &#39;tile ...
Definition: DtCellIndirectGeo.h:80
std::deque< NodeDofInfoPair > DequeNodeDofInfoPairs
Definition: DtIndirectDofManager.h:77
Contains makVrv::DtIndirectDofManager class.
This class inherits from.
Definition: DtIndirectGeometry.h:122
DtIndirectSwitchManager::DequeNodeSwitchInfoPairs mySwitchStack
Definition: DtCellIndirectGeo.h:67
const osg::Node * myModelNode
Definition: DtCellIndirectGeo.h:60
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
Derived from osg::Node and is a replacement for the osgSim::LightPointNode represents a group of ligh...
Definition: DtLightPointNode.h:37
bool myFirstInstance
Definition: DtCellIndirectGeo.h:168
int myModelId
Definition: DtCellIndirectGeo.h:58
Contains makVrv::DtIndirectSwitchManager class.
DtIndirectLodManager::DequeIndirectLodInfos myLodStack
Definition: DtCellIndirectGeo.h:66
bool myAddToIntersectionGroup
Definition: DtCellIndirectGeo.h:63
osg::BoundingBoxd myBoundingBox
bounding box computation management
Definition: DtCellIndirectGeo.h:164
std::unordered_map< int, osg::ref_ptr< osg::Node > > myModelIdToModelNode
Definition: DtCellIndirectGeo.h:173
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:76
bool myOwnsModelsContainer
Definition: DtCellIndirectGeo.h:154
std::deque< IndirectLodInfo > DequeIndirectLodInfos
Definition: DtIndirectLodManager.h:68
const osg::Matrixd & myInstanceXForm
Definition: DtCellIndirectGeo.h:59
DtIndirectModelsContainer * myModelsContainer
Definition: DtCellIndirectGeo.h:153
std::unordered_map< int, int > myModelIdToNumInstances
Definition: DtCellIndirectGeo.h:172
Threading::Mutex myMutableBoundingBoxMutex
Definition: DtCellIndirectGeo.h:165

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)