|
- #ifndef OSG_NODE
- #define OSG_NODE 1
- #include <osg/Object>
- #include <osg/StateSet>
- #include <osg/BoundingSphere>
- #include <osg/NodeCallback>
- #include <string>
- #include <vector>
- namespace osg {
- class NodeVisitor;
- class Group;
- class Transform;
- class Node;// 这里可以写Node?不是还没声明吗
- class Switch;
- class Geode;// Gedoe是Node的子类,为什么可以这样写,用意是什么
- typedef std::vector< Node* > NodePath;
- typedef std::vector< NodePath > NodePathList;
- typedef std::vector< Matrix > MatrixList;
- #define META_Node(library,name) \
- virtual osg::Object* cloneType() const { return new name (); } \
- virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new 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(); } } \
-
- class OSG_EXPORT Node : public Object
复制代码 以上两处疑问涉及到c++什么知识? |
|