Addd libraryName() method to osg::Object in preperation for the osgDB support

for node kits plugins.
This commit is contained in:
Robert Osfield
2002-06-06 13:25:36 +00:00
parent 21a8149aa5
commit 99580f2212
78 changed files with 115 additions and 71 deletions

View File

@@ -22,11 +22,12 @@ class Group;
/** META_Node macro define the standard clone, isSameKindAs, className
* and accept methods. Use when subclassing from Node to make it
* more convinient to define the required pure virtual methods.*/
#define META_Node(name) \
#define META_Node(library,name) \
virtual osg::Object* cloneType() const { return osgNew name (); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew name (*this,copyop); } \
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
virtual const char* className() const { return #name; } \
virtual const char* libraryName() const { return #library; } \
virtual void accept(osg::NodeVisitor& nv) { if (nv.validNodeMask(*this)) { nv.pushOntoNodePath(this); nv.apply(*this); nv.popFromNodePath(); } } \
@@ -54,6 +55,9 @@ class SG_EXPORT Node : public Object
/** return true if this and obj are of the same kind of object.*/
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Node*>(obj)!=NULL; }
/** return the name of the node's library.*/
virtual const char* libraryName() const { return "osg"; }
/** return the name of the node's class type.*/
virtual const char* className() const { return "Node"; }