VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtMultiReferencedNodeContainer.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
14 #include <osg/Node>
15 #include <boost/unordered_map.hpp>
16 #include <boost/function.hpp>
17 
18 namespace makVrv
19 {
20  namespace DynamicTerrain
21  {
23  typedef size_t NodePathHash;
24  }
25 
39  template <typename State>
41  {
42  public:
43 
46 
50 
53 
56  virtual DynamicTerrain::NodePathHash addNodeInstance( const osg::NodePath& nodePath );
57 
60  virtual void setDefaultState( const State& state );
61 
64  virtual const State& defaultState() const;
65 
69  virtual void setState( DynamicTerrain::NodePathHash hashIndex, const State& state );
70 
73  virtual void setState( const State& state );
74 
79  virtual bool getState( DynamicTerrain::NodePathHash hashIndex, State& state );
80 
85  const osg::NodePath& nodePath);
86 
88  typedef boost::function<void (DynamicTerrain::NodePathHash)> NodeReferenceFunction;
89 
91  virtual void forEachNodeReference(NodeReferenceFunction& perNodeFunction);
92 
93  protected:
94 
95  // Typedef for unordered map used to maintain state indexed by node path hash
96  typedef boost::unordered_map<DynamicTerrain::NodePathHash, State> NodeInstanceMap;
97 
98  // The map of node instance states
100 
101  // A list of depths that nodes were added at.
102  std::set<int> myNodePathDepths;
103 
104  // The default state applied to all new references
106 
107  };
108 }
109 
110 #define DtMultiReferencedNodeContainer_INL_
111 #include "DtMultiReferencedNodeContainer.inl"
112 #undef DtMultiReferencedNodeContainer_INL_
113 

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)