00001 #ifndef MESH_INFO_H 00002 #define MESH_INFO_H 00003 00004 #include <X3DTK/kernel.h> 00005 #include <X3DTK/MESH/scenegraph.h> 00006 #include <list> 00007 00008 namespace X3DTK { 00009 namespace MESH { 00010 00011 template<class MData, class VData, class EData, class FData, bool RW> 00012 class TemplateMeshInfo 00013 { 00014 public: 00016 TemplateMeshInfo(); 00018 ~TemplateMeshInfo(); 00019 00021 void init(); 00022 00024 void addFaces(unsigned int faces); 00026 void addEdges(unsigned int edges); 00028 void setInstances(unsigned int instances); 00029 00031 unsigned int getFaces() const; 00033 unsigned int getEdges() const; 00035 unsigned int getInstances() const; 00036 00037 private: 00038 unsigned int _nFaces; 00039 unsigned int _nEdges; 00040 unsigned int _nInstances; 00041 }; 00042 00043 template<class MData, class VData, class EData, class FData, bool RW> 00044 class TemplateVertexInfo 00045 { 00046 public: 00048 TemplateVertexInfo(); 00050 ~TemplateVertexInfo(); 00051 00053 void init(); 00054 00056 void addVertices(unsigned int vertices); 00058 void setInstances(unsigned int instances); 00059 00061 unsigned int getVertices() const; 00063 unsigned int getInstances() const; 00064 00065 private: 00066 unsigned int _nVertices; 00067 unsigned int _nInstances; 00068 }; 00069 00071 typedef TemplateMeshInfo<MeshData, VertexData, EdgeData, FaceData, true> MeshInfo; 00072 typedef std::list<std::pair<X3DNode *, TemplateMeshInfo<MeshData, VertexData, EdgeData, FaceData, true> > > MeshInfoList; 00073 00074 typedef TemplateVertexInfo<MeshData, VertexData, EdgeData, FaceData, true> VertexInfo; 00075 typedef std::list<std::pair<X3DNode *, TemplateVertexInfo<MeshData, VertexData, EdgeData, FaceData, true> > > VertexInfoList; 00076 00077 } 00078 } 00079 00080 #include "MESH_Info.inl" 00081 00082 #endif