Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

X3DAbstractNode.h

Go to the documentation of this file.
00001 
00002 //                            X3DAbstractNode.h                               //
00004 
00005 #ifndef X3DABSTRACTNODE_H
00006 #define X3DABSTRACTNODE_H
00007 
00008 #include "X3DTypes.h"
00009 #include "X3DFileElement.h"
00010 #include "SFType.h"
00011 #include "NameDict.h"
00012 
00013 namespace X3DTK {
00014 
00015 class FileElement;
00016 
00018 
00019 class X3DAbstractNode
00020 {
00021 public:
00023   X3DAbstractNode();
00025   virtual SFAbstractNode clone() const;
00027   virtual ~X3DAbstractNode();
00028 
00030   inline SFString getTypeName() const {return _type->getName();};
00032   inline SFType *getType() const {return _type;};
00034   virtual MFAbstractNode getChildrenList() const;
00036   inline MFAbstractNode getParentList() const {return _parentList;};
00037     
00040   virtual bool addChild(const SFAbstractNode &N);
00043   virtual bool setChild(const SFAbstractNode &N);
00045   virtual bool removeChild(const SFAbstractNode &N);
00046 
00048   static NameDict DEFDict;
00049     
00050 protected:
00052   X3DAbstractNode(const X3DAbstractNode &N);
00053 
00056   inline void defineTypeName(const SFString &name, const SFString &component = SFString(""), const SFString &sceneGraph = SFString("")) {SFType::defineTypeName(&_type, name, component, sceneGraph);};
00058   inline void addOneReference() {_type->addOneReferenceRecursive();};
00060   static void addParentToChild(SFAbstractNode parent, SFAbstractNode child);
00062   static void removeParentFromChild(SFAbstractNode parent, SFAbstractNode child);
00063   
00064 private:   
00065   SFType *_type;
00066   MFAbstractNode _parentList;
00067   
00069   void addParent(const SFAbstractNode &N);
00071   bool removeParent(const SFAbstractNode &N);
00072 };
00073 
00074 }
00075 
00076 #endif

Generated on Thu Dec 4 13:25:49 2003 for X3DToolKit by doxygen1.2.18