/// 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_VERTEX_H #define X3DTK_MESH_VERTEX_H #include "MESH_X3DVertexNode.h" #include "MESH_SFVertex.h" #include "MESH_SFDirectEdge.h" #include "MESH_SFIndirectEdge.h" #include "MESH_MeshData.h" namespace X3DTK { namespace MESH { template class MeshMFTemplateVertex; template class MeshMFTemplateEdge; template class MeshMFTemplateFace; /*! \brief Template class declared in defining a vertex set, * close to the implementation of X3D::Coordinate for the MESH scene graph. * * \ingroup MeshSceneGraph */ template class TemplateVertex : public X3DVertexNode { friend class TemplateMesh; public: typedef MeshMFTemplateVertex MFVertex; typedef MeshMFTemplateEdge MFEdge; typedef MeshMFTemplateFace MFFace; /// Constructor. TemplateVertex(); /// Virtual destructor. virtual ~TemplateVertex(); /// Creates a new vertex. SFTemplateVertex *createVertex(); /// Creates a new vertex at the position i. SFTemplateVertex *createVertex(unsigned int i); /// Removes vertex. bool removeVertex(SFTemplateVertex *vertex); /// Get the edge from - to. static SFTemplateEdge *getEdge(SFTemplateVertex *from, SFTemplateVertex *to); /// Gets the vertices. inline const MFVertex &getVertices() const; /// Gets the edges. inline const MFEdge &getEdges() const; private: MFVertex _vertices; MFEdge _edges; /// Creates a new edge. SFTemplateEdge *createEdge(SFTemplateVertex *from, SFTemplateVertex *to); /// Removes the edge. void removeEdge(SFTemplateEdge *edge); }; /// Vertex for the default X3DNode nodes containing all the geometry and topology /// informations of an X3D scene. typedef TemplateVertex Vertex; } } #include "MESH_Vertex.inl" #endif