/// This file is part of the X3DToolKit library /// Copyright (C) 2002-2004 Yannick Le Goc (legoc@imag.fr) /// http://artis.imag.fr/Members/Yannick.Legoc/X3D/ /// This library is free software; you can redistribute it and/or /// modify it under the terms of the GNU Lesser General Public /// License as published by the Free Software Foundation; either /// version 2.1 of the License, or (at your option) any later version. /// This library is distributed in the hope that it will be useful, /// but WITHOUT ANY WARRANTY; without even the implied warranty of /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU /// Lesser General Public License for more details. /// You should have received a copy of the GNU Lesser General Public /// License along with this library; if not, write to the Free Software /// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef X3DTK_MESH_SFEDGECONTENT_H #define X3DTK_MESH_SFEDGECONTENT_H #include #include namespace X3DTK { namespace MESH { template class TemplateMesh; template class TemplateVertex; template class SFTemplateVertex; template class SFTemplateFace; template class EntityMFTemplateFace; template class SFTemplateDirectEdge; template class SFTemplateIndirectEdge; /*! \brief Template class declared in * providing the shared content of an SFEdge structure. * * \ingroup MeshSceneGraph */ template class SFTemplateEdgeContent { friend class TemplateVertex; friend class SFTemplateEdge; friend class SFTemplateDirectEdge; friend class SFTemplateIndirectEdge; public: typedef EntityMFTemplateFace MFFace; /// Gets the Vertex from. inline SFTemplateVertex *getFromVertex() const; /// Gets the Vertex to. inline SFTemplateVertex *getToVertex() const; /// Gets the 1-faces. inline const MFFace &get1Faces() const; /// Gets the 2-faces. inline const MFFace &get2Faces() const; /// Returns true if is a boundary. inline bool isBoundary() const; /// Returns true if is non-manifold. inline bool isNonManifold() const; /// Gets the data. inline EData &data(); /// Gets the data. inline const EData &data() const; private: SFTemplateVertex *const _from; SFTemplateVertex *const _to; MFFace _r1Faces; MFFace _r2Faces; EData _data; /// Constructor. SFTemplateEdgeContent(SFTemplateVertex * from, SFTemplateVertex *const to); /// Destructor. ~SFTemplateEdgeContent(); /// Adds a 1-face. void add1Face(SFTemplateFace *face); /// Adds a 2-face. void add2Face(SFTemplateFace *face); /// Removes a 1-face. void remove1Face(SFTemplateFace *face); /// Removes a 2-face. void remove2Face(SFTemplateFace *face); /// Reverses the face, ie if face is a 1-face, it becomes a 2-face. void reverse(SFTemplateFace *face); }; } } #include "MESH_SFEdgeContent.inl" #endif