VR-Forces 4.8 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) 2018 VT-MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
20 
23 
25 
26 #include <osg/NodeVisitor>
27 #include <osg/Geometry>
28 #include <osg/ref_ptr>
29 
30 #include <stack>
31 
32 
33 namespace osg
34 {
35  class Texture;
36  class LOD;
37 }
38 
39 namespace osgSim
40 {
41  class MultiSwitch;
42  class DOFTransform;
43 }
44 
45 namespace makVrv
46 {
47  class DtIndirectTextureCollectionPolicy;
48  class DtIndirectGeometryStateManager;
49 
50  class DtDynamicTerrainSwitchNode;
51  class DtDynamicTerrainSequenceNode;
52  class DtIndirectAggregateHelper;
53  class DtAggregatedGeometry;
54  class DtDe;
55  struct DtAggregateModelInfo;
56 
63  class DT_DLL_VRVOSG DtIndirectGeometryAggregator : public osg::NodeVisitor
64  {
65  public:
70  , DtIndirectEffectTexturesTemplate& aggregatedEffectTexturesState
71  , DtIndirectGeometryStateManager& stateManager
72  , const DtIndirectTextureCollectionPolicy& textureCollectionPolicy
73  );
74 
77 
78  private:
79  //Default construcor not implemented
85 
86  public:
87 
89  virtual void aggregate(osg::Node* node, int modelId, const std::string& modelFileName, bool cullFaceEnabled,
90  const DtIndirectPolygonOffset& polygonOffset);
91 
93  virtual void apply(osg::Geometry& geometry);
94 
96  virtual void apply(DtDynamicTerrainSwitchNode& node);
97 
99  virtual void apply(osg::Geode& geode);
100 
102  virtual void apply(osg::Node& node);
103 
105  virtual void apply(osg::Switch& node);
106 
108  virtual void apply(osgSim::MultiSwitch& node);
109 
111  virtual void apply(osg::LOD& node);
112 
114  virtual void apply(osg::Sequence& node);
115 
117  virtual void apply(osg::Billboard& node);
118 
121  virtual void apply(osg::MatrixTransform& matTrans);
122 
124  virtual void apply(osgSim::DOFTransform& node);
125 
127  virtual int numGeodes() const;
128 
132  virtual int numGeometries() const;
133 
136  virtual int maxSingleModelIndices();
137 
138  public:
140  static void loadTheDefaultTexture(const std::string& filename);
141 
142  protected:
144  virtual DtMaterial gatherMaterial(osg::StateSet* ss) const;
145 
147  virtual bool isCullFaceEnabled(osg::StateSet* ss) const;
148 
150  virtual DtIndirectPolygonOffset gatherPolygonOffset(osg::StateSet* ss) const;
151 
153  virtual DtIndirectGeometryTextures* gatherTextures(osg::StateSet* ss, const std::string& modelFileName);
154 
155 
156  protected:
159 
160  // references to externally passed in specs, texture, materials
161  // traversal via this visitor will augment
163 
167 
168 
172 
175  {
184  };
185 
187  std::stack<AggregatorData> myDataStack;
188  std::stack<osg::Matrix> myMatrixStack;
189 
191 
193 
195 
196  // used only for outputting debug messages
197  std::string myModelFileName;
198 
199 public:
201 
203 
204  friend class StackOperator;
205 
207 
208  };
209 
212  {
213  public:
216 
219  private:
224  public:
226  virtual DtIndirectGeometryAggregator* create(DtAggregatedGeometry& aggregatedGeometry
227  , DtIndirectEffectTexturesTemplate& aggregatedEffectTexturesState
228  , DtIndirectGeometryStateManager& stateManager
229  , const DtIndirectTextureCollectionPolicy& textureCollectionPolicy) const;
230 
233  static DtIndirectGeometryAggregatorCreator& instance(DtDe& de);
234 
236  static const std::string& theClassName();
237 
238  protected:
240  };
241 }
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
DtMaterial class declaration.
Virtual base class.
Definition: DtVirtualBaseClass.h:22
std::stack< AggregatorData > myDataStack
stack of Aggregator as traversal happens.
Definition: DtIndirectGeometryAggregator.h:187
DtIndirectEffectTexturesTemplate & myAggregatedEffectTexturesState
Definition: DtIndirectGeometryAggregator.h:169
DtIndirectLodManager::DequeIndirectLodInfos myLodStack
Definition: DtIndirectGeometryAggregator.h:190
DtIndirectAggregateHelper myAggregateHelper
Definition: DtIndirectGeometryAggregator.h:206
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:99
DtIndirectGeometryTexturesRefPtr myTextures
current collection of textures
Definition: DtIndirectGeometryAggregator.h:177
const DtIndirectTextureCollectionPolicy & myTextureCollectionPolicy
Definition: DtIndirectGeometryAggregator.h:194
DtAggregateModelInfo * myModelInfo
Definition: DtIndirectGeometryAggregator.h:162
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtAggregatedGeometry & myAggregatedGeometry
Definition: DtIndirectGeometryAggregator.h:171
current state of the model traversal
Definition: DtIndirectGeometryAggregator.h:174
std::deque< NodeSwitchInfoPair > DequeNodeSwitchInfoPairs
Definition: DtIndirectSwitchManager.h:72
DtGeometrySpecification class declaration.
Abstract class to look in the stateset and collect textures specified via its template The effect tex...
Definition: DtIndirectTextureCollectionPolicy.h:38
structure that is packed for consumption by GPU for indirect rendering contains the material properti...
Definition: DtMaterial.h:32
static osg::ref_ptr< osg::Texture > theDefaultTexture
Definition: DtIndirectGeometryAggregator.h:202
static const DtMaterial theDefaultMaterial
Definition: DtIndirectGeometryAggregator.h:200
creator for DtIndirectGeometryAggregator
Definition: DtIndirectGeometryAggregator.h:211
helper class to the DtIndirectGeometryAggregator.
Definition: DtIndirectAggregateHelper.h:35
DtIndirectPolygonOffset myPolygonOffset
polygon offset settings.
Definition: DtIndirectGeometryAggregator.h:183
Indirect rendering works because we are able to combine multiple geometries into a single &#39;aggregated...
Definition: DtIndirectGeometryAggregator.h:63
Contains the DtIndirectAggregateHelper class declaration.
Contains the DtIndirectEffectTexturesTemplate class declaration.
Contains makVrv::DtVirtualBaseClass class.
int myMaxSingleModelIndices
Definition: DtIndirectGeometryAggregator.h:166
Simple state/glmodes class for handling setting up modes It can now handle generic state modes and at...
Definition: DtIndirectGeometryStateManager.h:29
class to hold osg Textures (diffuse map texture + effect textures) basically just a list of osg textu...
Definition: DtIndirectGeometryTextures.h:27
contains the Per Model info which DtAggregatedGeometry needs It is owned by the Indirect geometry reg...
Definition: DtAggregatedGeometry.h:47
int myNumGeometries
Definition: DtIndirectGeometryAggregator.h:158
DtIndirectSwitchManager::DequeNodeSwitchInfoPairs mySwitchStack
Definition: DtIndirectGeometryAggregator.h:192
bool myCullFaceEnabled
cull face state
Definition: DtIndirectGeometryAggregator.h:181
int myLastIndexOffset
Definition: DtIndirectGeometryAggregator.h:165
Contains makVrv::DtIndirectSwitchManager class.
std::stack< osg::Matrix > myMatrixStack
Definition: DtIndirectGeometryAggregator.h:188
int myNumGeodes
Definition: DtIndirectGeometryAggregator.h:157
std::string myModelFileName
Definition: DtIndirectGeometryAggregator.h:197
Contains makVrv::DtIndirectLodManager class.
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
Contains the DtIndirectGeometryTextures class declaration.
std::deque< IndirectLodInfo > DequeIndirectLodInfos
Definition: DtIndirectLodManager.h:95
DtIndirectGeometryStateManager & myStateManager
Definition: DtIndirectGeometryAggregator.h:170
DtDe & myDe
Definition: DtIndirectGeometryAggregator.h:239
Contains the DtIndirectPolygonOffset class declaration.
Class that allows you to abstractly register effect texture types the effect texture types are client...
Definition: DtIndirectEffectTexturesTemplate.h:38
DtMaterial myMaterial
current indirect material
Definition: DtIndirectGeometryAggregator.h:179
int myLastVertexOffset
Definition: DtIndirectGeometryAggregator.h:164

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)