00001 #ifndef X3DTK_X3D_MESHBUILDERSTATEVARIABLES_H 00002 #define X3DTK_X3D_MESHBUILDERSTATEVARIABLES_H 00003 00004 #include "StateVariables.h" 00005 #include "Cloner.h" 00006 #include "X3D_X3DNode.h" 00007 #include "MESH_X3DNode.h" 00008 00009 #include <map> 00010 00011 namespace X3DTK { 00012 namespace X3D { 00013 00014 class X3DAppearanceNode; 00015 class Shape; 00016 00023 class MeshBuilderStateVariables : public StateVariables 00024 { 00025 public: 00027 MeshBuilderStateVariables(); 00029 virtual ~MeshBuilderStateVariables(); 00031 void init(); 00033 virtual void finish(); 00034 00036 void enableChildrenVisit(); 00038 void disableChildrenVisit(); 00039 00041 inline bool getChildrenVisit() const {return _childrenVisit;}; 00043 X3DNode *clone(X3DNode *N); 00044 00046 void addCoupleNode(SFNode N, MESH::SFNode MN); 00048 void pushNode(MESH::SFNode N); 00050 void popNode(); 00051 00053 inline MESH::SFNode getRoot() const {return _root;}; 00055 inline MESH::SFNode getTop() const {return _nodeStack.front();}; 00057 MESH::SFNode getNode(SFNode N) const; 00058 00059 private: 00060 MESH::SFNode _root; 00061 MESH::MFNode _nodeStack; 00062 std::map<SFNode, MESH::SFNode> _nodeCoupleMap; 00063 00064 bool _childrenVisit; 00065 Cloner *_cloner; 00066 }; 00067 00068 } 00069 } 00070 00071 #endif