00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00027
00029 #ifndef __NODE_H__
00030 #define __NODE_H__
00031
00032 #include "Instantiate.h"
00033 #include <H3DNodeDatabase.h>
00034 #include "RefCountedClass.h"
00035 #ifdef USE_HAPTICS
00036 #include "TraverseInfo.h"
00037 #endif
00038 #include "Console.h"
00039
00040
00041
00042 using namespace std;
00043
00044 namespace H3D {
00045
00051 class H3DAPI_API Node: public RefCountedClass {
00052 public:
00053
00055 Node();
00056
00058 virtual ~Node() {};
00059
00060 template< class N >
00061 static Node *newInstance() { return new N; };
00062
00065 virtual void render() { };
00066
00067 #ifdef USE_HAPTICS
00075 virtual void traverseSG( TraverseInfo &ti ) {}
00076 #endif
00077
00081 virtual string defaultXMLContainerField() {
00082 return "children";
00083 }
00084
00086 virtual Field *getField( const string &name );
00087
00088 friend class Field;
00089 template <class Type>
00090 friend class SField;
00091 template <class Type>
00092 friend class MField;
00093 template<class RefClass, class BaseField>
00094 friend class RefCountSField;
00095
00096 protected:
00097 static H3DNodeDatabase database;
00098 int id;
00099 static int nr_nodes_created;
00100 };
00101
00102 };
00103
00104 #endif