00001 00002 // GLBuilderRenderingVisitor.h // 00004 00005 #ifndef GLBUILDERRENDERINGVISITOR_H 00006 #define GLBUILDERRENDERINGVISITOR_H 00007 00008 #include "RenderingVisitor.h" 00009 #include "GLBuilderGlobalVariables.h" 00010 00011 namespace X3DTK { 00012 namespace X3D { 00013 00014 class X3DGeometryNode; 00015 00017 00018 class GLBuilderRenderingVisitor : public RenderingVisitor 00019 { 00020 public: 00022 GLBuilderRenderingVisitor(); 00024 virtual ~GLBuilderRenderingVisitor(); 00025 00026 template<class T, class G> 00027 void enterNode(T *N) const 00028 { 00029 GL::SFNode GN = globalVariables->getNode(N); 00030 if (GN == 0) 00031 { 00032 GN = new G(); 00033 GN->setX3DReference(N); 00034 globalVariables->addCoupleNode(N, GN); 00035 } 00036 globalVariables->pushNode(GN); 00037 }; 00038 00040 virtual bool walkOnX3DGeometryNode(X3DGeometryNode *N, SFAbstractNode child) const; 00041 00042 protected: 00043 GLBuilderGlobalVariables *globalVariables; 00044 }; 00045 00046 } 00047 } 00048 00049 #endif