V-ART
|
Scene Node Locator – used to find a particular object in the scene graph. More...
#include <snlocator.h>
Public Member Functions | |
SNLocator () | |
virtual | ~SNLocator () |
virtual void | OperateOn (const SceneNode *nodePtr)=0 |
Process given node. More... | |
bool | NotFinished () const |
Indicates whether the traversal has not finished. More... | |
bool | Finished () const |
Indicates whether the traversal has finished. More... | |
const SGPath & | Path () const |
Returns the path to target node. More... | |
void | AddNodeToPath (SceneNode *nodePtr) |
Adds a node to internal Path. More... | |
virtual void | Reset () |
Reverts to initial state. More... | |
const SceneNode * | LocatedNode () const |
Returns the located node. More... | |
Public Member Functions inherited from VART::SNOperator | |
virtual | ~SNOperator () |
Protected Attributes | |
bool | notFinished |
Indicates whether the locator has found the target node. More... | |
SGPath | path |
const SceneNode * | nodePtr |
Scene Node Locator – used to find a particular object in the scene graph.
A SNLocator (Scene Node Locator) is a special kind of SNOperator that is able to inform whether its task is finished. You should use a locator when you don't want the whole scene graph to be searched, that is, you want the traversal to finish once some criteria is met, such as when searching for a particular scene node.
It is also able to store scene graph path, so that the user may re-use the path to the target scene node.
Definition at line 25 of file snlocator.h.
VART::SNLocator::SNLocator | ( | ) |
Definition at line 10 of file snlocator.cpp.
|
inlinevirtual |
Definition at line 31 of file snlocator.h.
void VART::SNLocator::AddNodeToPath | ( | SceneNode * | nodePtr | ) |
Adds a node to internal Path.
The locator itself is not able to build a path to target node because it does not operates recursively. The resulting path must be built by calls to this method on recursive methods such as SceneNode::LocateDepthFirst().
Definition at line 14 of file snlocator.cpp.
Referenced by VART::SceneNode::LocateDepthFirst().
|
inline |
Indicates whether the traversal has finished.
The finishing criterion is usually finding a target node, so this method indicates whether the search was successfull.
Definition at line 46 of file snlocator.h.
References notFinished.
Referenced by VART::SceneNode::LocateDepthFirst().
|
inline |
Returns the located node.
Returns NULL if no node was found.
Definition at line 72 of file snlocator.h.
References nodePtr.
Referenced by VART::XmlJointAction::CreateJointMover().
|
inline |
Indicates whether the traversal has not finished.
The finishing criterion is usually finding a target node, so this method indicates whether the search was unsuccessfull.
Definition at line 40 of file snlocator.h.
References notFinished.
Referenced by VART::SceneNode::LocateBreadthFirst(), and VART::SceneNode::LocateDepthFirst().
|
pure virtual |
Process given node.
Implements VART::SNOperator.
Implemented in VART::PickNameLocator, VART::DescriptionLocator, and VART::AddressLocator.
Referenced by VART::SceneNode::LocateBreadthFirst(), and VART::SceneNode::LocateDepthFirst().
|
inline |
Returns the path to target node.
The locator itself is not able to build a path to target node because it does not operates recursively. The resulting path must be built by calls to AddNodeToPath() on recursive methods such as SceneNode::LocateDepthFirst().
This method only returns (by reference) the internal path.
Definition at line 55 of file snlocator.h.
References path.
|
virtual |
Reverts to initial state.
Resets the finished indicator and the path so that the locator may be used again.
Definition at line 19 of file snlocator.cpp.
|
protected |
Definition at line 81 of file snlocator.h.
Referenced by LocatedNode().
|
protected |
Indicates whether the locator has found the target node.
Definition at line 79 of file snlocator.h.
Referenced by Finished(), and NotFinished().
|
protected |
Definition at line 80 of file snlocator.h.
Referenced by Path().