VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgFindNodesVisitor.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
22 
24 
25 #include <osg/Switch>
26 #include <osg/LOD>
27 #include <osg/PositionAttitudeTransform>
28 #include <osg/NodeVisitor>
29 #include <osg/MatrixTransform>
30 #include <osgSim/MultiSwitch>
31 #include <osgSim/DOFTransform>
32 #include <osgSim/LightPointNode>
33 
34 #include <vector>
35 #include <deque>
36 #include <osg/PolygonOffset>
37 
38 namespace makVrv
39 {
40 
43  {
45  : cullFaceEnabled(true)
46  {
47  }
48 
50  osg::Matrixd xform;
52  osg::NodePath nodePath;
57  };
58 
60  template <typename T>
61  struct DtOsgFindNodesVisitor : public osg::NodeVisitor
62  {
63  DtOsgFindNodesVisitor(osg::NodeVisitor::TraversalMode traversalMode);
64 
65  void apply(osg::Node& node);
66 
67  std::vector<T*> results;
68  };
69 
71  template<typename T>
72  struct DtOsgFindNodesVisitorRefPtr : public osg::NodeVisitor
73  {
74  DtOsgFindNodesVisitorRefPtr(osg::NodeVisitor::TraversalMode traversalMode);
75 
76  virtual void apply(osg::Node& node) override;
77 
78  std::vector< osg::ref_ptr<T> > results;
79  };
80 
83  template<typename T>
84  struct DtOsgFindNodesVisitorRefPtrFlattenGraph : public osg::NodeVisitor
85  {
86  DtOsgFindNodesVisitorRefPtrFlattenGraph(osg::NodeVisitor::TraversalMode traversalMode
87  , osg::Node::NodeMask gatherNodeMask = 0
88  , const std::set< osg::Node* >& nodeIgnoreList = std::set<osg::Node*>()
89  , bool adjustLodStart = false);
90 
91  virtual bool isCullFaceEnabled(osg::StateSet* ss) const;
92 
93  virtual DtIndirectPolygonOffset gatherPolygonOffset(osg::StateSet* ss) const;
94 
95  virtual void apply(osg::Node& node) override;
96 
97  // Avoid use of T to avoid shadowing class template name
98  template<typename RESULT>
99  bool checkThisNodesMask(osg::Node& node, RESULT* result);
100 
102  bool checkThisNodesMask(osg::Node& node, DtLightPointNode* result);
103 
105  bool checkThisNodesMask(osg::Node& node, osgSim::LightPointNode* result);
106 
107  std::vector< DtNodePlusTraversalInfo > results;
108  std::set< osg::Node* > nodeIgnoreList;
109  std::deque<osg::Matrixd> matrixStack;
112  osg::Node::NodeMask myGatherNodeMask;
113 
114  std::stack<bool> myCullFaceEnabledStack;
115  std::stack<DtIndirectPolygonOffset> myPolygonOffsetStack;
117 
118  // This stack (unlike the aggregator is a regular stack that
119  // can use the stack size for finding the parent dof ids by pushing/popping
121  };
122 }
123 
124 #include "DtOsgFindNodesVisitor.inl"
125 
Contains makVrv::DtIndirectSwitchInfo struct.
DtIndirectSwitchManager::DequeNodeSwitchInfoPairs switchStack
Definition: DtOsgFindNodesVisitor.h:53
DtIndirectSwitchManager::DequeNodeSwitchInfoPairs switchStack
Definition: DtOsgFindNodesVisitor.h:111
std::vector< DtNodePlusTraversalInfo > results
Definition: DtOsgFindNodesVisitor.h:107
virtual void apply(osg::Node &node) override
virtual bool isCullFaceEnabled(osg::StateSet *ss) const
virtual void apply(osg::Node &node) override
std::set< osg::Node * > nodeIgnoreList
Definition: DtOsgFindNodesVisitor.h:108
std::deque< NodeSwitchInfoPair > DequeNodeSwitchInfoPairs
Definition: DtIndirectSwitchManager.h:75
visitor for gathering all nodes of the same type in a scene graph. Returns vector of raw pointers ...
Definition: DtOsgFindNodesVisitor.h:61
Contains makVrv::DtDynamicTerrainSequenceNode class.
structure for holding the traversal info which is gathered by the DtOsgFindNodesVisitorRefPtrFlattenG...
Definition: DtOsgFindNodesVisitor.h:42
DtOsgFindNodesVisitorRefPtr(osg::NodeVisitor::TraversalMode traversalMode)
DtIndirectLodManager::DequeIndirectLodInfos lodStack
Definition: DtOsgFindNodesVisitor.h:51
DtIndirectDofManager::DequeNodeDofInfoPairs myDofStack
Definition: DtOsgFindNodesVisitor.h:120
DtNodePlusTraversalInfo()
Definition: DtOsgFindNodesVisitor.h:44
std::deque< osg::Matrixd > matrixStack
Definition: DtOsgFindNodesVisitor.h:109
osg::Matrixd xform
Definition: DtOsgFindNodesVisitor.h:50
std::deque< NodeDofInfoPair > DequeNodeDofInfoPairs
Definition: DtIndirectDofManager.h:74
Contains makVrv::DtIndirectDofManager class.
visitor for gathering all nodes of the same type in a scene graph. Returns vector of ref pointers ...
Definition: DtOsgFindNodesVisitor.h:72
Derived from osg::Node and is a replacement for the osgSim::LightPointNode represents a group of ligh...
Definition: DtLightPointNode.h:37
std::stack< DtIndirectPolygonOffset > myPolygonOffsetStack
Definition: DtOsgFindNodesVisitor.h:115
DtOsgFindNodesVisitorRefPtrFlattenGraph(osg::NodeVisitor::TraversalMode traversalMode, osg::Node::NodeMask gatherNodeMask=0, const std::set< osg::Node * > &nodeIgnoreList=std::set< osg::Node * >(), bool adjustLodStart=false)
Contains makVrv::DtIndirectSwitchManager class.
DtIndirectPolygonOffset polygonOffset
Definition: DtOsgFindNodesVisitor.h:56
bool myAdjustLodStart
Definition: DtOsgFindNodesVisitor.h:116
DtOsgFindNodesVisitor(osg::NodeVisitor::TraversalMode traversalMode)
osg::NodePath nodePath
Definition: DtOsgFindNodesVisitor.h:52
bool cullFaceEnabled
Definition: DtOsgFindNodesVisitor.h:55
Contains makVrv::DtIndirectLodManager class.
bool checkThisNodesMask(osg::Node &node, RESULT *result)
osg::Node::NodeMask myGatherNodeMask
Definition: DtOsgFindNodesVisitor.h:112
DtIndirectLodManager::DequeIndirectLodInfos lodStack
Definition: DtOsgFindNodesVisitor.h:110
non virtual container class for defining a polygon offset state
Definition: DtIndirectPolygonOffset.h:18
Contains DLL export macros.
Contains makVrv::DtDynamicTerrainSwitchNode class.
osg::ref_ptr< osg::Node > node
Definition: DtOsgFindNodesVisitor.h:49
std::stack< bool > myCullFaceEnabledStack
Definition: DtOsgFindNodesVisitor.h:114
std::vector< T * > results
Definition: DtOsgFindNodesVisitor.h:67
DtIndirectDofManager::DequeNodeDofInfoPairs dofStack
Definition: DtOsgFindNodesVisitor.h:54
visitor for gathering all nodes of the same type in a scene graph.
Definition: DtOsgFindNodesVisitor.h:84
std::deque< IndirectLodInfo > DequeIndirectLodInfos
Definition: DtIndirectLodManager.h:65
assert macros
std::vector< osg::ref_ptr< T > > results
Definition: DtOsgFindNodesVisitor.h:78
Contains the DtIndirectPolygonOffset class declaration.
virtual DtIndirectPolygonOffset gatherPolygonOffset(osg::StateSet *ss) const
void apply(osg::Node &node)

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)