VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtIndirectSwitchManager.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2018 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
14 
17 
19 
20 #include <osg/Node>
21 #include <osg/ref_ptr>
22 #include <osg/observer_ptr>
23 
24 #include <deque>
25 #include <osg/Switch>
26 #include <osgSim/MultiSwitch>
27 
28 namespace osg
29 {
30  class Sequence;
31  class RenderInfo;
32 }
33 
34 namespace osgSim
35 {
36  class MultiSwitch;
37 }
38 
39 
40 namespace makVrv
41 {
42  class DtPerGeomInstance;
43  class DtInstanceContainer;
44  class DtDynamicTerrainSwitchNode;
45  class DtSwitchInstanceState;
46  class DtDe;
47 
53  {
54  public:
55 
62  {
65  unsigned int mySwitchMaskBit;
66  osg::NodePath myNodePath;
68  };
69 
70  typedef osg::observer_ptr<osg::Node> NodeObserverPtr;
71  typedef std::pair<NodeObserverPtr, IndirectSwitchInfo> NodeSwitchInfoPair;
72  typedef std::deque<NodeSwitchInfoPair> DequeNodeSwitchInfoPairs;
73  typedef std::vector<DequeNodeSwitchInfoPairs> DequeNodeSwitchInfoPairsArray;
74  typedef std::map<NodeObserverPtr, std::vector<IndirectSwitchInfo> > SwitchInfoMap;
75 
76  public:
77 
80 
82  virtual ~DtIndirectSwitchManager();
83 
84  private:
90  DtIndirectSwitchManager &operator=(const DtIndirectSwitchManager &other);
91 
92  public:
94  virtual void addSwitchPaths(DtInstanceContainer& instances, int perGeomInstanceIndex, int size, const DequeNodeSwitchInfoPairs& parentSwitchPaths, const DequeNodeSwitchInfoPairsArray& switchPaths, const osg::NodePath& parentNodePath);
95 
97  virtual void addSwitchPath(DtInstanceContainer& instances, int perGeomInstanceIndex, const DequeNodeSwitchInfoPairs& parentSwitchPaths, const DequeNodeSwitchInfoPairs& switchPath, const osg::NodePath& parentNodePath);
98 
100  virtual void addSwitch(NodeSwitchInfoPair& switchChildPair, DtPerGeomInstance &perGeomInstance, int bitMaskId, int perGeomInstanceIndex, const osg::NodePath& parentNodePath);
101 
103  virtual bool areSwitchesDirty(bool clearFlag = true);
104 
106  virtual void slot_setSwitch(DtDynamicTerrainSwitchNode* switchNode, DynamicTerrain::NodePathHash nodePathHash, int childIdx);
107 
108  virtual void updateSequences(osg::RenderInfo& renderInfo);
109 
110  protected:
111 
113  virtual bool checkSwitchChildActive(osg::ref_ptr<osg::Node> nodeRefPtr, int childIndex, DynamicTerrain::NodePathHash pathHash);
114 
115  protected:
116 
118  std::set<DtDynamicTerrainSwitchNode*> myDynamicSwitchSet;
119 
120  typedef std::map<osg::Sequence*, unsigned int> SequenceMap;
122 
123  typedef std::map<osg::Switch*, osg::Switch::ValueList> SwitchMap;
125 
126  typedef std::map<osgSim::MultiSwitch*, osgSim::MultiSwitch::ValueList> MultiSwitchMap;
128 
129 
134 
135  };
136 
137 
141  {
142  public:
145 
148 
150  virtual DtIndirectSwitchManager* create(DtInstanceContainer& container) const;
151 
154  static DtIndirectSwitchManagerCreator& instance(DtDe& de);
155 
157  static const std::string& theClassName();
158  protected:
160  };
161 
162 
163 }
DtDe & myDe
Definition: DtIndirectSwitchManager.h:133
structure for holding the information about a particular instance of a particular switch...
Definition: DtIndirectSwitchManager.h:61
DynamicTerrain::NodePathHash myDynamicTerrianPathHash
Definition: DtIndirectSwitchManager.h:67
Virtual base class.
Definition: DtVirtualBaseClass.h:22
DtDynamicTerrainSwitchNode replaces an osgSim::multiswitch in a terrain patch (or page) that is tagge...
Definition: DtDynamicTerrainSwitchNode.h:74
size_t NodePathHash
Typedef used to represent a hash of an OSG Node path to a referenced node.
Definition: DtMultiReferencedNodeContainer.h:25
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
handles the switches for all the indirect geometry.
Definition: DtIndirectSwitchManager.h:52
voidpf void uLong size
Definition: ioapi.h:39
std::deque< NodeSwitchInfoPair > DequeNodeSwitchInfoPairs
Definition: DtIndirectSwitchManager.h:72
DtInstanceContainer & myContainer
Definition: DtIndirectSwitchManager.h:132
DtGeometrySpecification class declaration.
std::map< osg::Sequence *, unsigned int > SequenceMap
Definition: DtIndirectSwitchManager.h:120
std::map< NodeObserverPtr, std::vector< IndirectSwitchInfo > > SwitchInfoMap
Definition: DtIndirectSwitchManager.h:74
SwitchInfoMap mySwitches
Definition: DtIndirectSwitchManager.h:117
DtDe & myDe
Definition: DtIndirectSwitchManager.h:159
creator for DtIndirectSwitchManager
Definition: DtIndirectSwitchManager.h:140
MultiSwitchMap myMultiChangedMap
Definition: DtIndirectSwitchManager.h:127
DtSignalConnectionManager myConnections
Definition: DtIndirectSwitchManager.h:130
bool mySwitchesDirty
Definition: DtIndirectSwitchManager.h:131
data that is both Per geometry and per instance such as switch states ***** Used on the GPU directly ...
Definition: DtGeometrySpecification.h:23
osg::observer_ptr< osg::Node > NodeObserverPtr
Definition: DtIndirectSwitchManager.h:70
Contains makVrv::DtVirtualBaseClass class.
int mySwitchChild
Definition: DtIndirectSwitchManager.h:64
std::map< osgSim::MultiSwitch *, osgSim::MultiSwitch::ValueList > MultiSwitchMap
Definition: DtIndirectSwitchManager.h:126
std::map< osg::Switch *, osg::Switch::ValueList > SwitchMap
Definition: DtIndirectSwitchManager.h:123
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:24
std::set< DtDynamicTerrainSwitchNode * > myDynamicSwitchSet
Definition: DtIndirectSwitchManager.h:118
std::vector< DequeNodeSwitchInfoPairs > DequeNodeSwitchInfoPairsArray
Definition: DtIndirectSwitchManager.h:73
SequenceMap mySequenceChangedMap
Definition: DtIndirectSwitchManager.h:121
Contains makVrv::DtMultiReferencedNodeContainer class.
int myPerGeomInstanceIdx
Definition: DtIndirectSwitchManager.h:63
unsigned int mySwitchMaskBit
Definition: DtIndirectSwitchManager.h:65
std::pair< NodeObserverPtr, IndirectSwitchInfo > NodeSwitchInfoPair
Definition: DtIndirectSwitchManager.h:71
Base class to provide boost signal/slot management.
Contains DLL export macros.
SwitchMap mySwitchChangedMap
Definition: DtIndirectSwitchManager.h:124
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Helper class to manage instances This class allows you to add a DtInstance_64 Internally, however it stores this as a DtInstance (which the GPU can directly read)
Definition: DtInstanceContainer.h:27
osg::NodePath myNodePath
Definition: DtIndirectSwitchManager.h:66

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)