00001 #ifndef X3DTK_MESH_VERTEX_H 00002 #define X3DTK_MESH_VERTEX_H 00003 00004 #include "MESH_X3DVertexNode.h" 00005 #include "MESH_SFVertex.h" 00006 #include "MESH_SFDirectEdge.h" 00007 #include "MESH_SFIndirectEdge.h" 00008 #include "MESH_MeshData.h" 00009 00010 namespace X3DTK { 00011 namespace MESH { 00012 00013 template<class MData, class VData, class EData, class FData, bool RW> class MeshMFTemplateVertex; 00014 template<class MData, class VData, class EData, class FData, bool RW> class MeshMFTemplateEdge; 00015 template<class MData, class VData, class EData, class FData, bool RW> class MeshMFTemplateFace; 00016 00023 template<class MData, class VData, class EData, class FData, bool RW> 00024 class TemplateVertex : public X3DVertexNode 00025 { 00026 friend class TemplateMesh<MData, VData, EData, FData, RW>; 00027 public: 00028 typedef MeshMFTemplateVertex<MData, VData, EData, FData, RW> MFVertex; 00029 typedef MeshMFTemplateEdge<MData, VData, EData, FData, RW> MFEdge; 00030 typedef MeshMFTemplateFace<MData, VData, EData, FData, RW> MFFace; 00031 00033 TemplateVertex(); 00035 virtual ~TemplateVertex(); 00036 00038 SFTemplateVertex<MData, VData, EData, FData, RW> *createVertex(); 00040 SFTemplateVertex<MData, VData, EData, FData, RW> *createVertex(unsigned int i); 00041 00043 bool removeVertex(SFTemplateVertex<MData, VData, EData, FData, RW> *vertex); 00044 00046 static SFTemplateEdge<MData, VData, EData, FData, RW> *getEdge(SFTemplateVertex<MData, VData, EData, FData, RW> *from, SFTemplateVertex<MData, VData, EData, FData, RW> *to); 00048 inline const MFVertex &getVertices() const; 00050 inline const MFEdge &getEdges() const; 00051 00052 private: 00053 MFVertex _vertices; 00054 MFEdge _edges; 00055 00057 SFTemplateEdge<MData, VData, EData, FData, RW> *createEdge(SFTemplateVertex<MData, VData, EData, FData, RW> *from, SFTemplateVertex<MData, VData, EData, FData, RW> *to); 00059 void removeEdge(SFTemplateEdge<MData, VData, EData, FData, RW> *edge); 00060 00061 }; 00062 00065 typedef TemplateVertex<MeshData, VertexData, EdgeData, FaceData, true> Vertex; 00066 00067 } 00068 } 00069 00070 #include "MESH_Vertex.inl" 00071 00072 #endif