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

GLBuilderGroupingVisitor.h

Go to the documentation of this file.
00001 
00002 //                            GLBuilderGroupingVisitor.h                      //
00004 
00005 #ifndef GLBUILDERGROUPINGVISITOR_H
00006 #define GLBUILDERGROUPINGVISITOR_H
00007 
00008 #include "GroupingVisitor.h"
00009 #include "GLBuilderGlobalVariables.h"
00010 
00011 namespace X3DTK {
00012 namespace X3D {
00013 
00015 
00016 class GLBuilderGroupingVisitor : public GroupingVisitor
00017 {
00018 public:
00020   GLBuilderGroupingVisitor();
00022   virtual ~GLBuilderGroupingVisitor();
00023 
00024   template<class T, class G>
00025   void enterNode(T *N) const
00026   {
00027     GL::SFNode GN = globalVariables->getNode(N);
00028     if (GN == 0)
00029     {
00030       GN = new G();
00031       GN->setX3DReference(N);
00032       globalVariables->addCoupleNode(N, GN);
00033     }   
00034     globalVariables->pushNode(GN);
00035   };
00036 
00037 protected:
00038   GLBuilderGlobalVariables *globalVariables;
00039 };
00040 
00041 }
00042 }
00043 
00044 #endif

Generated on Thu Oct 9 13:50:53 2003 for X3DToolKit by doxygen1.2.18