Main Page | Modules | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

MESH_FacesDrawerStateVariables.h

Go to the documentation of this file.
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   // Pushes the transformation matrix.
00034   void pushMatrix(const SFMatrix34f &transformation);
00035   // Pops the transformation matrix.
00036   void popMatrix();
00037   // Saves current matrix state and returns index in saved vector.
00038   // Call storeMesh() before calling ths function
00039   int getCurrentMeshId();
00040   
00041   // Saves mesh and associated current matrix.
00042   void storeMesh(Mesh<MData, VData, EData, FData, readOnly> *mesh);
00043   
00044   // Get i Mesh of the model.
00045   inline Mesh<MData, VData, EData, FData, readOnly> *getMesh(int i) const;
00046   // Gets stored transformation matrix associated with a given Mesh.
00047   inline const SFMatrix34f &getMatrix(int i) const;
00048 
00049   // Whether or not primitive IDs are pushed.
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

Generated on Wed Apr 7 12:15:20 2004 for X3DToolKit by doxygen 1.3.3