00001 00002 // MESH_MeshFacesDrawer.h // 00004 00005 #ifndef MESH_FACESDRAWER_H 00006 #define MESH_FACESDRAWER_H 00007 00008 #include "MESH_MeshFacesDrawerStateVariables.h" 00009 00010 #include "X3DOnePassProcessor.h" 00011 #include "MESH_SceneGraphTypes.h" 00012 00013 namespace X3DTK { 00014 namespace MESH { 00015 00016 // Processor drawing the mesh from the Mesh scene graph. 00017 00018 class MeshFacesDrawer : public X3DOnePassProcessor 00019 { 00020 public: 00021 MeshFacesDrawer(); 00022 virtual ~MeshFacesDrawer(); 00023 00024 void changeOneColorPerMesh(); 00025 00026 void draw(X3DNode *N, bool selection = false); 00027 00028 // Get ith Mesh of the scene. 00029 inline Mesh *getMesh(int i) const {return stateVariables->getMesh(i);}; 00030 // Gets stored transformation matrix associated with a given Mesh. 00031 inline const SFMatrix34f &getMatrix(int i) const {return stateVariables->getMatrix(i);}; 00033 inline Mesh::SFFace *getFaceOfMesh(int i, int j) const {return (stateVariables->getMesh(j)->getFaces())[i];}; 00034 00035 protected: 00036 MeshFacesDrawerStateVariables* stateVariables; 00037 00038 /* // Draw methods. 00039 void drawVertex(const Mesh::SFVertex *vertex); 00040 void drawEdge(Mesh::SFEdge *edge);*/ 00041 }; 00042 00043 } 00044 } 00045 00046 #endif 00047