/// 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_SFVERTEX_H #define X3DTK_MESH_SFVERTEX_H #include "MESH_BaseSFVertex.h" #include "TypeList.h" #include namespace X3DTK { namespace MESH { template class TemplateMesh; template class TemplateVertex; template class SFTemplateEdge; template class SFTemplateFace; template class EntityMFTemplateEdge; template class EntityMFTemplateFace; /*! \brief Template class declared in * providing a vertex structure for the Mesh class. * * \ingroup MeshSceneGraph */ template class SFTemplateVertex : public BaseSFVertex { friend class TemplateVertex; friend class TemplateMesh; public: typedef EntityMFTemplateFace MFFace; typedef EntityMFTemplateEdge MFEdge; /// Gets the rounding edges. inline const MFEdge &getEdges() const; /// Gets the rounding faces. inline const MFFace &getFaces() const; /// Gets the data. inline VData &data(); /// Gets the data. inline const VData &data() const; /// Returns true if is an isolated vertex. inline bool isIsolated() const; #ifdef TEMPLATE_SPECIALIZATION_SUPPORTED /// Gets the data F from VData which must be of type clist >. template F &getData(); /// Gets optionally the data F from VData which must be of type clist >. template F &ogetData(); #endif private: MFEdge _edges; MFFace _faces; VData _data; /// Constructor. SFTemplateVertex(unsigned int i); /// Destructor. ~SFTemplateVertex(); /// Adds an edge. void addEdge(SFTemplateEdge *edge); /// Adds a face. void addFace(SFTemplateFace *face); /// Removes an edge. void removeEdge(SFTemplateEdge *edge); /// Adds a face. void removeFace(SFTemplateFace *face); }; /// operator<< overloaded for SFEdge class. template std::ostream& operator<<(std::ostream& o, const SFTemplateVertex &v); } } #include "MESH_SFVertex.inl" #endif