00001 #ifndef X3DTK_MESH_SFEDGECONTENT_H 00002 #define X3DTK_MESH_SFEDGECONTENT_H 00003 00004 #include <vector> 00005 #include <algorithm> 00006 00007 namespace X3DTK { 00008 namespace MESH { 00009 00010 template<class MData, class VData, class EData, class FData, bool RW> class TemplateMesh; 00011 template<class MData, class VData, class EData, class FData, bool RW> class TemplateVertex; 00012 template<class MData, class VData, class EData, class FData, bool RW> class SFTemplateVertex; 00013 template<class MData, class VData, class EData, class FData, bool RW> class SFTemplateFace; 00014 template<class MData, class VData, class EData, class FData, bool RW> class EntityMFTemplateFace; 00015 template<class MData, class VData, class EData, class FData, bool RW> class SFTemplateDirectEdge; 00016 template<class MData, class VData, class EData, class FData, bool RW> class SFTemplateIndirectEdge; 00017 00024 template<class MData, class VData, class EData, class FData, bool RW = true> 00025 class SFTemplateEdgeContent 00026 { 00027 friend class TemplateVertex<MData, VData, EData, FData, RW>; 00028 friend class SFTemplateEdge<MData, VData, EData, FData, RW>; 00029 friend class SFTemplateDirectEdge<MData, VData, EData, FData, RW>; 00030 friend class SFTemplateIndirectEdge<MData, VData, EData, FData, RW>; 00031 public: 00032 typedef EntityMFTemplateFace<MData, VData, EData, FData, RW> MFFace; 00033 00035 inline SFTemplateVertex<MData, VData, EData, FData, RW> *getFromVertex() const; 00037 inline SFTemplateVertex<MData, VData, EData, FData, RW> *getToVertex() const; 00039 inline const MFFace &get1Faces() const; 00041 inline const MFFace &get2Faces() const; 00043 inline bool isBoundary() const; 00045 inline bool isNonManifold() const; 00047 inline EData &data(); 00049 inline const EData &data() const; 00050 00051 private: 00052 SFTemplateVertex<MData, VData, EData, FData, RW> *const _from; 00053 SFTemplateVertex<MData, VData, EData, FData, RW> *const _to; 00054 MFFace _r1Faces; 00055 MFFace _r2Faces; 00056 EData _data; 00057 00059 SFTemplateEdgeContent(SFTemplateVertex<MData, VData, EData, FData, RW> * from, SFTemplateVertex<MData, VData, EData, FData, RW> *const to); 00061 ~SFTemplateEdgeContent(); 00062 00064 void add1Face(SFTemplateFace<MData, VData, EData, FData, RW> *face); 00066 void add2Face(SFTemplateFace<MData, VData, EData, FData, RW> *face); 00067 00069 void remove1Face(SFTemplateFace<MData, VData, EData, FData, RW> *face); 00071 void remove2Face(SFTemplateFace<MData, VData, EData, FData, RW> *face); 00072 00074 void reverse(SFTemplateFace<MData, VData, EData, FData, RW> *face); 00075 }; 00076 00077 } 00078 } 00079 00080 #include "MESH_SFEdgeContent.inl" 00081 00082 #endif