00001 #ifndef MESH_DRAWER_GLOBALVARIABLES_H 00002 #define MESH_DRAWER_GLOBALVARIABLES_H 00003 00004 #include <X3DTK/MESH/scenegraph.h> 00005 00006 #include <list> 00007 #include <vector> 00008 00009 namespace X3DTK { 00010 namespace MESH { 00011 00012 // State variables for the MESH::Drawer processor. 00013 00014 class DrawerStateVariables : public StateVariables 00015 { 00016 public: 00017 DrawerStateVariables(); 00018 00019 void initTraversal(); 00020 void finishTraversal(); 00021 00022 void pushMatrix(const SFMatrix34f &transformation); 00023 void popMatrix(); 00024 00025 int getCurrentMeshId(); 00026 void storeMesh(Mesh *mesh); 00027 00028 inline const Mesh *getMesh(int i) const {return _meshVector[i];}; 00029 inline SFMatrix34f getMatrix(int i) const {return _matrixVector[i];}; 00030 00031 inline void setSelectionMode(bool selectionMode) {_selectionMode = selectionMode;}; 00032 inline bool getSelectionMode() const {return _selectionMode;}; 00033 00034 void setPrimitiveType(int primitiveType) {_primitiveType = primitiveType;}; 00035 inline int getPrimitiveType() const {return _primitiveType;}; 00036 00037 void changeOneColorPerMesh() {_oneColorPerMesh = !_oneColorPerMesh;}; 00038 inline bool getOneColorPerMesh() const {return _oneColorPerMesh;}; 00039 00040 private: 00041 std::list<SFMatrix34f> _matrixStack; 00042 std::vector<SFMatrix34f> _matrixVector; 00043 std::vector<Mesh *> _meshVector; 00044 bool _selectionMode; 00045 bool _oneColorPerMesh; 00046 int _primitiveType; 00047 }; 00048 00049 } 00050 } 00051 00052 #endif