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

DefaultDFSShapeWalker.cpp

Go to the documentation of this file.
00001 #include "DefaultDFSShapeWalker.h"
00002 #include "NodeWalkingProxy.h"
00003 #include "NodeVisitingProxy.h"
00004 #include "ShapeNodes.h"
00005 
00006 using namespace X3DTK;
00007 
00008 DefaultDFSShapeWalker::DefaultDFSShapeWalker()
00009 : DFSShapeWalker()
00010 {
00011   defineNewWalkingFunction<DefaultDFSShapeWalker, X3DShapeNode>(&DefaultDFSShapeWalker::walkX3DShapeNode);  
00012   defineNewWalkingFunction<DefaultDFSShapeWalker, Appearance>(&DefaultDFSShapeWalker::walkAppearance);  
00013 }
00014 
00015 DefaultDFSShapeWalker::~DefaultDFSShapeWalker()
00016 {
00017 }
00018 
00019 void DefaultDFSShapeWalker::walkX3DShapeNode(X3DShapeNode *N) const
00020 {
00021   nodeVisitingProxy->enter(N);
00022   
00023   SFNode C;
00024   C = N->getAppearance();
00025   if ((C != 0) && (nodeVisitingProxy->walkOn(N, C)))
00026     nodeWalkingProxy->walk(C);
00027   
00028   C = N->getGeometry();
00029   if ((C != 0) && (nodeVisitingProxy->walkOn(N, C)))
00030     nodeWalkingProxy->walk(C);
00031     
00032   nodeVisitingProxy->leave(N);
00033 }
00034 
00035 void DefaultDFSShapeWalker::walkAppearance(Appearance *A) const
00036 {
00037   nodeVisitingProxy->enter(A);
00038   
00039   SFNode C;
00040   C = A->getMaterial();
00041   if ((C != 0) && (nodeVisitingProxy->walkOn(A, C)))
00042     nodeWalkingProxy->walk(C);
00043     
00044   C = A->getTexture();
00045   if ((C != 0) && (nodeVisitingProxy->walkOn(A, C)))
00046     nodeWalkingProxy->walk(C);
00047 
00048   C = A->getTextureTransform();
00049   if ((C != 0) && (nodeVisitingProxy->walkOn(A, C)))
00050     nodeWalkingProxy->walk(C);
00051 
00052   C = A->getLineProperties();
00053   if ((C != 0) && (nodeVisitingProxy->walkOn(A, C)))
00054     nodeWalkingProxy->walk(C);
00055 
00056   C = A->getFillProperties();
00057   if ((C != 0) && (nodeVisitingProxy->walkOn(A, C)))
00058     nodeWalkingProxy->walk(C);
00059     
00060   nodeVisitingProxy->leave(A);
00061 }

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