/// 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_SFFACE_H #define X3DTK_MESH_SFFACE_H #include "MESH_SceneGraphTypes.h" #include "MESH_BaseSFFace.h" #include #include namespace X3DTK { namespace MESH { template class TemplateMesh; template class SFTemplateEdge; template class EntityMFTemplateEdge; /*! \brief Template class declared in * providing a face structure for the Mesh class. * * \ingroup MeshSceneGraph */ template class SFTemplateFace : public BaseSFFace { friend class TemplateMesh; public: typedef EntityMFTemplateEdge MFEdge; typedef EntityMFTemplateVertex MFVertex; /// Gets the edges of the face. The order is given b the order of definition of the face. inline const MFEdge &getEdges() const; /// Gets the vertices of the face. This method is not efficient, because SFTemplateFace /// has not a vertices attribute, meaning that the method cannot return a reference. So /// a copy constructor is called. Prefer getting the edges and getting the from vertex /// of each edge. MFVertex getVertices() const; /// Gets the data. inline FData &data(); /// Gets the data. inline const FData &data() const; /// Reverses the face. void reverse(); /// Returns the mesh of which belongs the face. inline TemplateMesh *getMesh() const {return _mesh;}; #ifdef TEMPLATE_SPECIALIZATION_SUPPORTED /// Gets the data F from FData which must be of type clist >. template F &getData(); /// Gets optionally the data F from FData which must be of type clist >. template F &ogetData(); #endif private: MFEdge _edges; FData _data; TemplateMesh *_mesh; /// Constructor. SFTemplateFace(unsigned int i); /// Destructor. ~SFTemplateFace(); /// Adds an edge. void addEdge(SFTemplateEdge *edge); }; /// operator<< overloaded for SFFace class. template std::ostream& operator<<(std::ostream& o, const SFTemplateFace &f); } } #include "MESH_SFFace.inl" #endif