VR-Forces 5.0.1 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) 2022 VT-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 
25 #define DTCELLINDIRECTGEO_CONSTRUCT_DESTRUCT_DEBUG 0
26 
27 namespace makVrv
28 {
29  class DtDe;
30  class DtCullShaderConfig;
31  class DtIndirectModelsContainer;
32  class DtIndirectGeometry;
33  class DtIndirectFadeParameters;
34  class DtCullShaderConfig;
35 
38  {
39  public:
41  DtCellIndirectGeoInstance(const osg::Matrixd& instanceXForm);
42 
44  virtual ~DtCellIndirectGeoInstance();
45 
46  private:
48  DtCellIndirectGeoInstance() = delete;
52  DtCellIndirectGeoInstance& operator-(const DtCellIndirectGeoInstance& other) = delete;
53 
54  public:
55  int myModelId;
56  const osg::Matrixd& myInstanceXForm;
57  const osg::Node* myModelNode;
58 
59  osg::NodePath myNodePath;
61 
65  };
66 
71  {
72  public:
75  , const DtCullShaderConfig& cullShaderConfig
76  , bool includeIntersectionGeoInNodePath
77  , bool terrainPatch
78  , const DtIndirectFadeParameters& fadeParameters);
79 
81  virtual ~DtCellIndirectGeo();
82 
83  private:
85  DtCellIndirectGeo() = delete;
87  DtCellIndirectGeo(const DtCellIndirectGeo &other) = delete;
89  DtCellIndirectGeo &operator=(const DtCellIndirectGeo &other) = delete;
90 
91  public:
92 
96  virtual void setModelsContainer(DtIndirectModelsContainer* modelsContainer, bool ownsModelsContainer);
97 
98 
100  virtual void setParent(const osg::Group* parent);
101 
107  virtual const osg::BoundingBoxd& boundingBox(void) const;
108 
110  virtual const DtIndirectGeometry* indirectGeometry(void) const;
112  virtual DtIndirectGeometry* indirectGeometry(void);
113 
115  virtual osg::Group* indirectIntersectionGroup();
116 
120  virtual int addInstance(const DtCellIndirectGeoInstance& cellIndirectGeoInstance);
121 
123  virtual const std::unordered_map<int, int>& modelIdToNumInstances(void) const;
124 
125  protected:
128  virtual void expandBoundingBox(const osg::Node* modelNode, const osg::Matrixd& instanceXForm);
129 
130  protected:
133 
134 #if DTCELLINDIRECTGEO_CONSTRUCT_DESTRUCT_DEBUG
135  static std::atomic<int> myBaseRefCount;
136 #endif
137 
140 
142  osg::BoundingBoxd myBoundingBox;
144 
147 
149 
150  std::unordered_map<int, int> myModelIdToNumInstances;
151  };
152 }
DtDe & myDe
Definition: DtCellIndirectGeo.h:145
osg::ref_ptr< osg::Group > myIndirectGeoIntersectionGroup
Definition: DtCellIndirectGeo.h:139
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Definition: featureContext.h:37
Helper structure for adding instances to DtCellIndirectGeo.
Definition: DtCellIndirectGeo.h:37
std::deque< NodeSwitchInfoPair > DequeNodeSwitchInfoPairs
Definition: DtIndirectSwitchManager.h:76
osg::NodePath myNodePath
Definition: DtCellIndirectGeo.h:59
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:64
bool myIncludeIntersectionGeoInNodePath
Definition: DtCellIndirectGeo.h:148
osg::ref_ptr< DtIndirectGeometry > myIndirectGeometry
Definition: DtCellIndirectGeo.h:138
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:70
std::deque< NodeDofInfoPair > DequeNodeDofInfoPairs
Definition: DtIndirectDofManager.h:75
Contains makVrv::DtIndirectDofManager class.
\ ::, which allows us to hook into our indirect engine to render using indirect rendering...
Definition: DtIndirectGeometry.h:115
DtIndirectSwitchManager::DequeNodeSwitchInfoPairs mySwitchStack
Definition: DtCellIndirectGeo.h:63
const osg::Node * myModelNode
Definition: DtCellIndirectGeo.h:57
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:146
int myModelId
Definition: DtCellIndirectGeo.h:55
Contains makVrv::DtIndirectSwitchManager class.
DtIndirectLodManager::DequeIndirectLodInfos myLodStack
Definition: DtCellIndirectGeo.h:62
bool myAddToIntersectionGroup
Definition: DtCellIndirectGeo.h:60
osg::BoundingBoxd myBoundingBox
bounding box computation management
Definition: DtCellIndirectGeo.h:142
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:70
bool myOwnsModelsContainer
Definition: DtCellIndirectGeo.h:132
std::deque< IndirectLodInfo > DequeIndirectLodInfos
Definition: DtIndirectLodManager.h:66
const osg::Matrixd & myInstanceXForm
Definition: DtCellIndirectGeo.h:56
DtIndirectModelsContainer * myModelsContainer
Definition: DtCellIndirectGeo.h:131
std::unordered_map< int, int > myModelIdToNumInstances
Definition: DtCellIndirectGeo.h:150
Threading::Mutex myMutableBoundingBoxMutex
Definition: DtCellIndirectGeo.h:143

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)