Visitor for type safe operations on osg::Node's.
Inheritance:
Public Methods
-
NodeVisitor(TraversalMode tm=TRAVERSE_NONE)
-
virtual ~NodeVisitor()
-
virtual void reset()
- Method to call to reset visitor.
-
void setTraversalMode(const TraversalMode mode)
- Set the traversal mode for Node::traverse() to use when deciding which children of a node to traverse.
-
inline const TraversalMode getTraversalMode() const
- Get the traversal mode
-
void setTraversalVisitor(NodeVisitor* nv)
- Set a visitor to handle traversal.
-
NodeVisitor* getTraversalVisitor()
- Get the traversal visitor, returns NULL if none is attached
-
void traverse(Node& node)
- Inline method for passing handling traversal of a nodes.
-
virtual void apply(Node& node)
-
virtual void apply(Geode& node)
-
virtual void apply(Billboard& node)
-
virtual void apply(LightSource& node)
-
virtual void apply(Group& node)
-
virtual void apply(Transform& node)
-
virtual void apply(Switch& node)
-
virtual void apply(Sequence& node)
-
virtual void apply(LOD& node)
-
virtual void apply(Impostor& node)
Public Members
-
enum TraversalMode
Protected Fields
-
ref_ptr<NodeVisitor> _traversalVisitor
-
TraversalMode _traversalMode
Public Methods
-
inline Referenced& operator = (Referenced&)
-
inline void ref() const
-
inline void unref() const
-
inline const int referenceCount() const
Protected Fields
-
mutable int _refCount
Documentation
Visitor for type safe operations on osg::Node's.
Based on GOF's Visitor pattern.
enum TraversalMode
TRAVERSE_NONE
TRAVERSE_PARENTS
TRAVERSE_ALL_CHILDREN
TRAVERSE_ACTIVE_CHILDREN
TRAVERSE_VISITOR
NodeVisitor(TraversalMode tm=TRAVERSE_NONE)
virtual ~NodeVisitor()
virtual void reset()
- Method to call to reset visitor. Useful for your visitor accumulates
state during a traversal, and you plan to resuse the visitor.
To flush that state for the next traversal than call reset() prior
to each traversal.
void setTraversalMode(const TraversalMode mode)
- Set the traversal mode for Node::traverse() to use when
deciding which children of a node to traverse. If a
NodeVisitor has been attached via setTraverseVisitor()
and the new mode is not TRAVERSE_VISITOR then the attached
visitor is detached. Default mode is TRAVERSE_NONE.
inline const TraversalMode getTraversalMode() const
- Get the traversal mode
void setTraversalVisitor(NodeVisitor* nv)
- Set a visitor to handle traversal.
Overides the traverse mode setting it to TRAVERSAL_VISITOR.
NodeVisitor* getTraversalVisitor()
- Get the traversal visitor, returns NULL if none is attached
void traverse(Node& node)
- Inline method for passing handling traversal of a nodes.
If you intend to use the visitor for actively traversing
the scene graph then make sure the accept() methods call
this method unless they handle traversal directly.
virtual void apply(Node& node)
virtual void apply(Geode& node)
virtual void apply(Billboard& node)
virtual void apply(LightSource& node)
virtual void apply(Group& node)
virtual void apply(Transform& node)
virtual void apply(Switch& node)
virtual void apply(Sequence& node)
virtual void apply(LOD& node)
virtual void apply(Impostor& node)
ref_ptr<NodeVisitor> _traversalVisitor
TraversalMode _traversalMode
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.