![]() |
VR-Forces 4.6 Class Documentation
|
DtMultiReferencedNodeContainer is a class template that it used to provide support for dynamic nodes (such as switches and animations) that may be multiply referenced. More...

Public Types | |
| typedef boost::function< void(DynamicTerrain::NodePathHash)> | NodeReferenceFunction |
| Function type that runs on node reference. | |
Public Member Functions | |
| DtMultiReferencedNodeContainer () | |
| CTOR. | |
| DtMultiReferencedNodeContainer (const DtMultiReferencedNodeContainer &orig) | |
| Copy CTOR param[in] orig the DtMultiReferencedNodeContainer to copy. | |
| virtual | ~DtMultiReferencedNodeContainer () |
| DTOR. | |
| virtual DynamicTerrain::NodePathHash | addNodeInstance (const osg::NodePath &nodePath) |
| Add a reference to a node and return the hash for the passed in node path. | |
| virtual void | setDefaultState (const State &state) |
| Specify a default state used to initialize each node reference when added. | |
| virtual const State & | defaultState () const |
| Get the default state used for node references. | |
| virtual void | setState (DynamicTerrain::NodePathHash hashIndex, const State &state) |
| Set the state of a node reference. | |
| virtual void | setState (const State &state) |
| Set the state of all node references. | |
| virtual bool | getState (DynamicTerrain::NodePathHash hashIndex, State &state) |
| Get the state of node instance. | |
| virtual DynamicTerrain::NodePathHash | calcNodePathHashValue (const osg::NodePath &nodePath) |
| Calculate a node hash, checks all known depths that nodes werer added at. | |
| virtual void | forEachNodeReference (NodeReferenceFunction &perNodeFunction) |
| Execute a function on each node reference in the container. | |
Protected Types | |
| typedef boost::unordered_map < DynamicTerrain::NodePathHash, State > | NodeInstanceMap |
Protected Attributes | |
| NodeInstanceMap | myNodeInstanceMap |
| std::set< int > | myNodePathDepths |
| State | myDefaultState |
DtMultiReferencedNodeContainer is a class template that it used to provide support for dynamic nodes (such as switches and animations) that may be multiply referenced.
Each reference is tracked using a hash of the OSG node path from the root of the patch/page to the node. For each reference, the state of the node reference is maintained as a templated state object. When a deriving class has a visitor traverse it's referenced node, the nodePath of the traversal to the node is used to calculate a node hash which is then used to look up the state of that node reference for use in that traversal. Since the patch/page in which the reference was found may have been placed anywhere into the scene graph after it was been parsed, the path depth from the top of the patch/page to the switch is kept; the subsequent hash on traversal is then limited to that depth. The template parameter is used to allow different deriving types to maintain different state objects associated with the node references.
| typedef boost::function<void (DynamicTerrain::NodePathHash)> makVrv::DtMultiReferencedNodeContainer< State >::NodeReferenceFunction |
Function type that runs on node reference.
|
protected |
| makVrv::DtMultiReferencedNodeContainer< State >::DtMultiReferencedNodeContainer | ( | ) |
CTOR.
| makVrv::DtMultiReferencedNodeContainer< State >::DtMultiReferencedNodeContainer | ( | const DtMultiReferencedNodeContainer< State > & | orig | ) |
Copy CTOR param[in] orig the DtMultiReferencedNodeContainer to copy.
|
virtual |
DTOR.
|
virtual |
Add a reference to a node and return the hash for the passed in node path.
| [in] | hashIndex | the hash of the OSG node path to the reference |
|
virtual |
Specify a default state used to initialize each node reference when added.
| [in] | state | the state to use for new node references |
|
virtual |
Get the default state used for node references.
|
virtual |
Set the state of a node reference.
| [in] | hashIndex | the node path hash of the reference |
| [in] | state | the state value to set |
|
virtual |
Set the state of all node references.
| [in] | state | the state value to set |
|
virtual |
Get the state of node instance.
| [in] | hashIndex | the node has that represents the node reference |
| [out] | state | the current state saved for the node reference |
|
virtual |
Calculate a node hash, checks all known depths that nodes werer added at.
| [in] | nodePath | the node path to be hashed |
|
virtual |
Execute a function on each node reference in the container.
|
protected |
|
protected |
|
protected |