Introduce NodeVisitor::className and libraryName()
This commit is contained in:
@@ -42,6 +42,10 @@ class Transform;
|
||||
class Camera;
|
||||
class CameraView;
|
||||
|
||||
#define META_NodeVisitor(library,name) \
|
||||
virtual const char* libraryName() const { return #library; }\
|
||||
virtual const char* className() const { return #name; }
|
||||
|
||||
/** Visitor for type safe operations on osg::Nodes.
|
||||
Based on GOF's Visitor pattern. The NodeVisitor
|
||||
is useful for developing type safe operations to nodes
|
||||
@@ -82,6 +86,12 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
|
||||
NodeVisitor(VisitorType type,TraversalMode tm=TRAVERSE_NONE);
|
||||
|
||||
virtual ~NodeVisitor();
|
||||
|
||||
/** return the library name/namespapce of the visitor's. Should be defined by derived classes.*/
|
||||
virtual const char* libraryName() const { return "osg"; }
|
||||
|
||||
/** return the name of the visitor's class type. Should be defined by derived classes.*/
|
||||
virtual const char* className() const { return "NodeVisitor"; }
|
||||
|
||||
/** Method to call to reset visitor. Useful if your visitor accumulates
|
||||
state during a traversal, and you plan to reuse the visitor.
|
||||
|
||||
Reference in New Issue
Block a user