Node.h

Go to the documentation of this file.
00001 
00002 //    Copyright 2004, SenseGraphics AB
00003 //
00004 //    This file is part of H3D API.
00005 //
00006 //    H3D API is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    H3D API is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with H3D API; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 //
00020 //    A commercial license is also available. Please contact us at 
00021 //    www.sensegraphics.com for more information.
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 //#include "FieldTemplates.h"
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

Generated on Thu Aug 24 12:38:33 2006 for H3D API by  doxygen 1.4.5