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

DefaultGLDFSGLGroupingWalker.cpp

Go to the documentation of this file.
00001 #include "DefaultGLDFSGLGroupingWalker.h"
00002 #include "NodeWalkingProxy.h"
00003 #include "NodeVisitingProxy.h"
00004 #include "GLGroupingNodes.h"
00005 
00006 using namespace X3DTK;
00007 
00008 DefaultGLDFSGLGroupingWalker::DefaultGLDFSGLGroupingWalker()
00009 : DFSGLGroupingWalker()
00010 {
00011   defineNewWalkingFunction<DefaultGLDFSGLGroupingWalker, GLStaticGroup>(&DefaultGLDFSGLGroupingWalker::walkGLStaticGroup);
00012   defineNewWalkingFunction<DefaultGLDFSGLGroupingWalker, X3DGLGroupingNode>(&DefaultGLDFSGLGroupingWalker::walkX3DGLGroupingNode);
00013 }
00014 
00015 DefaultGLDFSGLGroupingWalker::~DefaultGLDFSGLGroupingWalker()
00016 {
00017 }
00018 
00019 void DefaultGLDFSGLGroupingWalker::walkGLStaticGroup(GLStaticGroup *G) const
00020 {
00021   nodeVisitingProxy->enter(G);
00022   
00023   MFNode children = G->getChildren();
00024   for (MFNode::iterator it = children.begin(); it != children.end(); ++it)
00025     if ((*it != 0) && (nodeVisitingProxy->walkOn(G, *it)))
00026       nodeWalkingProxy->walk(*it);
00027   
00028   nodeVisitingProxy->leave(G);
00029 }
00030 
00031 void DefaultGLDFSGLGroupingWalker::walkX3DGLGroupingNode(X3DGLGroupingNode *N) const
00032 {
00033   nodeVisitingProxy->enter(N);
00034   
00035   MFNode children = N->getChildren();
00036   for (MFNode::iterator it = children.begin(); it != children.end(); ++it)
00037     if ((*it != 0) && (nodeVisitingProxy->walkOn(N, *it)))
00038       nodeWalkingProxy->walk(*it);
00039   
00040   nodeVisitingProxy->leave(N);
00041 }

Generated on Wed May 14 10:03:08 2003 for X3DToolKit by doxygen1.3