25 #include <osg/NodeVisitor> 42 case NodeVisitor::VisitorType::NODE_VISITOR:
43 return osg::NodeVisitor::VisitorType::NODE_VISITOR;
45 case NodeVisitor::VisitorType::UPDATE_VISITOR:
46 return osg::NodeVisitor::VisitorType::UPDATE_VISITOR;
48 case NodeVisitor::VisitorType::EVENT_VISITOR:
49 return osg::NodeVisitor::VisitorType::EVENT_VISITOR;
51 case NodeVisitor::VisitorType::COLLECT_OCCLUDER_VISITOR:
52 return osg::NodeVisitor::VisitorType::COLLECT_OCCLUDER_VISITOR;
54 case NodeVisitor::VisitorType::CULL_VISITOR:
55 return osg::NodeVisitor::VisitorType::CULL_VISITOR;
57 case NodeVisitor::VisitorType::INTERSECTION_VISITOR:
58 return osg::NodeVisitor::VisitorType::INTERSECTION_VISITOR;
61 return osg::NodeVisitor::VisitorType::NODE_VISITOR;
79 case osg::NodeVisitor::VisitorType::NODE_VISITOR:
80 return NodeVisitor::VisitorType::NODE_VISITOR;
82 case osg::NodeVisitor::VisitorType::UPDATE_VISITOR:
83 return NodeVisitor::VisitorType::UPDATE_VISITOR;
85 case osg::NodeVisitor::VisitorType::EVENT_VISITOR:
86 return NodeVisitor::VisitorType::EVENT_VISITOR;
88 case osg::NodeVisitor::VisitorType::COLLECT_OCCLUDER_VISITOR:
89 return NodeVisitor::VisitorType::COLLECT_OCCLUDER_VISITOR;
91 case osg::NodeVisitor::VisitorType::CULL_VISITOR:
92 return NodeVisitor::VisitorType::CULL_VISITOR;
94 case osg::NodeVisitor::VisitorType::INTERSECTION_VISITOR:
95 return NodeVisitor::VisitorType::INTERSECTION_VISITOR;
98 return NodeVisitor::VisitorType::NODE_VISITOR;
116 case NodeVisitor::TraversalMode::TRAVERSE_NONE:
117 return osg::NodeVisitor::TraversalMode::TRAVERSE_NONE;
119 case NodeVisitor::TraversalMode::TRAVERSE_PARENTS:
120 return osg::NodeVisitor::TraversalMode::TRAVERSE_PARENTS;
122 case NodeVisitor::TraversalMode::TRAVERSE_ALL_CHILDREN:
123 return osg::NodeVisitor::TraversalMode::TRAVERSE_ALL_CHILDREN;
125 case NodeVisitor::TraversalMode::TRAVERSE_ACTIVE_CHILDREN:
126 return osg::NodeVisitor::TraversalMode::TRAVERSE_ACTIVE_CHILDREN;
129 return osg::NodeVisitor::TraversalMode::TRAVERSE_NONE;
147 case osg::NodeVisitor::TraversalMode::TRAVERSE_NONE:
148 return NodeVisitor::TraversalMode::TRAVERSE_NONE;
150 case osg::NodeVisitor::TraversalMode::TRAVERSE_PARENTS:
151 return NodeVisitor::TraversalMode::TRAVERSE_PARENTS;
153 case osg::NodeVisitor::TraversalMode::TRAVERSE_ALL_CHILDREN:
154 return NodeVisitor::TraversalMode::TRAVERSE_ALL_CHILDREN;
156 case osg::NodeVisitor::TraversalMode::TRAVERSE_ACTIVE_CHILDREN:
157 return NodeVisitor::TraversalMode::TRAVERSE_ACTIVE_CHILDREN;
160 return NodeVisitor::TraversalMode::TRAVERSE_NONE;
314 for (
int i = 0; osgNodes->size() - 1; ++i)
317 path->push_back(newNode);
330 for (
int i = 0; osgNodes->size() - 1; ++i)
333 path->push_back(newNode);
NodeVisitor(TraversalMode tm=TRAVERSE_NONE, const std::string name=CLASS_TYPE)
Holds the class type name for efficient comparisons.
virtual osg::NodeVisitor * AsOSGVisitor()
Returns a pointer to the internal OSG Node.
osg::NodeVisitor::VisitorType ToVisitorType(NodeVisitor::VisitorType type)
std::vector< trBase::SmrtPtr< Node > > NodePath
A vector of Nodes pointers which is used to describe the path from a root node to a descendant...
unsigned int NodeMask
Holds the class type name for efficient comparisons.
Smart pointer for handling referenced counted objects.
Class which encapsulates the frame number, reference time and calendar time of specific frame...
osg::NodeVisitor::TraversalMode ToTraversalMode(NodeVisitor::TraversalMode mode)
Converts TR traversal mode to a osg traversal mode.
A string wrapper that will make sure that all of the strings with the same value will point to the sa...
const FrameStamp * GetFrameStamp() const
Get the FrameStamp that this traversal is associated with.
Node::NodeMask GetTraversalMask() const
Get the TraversalMask.
NodePath * GetNodePath()
Get the non const NodePath from the top most node applied down to the current Node being visited...
virtual void Reset()
Method to call to reset visitor.
TraversalMode GetTraversalMode() const
Get the traversal mode.
void PopFromNodePath()
Method called by Node::Accept() method after a call to NodeVisitor::Apply(..).
Visitor for type safe operations on trCore::Nodes.
VisitorType GetVisitorType() const
Get the VisitorType.
Class for wrapping the osg node Internally it contains an OSG Group, that can be accessed by user if ...
void SetNodeMaskOverride(Node::NodeMask mask)
void PushOntoNodePath(Node *node)
Method called by Node::Accept() method before a call to the NodeVisitor::Apply(..).
virtual const std::string & GetType() const override
Returns the class type.
virtual void SetName(const std::string &name)
Sets this instances name.
bool ValidNodeMask(const Nodes::Node &node) const
Method to called by Node and its subclass' Node::Accept() method, if the result is true it is used to...
void Traverse(Node &node)
Method for handling traversal of a nodes.
virtual osg::FrameStamp * AsOSGClass()
Returns a pointer to the internal OSG FrameStamp.
void SetTraversalNumber(unsigned int fn)
Set the traversal number.
~NodeVisitor()
Destructor.
static const trUtil::RefStr CLASS_TYPE
Adds an easy and swappable access to the base class.
virtual void SetName(const std::string &name)
Sets this instances name.
void SetFrameStamp(FrameStamp *fs)
Set the FrameStamp that this traversal is associated with.
trBase::SmrtPtr< osg::NodeVisitor > mNodeVisitor
The node visitor.
virtual osg::Node * AsOSGNode()
Returns a pointer to the internal OSG Node.
T * Get() const
Returns the stored internal pointer.
void SetTraversalMode(TraversalMode mode)
Set the traversal mode for Node::Traverse() to use when deciding which children of a node to traverse...
void SetVisitorType(VisitorType type)
Set the VisitorType, used to distinguish different visitors during traversal of the scene...
Node::NodeMask GetNodeMaskOverride() const
unsigned int GetTraversalNumber() const
Get the traversal number.
void SetTraversalMask(Node::NodeMask mask)
Set the TraversalMask of this NodeVisitor.