V-ART
Public Member Functions | Protected Attributes | List of all members
VART::SNLocator Class Referenceabstract

Scene Node Locator – used to find a particular object in the scene graph. More...

#include <snlocator.h>

Inheritance diagram for VART::SNLocator:
VART::SNOperator VART::AddressLocator VART::DescriptionLocator VART::PickNameLocator

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 SGPathPath () 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 SceneNodeLocatedNode () 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 SceneNodenodePtr
 

Detailed Description

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.

Constructor & Destructor Documentation

VART::SNLocator::SNLocator ( )

Definition at line 10 of file snlocator.cpp.

virtual VART::SNLocator::~SNLocator ( )
inlinevirtual

Definition at line 31 of file snlocator.h.

Member Function Documentation

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().

bool VART::SNLocator::Finished ( ) const
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().

const SceneNode* VART::SNLocator::LocatedNode ( ) const
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().

bool VART::SNLocator::NotFinished ( ) const
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().

virtual void VART::SNLocator::OperateOn ( const SceneNode nodePtr)
pure virtual
const SGPath& VART::SNLocator::Path ( ) const
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.

void VART::SNLocator::Reset ( )
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.

Member Data Documentation

const SceneNode* VART::SNLocator::nodePtr
protected

Definition at line 81 of file snlocator.h.

Referenced by LocatedNode().

bool VART::SNLocator::notFinished
protected

Indicates whether the locator has found the target node.

Definition at line 79 of file snlocator.h.

Referenced by Finished(), and NotFinished().

SGPath VART::SNLocator::path
protected

Definition at line 80 of file snlocator.h.

Referenced by Path().


The documentation for this class was generated from the following files: