VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtIndirectGeometryAggregator.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2021 VT-MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
24 
27 
29 
30 #include <osg/NodeVisitor>
31 #include <osg/Geometry>
32 #include <osg/ref_ptr>
33 
34 #include <stack>
35 
36 
37 namespace osg
38 {
39  class Texture;
40  class LOD;
41 }
42 
43 namespace osgSim
44 {
45  class MultiSwitch;
46  class DOFTransform;
47 }
48 
49 namespace makVrv
50 {
51  class DtIndirectTextureCollectionPolicy;
52  class DtIndirectGeometryStateManager;
53 
54  class DtDynamicTerrainSwitchNode;
55  class DtDynamicTerrainSequenceNode;
56  class DtIndirectAggregateHelper;
57  class DtAggregatedGeometry;
58  class DtLightPointNode;
59  class DtDe;
60 
61  struct DtAggregateModelInfo;
62 
65 
72 
74  template <>
75  inline const char* creatorTypeName<DtIndirectGeometryAggregator>(void) { return "DtIndirectGeometryAggregatorCreator"; }
76 
83  class DT_DLL_VRVOSG DtIndirectGeometryAggregator : public osg::NodeVisitor
84  {
85  public:
87 
90 
91  protected:
96  , DtAggregatedGeometry& aggregatedGeometry
97  , DtIndirectEffectTexturesTemplate& aggregatedEffectTexturesState
98  , DtIndirectGeometryStateManager& stateManager
99  , const DtIndirectTextureCollectionPolicy& textureCollectionPolicy
100  );
101 
102 
103  private:
104  //Default construcor not implemented
110 
111  public:
112 
114  virtual void aggregate(osg::Node* node, int modelId, const std::string& modelFileName, bool cullFaceEnabled
115  , const DtIndirectPolygonOffset& polygonOffset, bool daylightControlled);
116 
118  virtual void apply(osg::Geometry& geometry);
119 
121  virtual void apply(DtDynamicTerrainSwitchNode& node);
122 
124  virtual void apply(osg::Geode& geode);
125 
127  virtual void apply(osg::Node& node);
128 
130  virtual void apply(osg::Switch& node);
131 
133  virtual void apply(osgSim::MultiSwitch& node);
134 
136  virtual void apply(osg::LOD& node);
137 
139  virtual void apply(osg::Sequence& node);
140 
142  virtual void apply(osg::Billboard& node);
143 
145  virtual void apply(DtLightPointNode& node);
146 
149  virtual void augmentModelInfo(osg::Geometry* geometry
150  , const AxisAlignedBoundingBox_32& bbox32
151  , const int state
152  , const DtIndirectGeometryTexturesRefPtr& texturesForThisGeometry
153  , Material& materialForThisGeometry
154  , const bool isLight);
155 
158  virtual void apply(osg::MatrixTransform& matTrans);
159 
161  virtual void apply(osgSim::DOFTransform& node);
162 
164  virtual void apply(osg::LightSource& node) override;
165 
167  virtual int numGeodes() const;
168 
172  virtual int numGeometries() const;
173 
174  public:
176  static void loadTheDefaultTexture(const std::string& filename);
177 
178  protected:
180  virtual Material gatherMaterial(osg::StateSet* ss) const;
181 
183  virtual bool isCullFaceEnabled(const osg::StateSet* ss) const;
184 
186  virtual bool isBlendingEnabled(const osg::StateSet* ss) const;
187 
189  virtual bool isAlphaToCoverageEnabled(const osg::StateSet* ss) const;
190 
192  virtual DtIndirectBlendFunction gatherBlendFunction(const osg::StateSet* ss) const;
193 
195  virtual DtIndirectBlendEquation gatherBlendEquation(const osg::StateSet* ss) const;
196 
198  virtual DtIndirectPolygonOffset gatherPolygonOffset(const osg::StateSet* ss) const;
199 
201  virtual DtIndirectGeometryTextures* gatherTextures(osg::StateSet* ss, const std::string& modelFileName);
202 
204  virtual osg::Geometry* createDebugLightPointCube(DtLightPointNode& node);
205 
207  virtual osg::Geometry* createDebugLightSourceCube(osg::LightSource& node);
208 
210  virtual void applyToSwitchStack(osg::Group* node, osg::NodePath& nodePath);
211 
212  protected:
216 
219 
220  unsigned int myMaxUvOffsetId;
223 
224  std::stack<unsigned int> myLastUvOffsetIdStack;
225 
229 
232  {
236  Material myMaterial;
239 
242 
245 
248 
251 
254  };
255 
257  std::stack<AggregatorData> myDataStack;
258  std::stack<osg::Matrix> myMatrixStack;
259 
260  std::stack<int> myBillboardModeStack;
261 
263 
265 
266  // This stack (unlike the terrain/find nodes visitor is not a regular stack
267  // and needs to maintain the full hierarchical paths as it traverses down
271 
273 
274  // used only for outputting debug messages
275  std::string myModelFileName;
276 
278 
279 
281 
282  friend class ScopedStackOperator;
283  friend class ScopedAnnotationParser;
284 
286 
288 
290 
291  protected:
293  };
294 
295 }
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
Contains makVrv::DtIndirectUvOffsetManager class.
Contains the DtIndirectBlendEquation class declaration.
DtIndirectUvOffsetManager::ScrollableUvOffsetIdsAndMultipliers myScrollableUvOffsetIdsAndMultipliers
Definition: DtIndirectGeometryAggregator.h:222
DtMaterial class declaration.
std::stack< int > myBillboardModeStack
Definition: DtIndirectGeometryAggregator.h:260
std::stack< AggregatorData > myDataStack
stack of Aggregator as traversal happens.
Definition: DtIndirectGeometryAggregator.h:257
DtIndirectEffectTexturesTemplate & myAggregatedEffectTexturesState
Definition: DtIndirectGeometryAggregator.h:226
DtVirtualBaseClassCreator< DtIndirectGeometryAggregator, DtAggregatedGeometry &, DtIndirectEffectTexturesTemplate &, DtIndirectGeometryStateManager &, const DtIndirectTextureCollectionPolicy & > DtIndirectGeometryAggregatorCreator
creator
Definition: DtIndirectGeometryAggregator.h:64
DtIndirectLodManager::DequeIndirectLodInfos myLodStack
Definition: DtIndirectGeometryAggregator.h:262
DtIndirectAggregateHelper myAggregateHelper
Definition: DtIndirectGeometryAggregator.h:285
DtDynamicTerrainSwitchNode replaces an osgSim::multiswitch in a terrain patch (or page) that is tagge...
Definition: DtDynamicTerrainSwitchNode.h:74
contains the information which indirect needs for all geometry found by the geometry aggregator after...
Definition: DtAggregatedGeometry.h:91
DtIndirectDofManager::DequeNodeDofInfoPairs myDofStack
Definition: DtIndirectGeometryAggregator.h:268
DtIndirectGeometryTexturesRefPtr myTextures
current collection of textures
Definition: DtIndirectGeometryAggregator.h:234
const DtIndirectTextureCollectionPolicy & myTextureCollectionPolicy
Definition: DtIndirectGeometryAggregator.h:272
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtAggregatedGeometry & myAggregatedGeometry
Definition: DtIndirectGeometryAggregator.h:228
int myCurrentParentId
Definition: DtIndirectGeometryAggregator.h:270
bool myLightSourcesDaylightControlled
Definition: DtIndirectGeometryAggregator.h:289
current state of the model traversal
Definition: DtIndirectGeometryAggregator.h:231
Contains the DtIndirectBlendFunction class declaration.
std::deque< NodeSwitchInfoPair > DequeNodeSwitchInfoPairs
Definition: DtIndirectSwitchManager.h:75
DtIndirectGeometryTexturesRefPtr myDefaultTextures
Definition: DtIndirectGeometryAggregator.h:280
Abstract class to look in the stateset and collect textures specified via its template The effect tex...
Definition: DtIndirectTextureCollectionPolicy.h:38
static osg::ref_ptr< osg::Texture > theDefaultTexture
Definition: DtIndirectGeometryAggregator.h:292
helper class to the DtIndirectGeometryAggregator.
Definition: DtIndirectAggregateHelper.h:35
unsigned int myMaxUvOffsetId
Definition: DtIndirectGeometryAggregator.h:220
DtIndirectPolygonOffset myPolygonOffset
polygon offset settings.
Definition: DtIndirectGeometryAggregator.h:253
Indirect rendering works because we are able to combine multiple geometries into a single &#39;aggregated...
Definition: DtIndirectGeometryAggregator.h:83
bool myAlphaToCoverageEnabled
a2C enabled or not
Definition: DtIndirectGeometryAggregator.h:244
Contains the DtIndirectAggregateHelper class declaration.
DtIndirectUvOffsetManager::AnnotationToUvOffsetMap myAnnotationToIdMap
Definition: DtIndirectGeometryAggregator.h:221
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:22
Contains the DtIndirectEffectTexturesTemplate class declaration.
Template for 32/64 bit Axis Aligned bounding boxesnot virtual because its stored as is on the GPU...
Definition: DtAxisAlignedBoundingBox.h:27
std::deque< NodeDofInfoPair > DequeNodeDofInfoPairs
Definition: DtIndirectDofManager.h:74
non virtual container class for defining a blending function
Definition: DtIndirectBlendFunction.h:29
Contains makVrv::DtIndirectDofManager class.
Axis Aligned Bounding Box class.
Simple state/glmodes class for handling setting up modes It can now handle generic state modes and at...
Definition: DtIndirectGeometryStateManager.h:31
std::stack< unsigned int > myLastUvOffsetIdStack
Definition: DtIndirectGeometryAggregator.h:224
const char * creatorTypeName< DtIndirectGeometryAggregator >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtIndirectGeometryAggregator.h:75
class to hold osg Textures (diffuse map texture + effect textures) basically just a list of osg textu...
Definition: DtIndirectGeometryTextures.h:26
std::map< std::string, unsigned int > AnnotationToUvOffsetMap
Definition: DtIndirectUvOffsetManager.h:53
int myNumGeometries
Definition: DtIndirectGeometryAggregator.h:214
DtIndirectSwitchManager::DequeNodeSwitchInfoPairs mySwitchStack
Definition: DtIndirectGeometryAggregator.h:264
bool myCullFaceEnabled
cull face state
Definition: DtIndirectGeometryAggregator.h:238
Derived from osg::Node and is a replacement for the osgSim::LightPointNode represents a group of ligh...
Definition: DtLightPointNode.h:37
int myMaxDofId
Definition: DtIndirectGeometryAggregator.h:269
int myLastIndexOffset
Definition: DtIndirectGeometryAggregator.h:218
DtIndirectBlendFunction myBlendFunction
the blending function
Definition: DtIndirectGeometryAggregator.h:247
Contains makVrv::DtIndirectSwitchManager class.
friend DtIndirectGeometryAggregatorCreator
Definition: DtIndirectGeometryAggregator.h:86
Material myMaterial
current indirect material
Definition: DtIndirectGeometryAggregator.h:236
non virtual container class for defining a blending equation
Definition: DtIndirectBlendEquation.h:30
std::stack< osg::Matrix > myMatrixStack
Definition: DtIndirectGeometryAggregator.h:258
int myNumGeodes
Definition: DtIndirectGeometryAggregator.h:213
std::string myModelFileName
Definition: DtIndirectGeometryAggregator.h:275
Contains makVrv::DtIndirectLodManager class.
int myModelId
Definition: DtIndirectGeometryAggregator.h:215
non virtual container class for defining a polygon offset state
Definition: DtIndirectPolygonOffset.h:18
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
bool myBlendingEnabled
blending enabled or not
Definition: DtIndirectGeometryAggregator.h:241
Material myDefaultMaterial
Definition: DtIndirectGeometryAggregator.h:277
std::unordered_map< int, Vector2_32 > ScrollableUvOffsetIdsAndMultipliers
Definition: DtIndirectUvOffsetManager.h:55
Contains the DtIndirectGeometryTextures class declaration.
std::deque< IndirectLodInfo > DequeIndirectLodInfos
Definition: DtIndirectLodManager.h:65
DtIndirectGeometryStateManager & myStateManager
Definition: DtIndirectGeometryAggregator.h:227
Contains the DtIndirectPolygonOffset class declaration.
Class that allows you to abstractly register effect texture types the effect texture types are client...
Definition: DtIndirectEffectTexturesTemplate.h:40
DtIndirectBlendEquation myBlendEquation
the blending equation
Definition: DtIndirectGeometryAggregator.h:250
DtDe & myDe
Definition: DtIndirectGeometryAggregator.h:287
int myLastVertexOffset
Definition: DtIndirectGeometryAggregator.h:217

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)