00001 #ifndef X3DTK_MESH_FACESDRAWERSTATEVARIABLES_H
00002 #define X3DTK_MESH_FACESDRAWERSTATEVARIABLES_H
00003
00004 #include "MESH_SceneGraphTypes.h"
00005 #include "MESH_Mesh.h"
00006
00007 #include <list>
00008 #include <vector>
00009
00010 namespace X3DTK {
00011 namespace MESH {
00012
00013 typedef enum {REAL, IFS, CONNCOMS} FaceMode;
00014
00021 template<class MData, class VData, class EData, class FData, bool readOnly>
00022 class FacesDrawerStateVariables : public StateVariables
00023 {
00024 public:
00026 FacesDrawerStateVariables();
00027
00029 void init();
00031 void finish();
00032
00033
00034 void pushMatrix(const SFMatrix34f &transformation);
00035
00036 void popMatrix();
00037
00038
00039 int getCurrentMeshId();
00040
00041
00042 void storeMesh(Mesh<MData, VData, EData, FData, readOnly> *mesh);
00043
00044
00045 inline Mesh<MData, VData, EData, FData, readOnly> *getMesh(int i) const;
00046
00047 inline const SFMatrix34f &getMatrix(int i) const;
00048
00049
00050 inline void setSelectionMode(bool selectionMode);
00051 inline bool getSelectionMode() const;
00052
00054 void setRenderingMode(FaceMode mode);
00056 inline FaceMode getRenderingMode() const;
00057
00059 void setSelectedNodes(const MFNode &selectedNodes);
00061 MFNode getSelectedNodes() const;
00062
00063 private:
00064 std::list<SFMatrix34f> _matrixStack;
00065 std::vector<SFMatrix34f> _matrixVector;
00066 std::vector<Mesh<MData, VData, EData, FData, readOnly> *> _meshVector;
00067 bool _selectionMode;
00068 FaceMode _mode;
00069 MFNode _selectedNodes;
00070 };
00071
00072 }
00073 }
00074
00075 #include "MESH_FacesDrawerStateVariables.inl"
00076
00077 #endif