00001 #include "GLRendererGLGroupingVisitor.h"
00002 #include "GLGroup.h"
00003 #include "GLStaticGroup.h"
00004 #include "GLTransform.h"
00005
00006 using namespace X3DTK;
00007
00008 GLRendererGLGroupingVisitor::GLRendererGLGroupingVisitor()
00009 : GLGroupingVisitor()
00010 {
00011
00012 defineNewEnterFunction<GLRendererGLGroupingVisitor, GLGroup>(&GLRendererGLGroupingVisitor::enterGLGroup);
00013 defineNewEnterFunction<GLRendererGLGroupingVisitor, GLStaticGroup>(&GLRendererGLGroupingVisitor::enterGLStaticGroup);
00014 defineNewEnterFunction<GLRendererGLGroupingVisitor, GLTransform>(&GLRendererGLGroupingVisitor::enterGLTransform);
00015
00016
00017 defineNewLeaveFunction<GLRendererGLGroupingVisitor, GLTransform>(&GLRendererGLGroupingVisitor::leaveGLTransform);
00018
00019
00020 globalVariables = GVManager::getInstanceOf<GLRendererGlobalVariables>();
00021 }
00022
00023 GLRendererGLGroupingVisitor::~GLRendererGLGroupingVisitor()
00024 {
00025 }
00026
00027 void GLRendererGLGroupingVisitor::enterGLGroup(GLGroup *G) const
00028 {
00029 }
00030
00031 void GLRendererGLGroupingVisitor::enterGLStaticGroup(GLStaticGroup *G) const
00032 {
00033 }
00034
00035 void GLRendererGLGroupingVisitor::enterGLTransform(GLTransform *G) const
00036 {
00037 glMatrixMode(GL_MODELVIEW);
00038 glPushMatrix();
00039 glMultMatrixf(&G->getTransformMatrix().front());
00040 }
00041
00042 void GLRendererGLGroupingVisitor::leaveGLTransform(GLTransform *G) const
00043 {
00044 glMatrixMode(GL_MODELVIEW);
00045 glPopMatrix();
00046 }