MESH_EdgesDrawerStateVariables.h

Go to the documentation of this file.
00001 #ifndef X3DTK_MESH_EDGESDRAWERSTATEVARIABLES_H
00002 #define X3DTK_MESH_EDGESDRAWERSTATEVARIABLES_H
00003 
00004 #include "MESH_Transform.h"
00005 #include "MESH_SceneGraphTypes.h"
00006 
00007 #include <list>
00008 #include <vector>
00009 
00010 namespace X3DTK {
00011 namespace MESH {
00012 
00019 template<class MData, class VData, class EData, class FData, bool RW>
00020 class TemplateEdgesDrawerStateVariables : public StateVariables
00021 {
00022 public:
00023   // Constructor.
00024   TemplateEdgesDrawerStateVariables();
00025 
00026   // Initializes the traversal.
00027   void init();
00028   // Finishes the traversal.
00029   void finish();
00030 
00031   // Pushes the transformation node.
00032   void pushTransform(const SFMatrix34f &matrix);
00034   SFMatrix34f getCurrentTransform();
00035   // Pops the transformation node.
00036   void popTransform();
00037 
00038   // Adds the couple of nodes that have been met.
00039   void addCouple(X3DNode *N, const SFMatrix34f &matrix);
00040   // Returns TRUE if the couple of nodes have already been met.
00041   bool getCouple(X3DNode *N, const SFMatrix34f &matrix) const;
00042   
00043   // Saves current matrix state and returns index in saved vector.
00044   // Call storeMesh() before calling ths function
00045   int getCurrentMeshId();
00046   // Saves mesh and associated current matrix.
00047   void storeVertex(TemplateVertex<MData, VData, EData, FData, RW> *vertex);
00048   
00049   // Get ith Vertex of the model.
00050   inline TemplateVertex<MData, VData, EData, FData, RW> *getVertex(int i) const;
00051   // Gets stored transformation matrix associated with a given Mesh.
00052   inline const SFMatrix34f &getMatrix(int i) const;
00053 
00054   // Whether or not primitive IDs are pushed.
00055   inline void setSelectionMode(bool selectionMode);
00056   inline bool getSelectionMode() const;
00057     
00058 private: 
00059   std::list<SFMatrix34f> _matrixStack;
00060   std::vector<SFMatrix34f> _matrixVector;
00061   std::list<std::pair<X3DNode *, SFMatrix34f> > _coupleList;
00062   std::vector<TemplateVertex<MData, VData, EData, FData, RW> *> _vertexVector;
00063   bool _selectionMode;
00064 };
00065 
00066 }
00067 }
00068 
00069 #include "MESH_EdgesDrawerStateVariables.inl"
00070 
00071 #endif

Generated on Fri Jul 30 12:02:28 2004 for X3DToolKit by doxygen 1.3.6