00001 00002 00003 00005 00006 00011 00016 00021 // X3DAbstractNode.h // 00023 00024 #ifndef X3DABSTRACTNODE_H 00025 #define X3DABSTRACTNODE_H 00026 00027 #include "X3DTypes.h" 00028 #include "X3DFileElement.h" 00029 #include "Type.h" 00030 #include "NameDict.h" 00031 00032 namespace X3DTK { 00033 00034 class FileElement; 00035 00037 00038 class X3DAbstractNode 00039 { 00040 public: 00042 X3DAbstractNode(); 00044 virtual ~X3DAbstractNode(); 00045 00047 //inline SFString getName() const {return DEFDict.getNameOfNode((X3DAbstractNode *)this);}; 00049 inline SFString getTypeName() const {return _type->getName();}; 00051 inline Type *getType() const {return _type;}; 00053 inline MFAbstractNode getParentList() const {return _parentList;}; 00054 00057 virtual bool addChild(const SFAbstractNode &N); 00060 virtual bool setChild(const SFAbstractNode &N); 00062 virtual bool removeChild(const SFAbstractNode &N); 00063 00065 void addParent(const SFAbstractNode &N); 00067 bool removeParent(const SFAbstractNode &N); 00068 00070 static NameDict DEFDict; 00071 00072 protected: 00074 X3DAbstractNode(const X3DAbstractNode &N); 00075 00078 inline void defineTypeName(const SFString &name, const SFString &component = SFString("")) {Type::defineTypeName(&_type, name, component);}; 00079 00080 inline void addOneReference() {_type->addOneReferenceRecursive();}; 00081 00082 private: 00083 Type *_type; 00084 MFAbstractNode _parentList; 00085 }; 00086 00087 } 00088 00089 #endif