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

MyMeshData.h

Go to the documentation of this file.
00001 #ifndef MYMESHDATA_H
00002 #define MYMESHDATA_H
00003 
00004 #include <X3DTK/MESH/scenegraph.h>
00005 #include <X3DTK/simplifiedmeshscene.h>
00006 
00007 namespace X3DTK {
00008 namespace MESH {
00009 
00010 // My vertex data structure containing the weight information.
00011 
00012 class VertexDistanceData
00013 {
00014 public:
00015   void setDistance(float distance);
00016   inline float getDistance() const {return _distance;};
00017   
00018 private:
00019   float _distance;  
00020 };
00021 
00022 // My Mesh data aggregates using recursive typelists.
00023 // Typedefs are useful to simplify template syntax.
00024 #ifdef TEMPLATE_SPECIALIZATION_SUPPORTED
00025 
00026 typedef clist<tlist<VertexPointData, tlist<VertexNormalData, tlist<VertexColorData, tlist<VertexDistanceData> > > > > MyVertexData;
00027 typedef clist<tlist<FaceNormalData, tlist<FaceColorData> > > MyFaceData;
00028 typedef clist<tlist<MeshNormalData, tlist<MeshColorData> > > MyMeshData;
00029 
00030 #else
00031 
00032 class MyVertexData : public VertexData, public VertexDistanceData {};
00033 class MyFaceData : public FaceData {};
00034 class MyMeshData : public MeshData {};
00035 
00036 #endif
00037 
00038 // My MESH entities.
00039 
00040 typedef TemplateMesh<MESH::MyMeshData, MESH::MyVertexData, MESH::EdgeData, MESH::MyFaceData, true> MyMesh;
00041 typedef TemplateVertex<MESH::MyMeshData, MESH::MyVertexData, MESH::EdgeData, MESH::MyFaceData, true> MyVertex;
00042 typedef SFTemplateVertex<MESH::MyMeshData, MESH::MyVertexData, MESH::EdgeData, MESH::MyFaceData, true> MySFVertex;
00043 typedef SFTemplateEdge<MESH::MyMeshData, MESH::MyVertexData, MESH::EdgeData, MESH::MyFaceData, true> MySFEdge;
00044 typedef SFTemplateFace<MESH::MyMeshData, MESH::MyVertexData, MESH::EdgeData, MESH::MyFaceData, true> MySFFace;
00045 
00046 // function computing the norm attribute of the vertices
00047 void computeVerticesDistance(MyMesh *M);
00048 
00049 }
00050 
00051 // My SimpleMeshScene
00052 
00053 typedef TemplateSimplifiedMeshScene<MESH::MyMeshData, MESH::MyVertexData, MESH::EdgeData, MESH::MyFaceData, true> MySimplifiedMeshScene;
00054 
00055 }
00056 
00057 #endif

Generated on Thu Jun 3 10:12:09 2004 for X3DToolKit by doxygen 1.3.6