* ** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ** *

* Contact information: cgogn@unistra.fr ** ********************************************************************************/#ifndef __MAP3_H__#define __MAP3_H__#include "Topology/map/map2.h"namespaceCGoGN{/*! \brief The class of dual 3-dimensional combinatorial maps: * set of oriented volumes pairwise sewed by an adjacency relation. * A dual 3-map represents close or open oriented 3-manifolds (volume subdivisions). * - A dual 3-map is made of darts linked by the phi1 permutation * and/or the phi2 and phi3 one-to-one relation. * - In this class darts are interpreted as oriented edges. * - The phi1 relation defines oriented faces (see tMap1) * and faces may have arbitrary size (degenerated faces are accepted). * - The phi2 relation links oriented faces along oriented edges building * oriented surfaces. A close oriented surface define an oriented volume. * - Volume are linked along whole faces with the phi3 relation * - Faces that have no phi3-link are border faces. If there exists * such edges the maps is open. * - When every face is phi3-linked, the map is close. In this case * some optimizations are enable that speed up the processing of cells. * @param DART the type of dart used in the class */classMap3:publicMap2{protected:

*/virtualDartdeleteEdge(Dartd);//! Collapse an edge (that is deleted) possibly merging its vertices/*! \warning This may produce two distinct vertices if the edge * was the only link between two border faces * @param d a dart in the deleted edge * @return a dart of the resulting vertex */virtualDartcollapseEdge(Dartd,booldelDegenerateVolumes=true);

//! Delete a face if and only if it has one or two edges/*! If the face is sewed to two distinct adjacent faces, * then those two faces are sewed * @param d a dart of the face * @return true if the collapse has been executed, false otherwise */

//! Split a face inserting an edge between two vertices/*! \pre Dart d and e should belong to the same face and be distinct * @param d dart of first vertex * @param e dart of second vertex */virtualvoidsplitFace(Dartd,Darte);

//! Merge the two faces incident to the edge of d./*! Works only for edges of degree 2. * \warning Darts of the edge of d no longer exist after the call * @param d a dart in the first face * @return true if the merge has been executed, false otherwise */virtualboolmergeFaces(Dartd);

//! Delete a volume if and only if it has a face with degree < 3 or only 3 vertices/*! If the volume is sewed to two distinct adjacent volumes and if the face degree * of the two adjacent volumes is equal then those two volumes are sewed * @param d a dart of the face * @return true if the collapse has been executed, false otherwise */

//! Apply a functor on each dart of a vertex/*! @param d a dart of the vertex * @param fonct the functor */boolforeach_dart_of_vertex2(Dartd,FunctorType&f,unsignedintthread=0);//! Apply a functor on each dart of an edge/*! @param d a dart of the oriented edge * @param fonct the functor */boolforeach_dart_of_edge2(Dartd,FunctorType&f,unsignedintthread=0);//! Apply a functor on each dart of an oriented face/*! @param d a dart of the oriented face * @param fonct the functor */boolforeach_dart_of_face2(Dartd,FunctorType&f,unsignedintthread=0);

//! Close a topological hole (a sequence of connected fixed point of phi3). DO NOT USE, only for import/creation algorithm/*! \pre dart d MUST be fixed point of phi3 relation * Add a volume to the map that closes the hole. * @param d a dart of the hole (with phi3(d)==d) * @param forboundary tag the created face as boundary (default is true) * @return the degree of the created volume */virtualunsignedintcloseHole(Dartd,boolforboundary=true);//! Close the map removing topological holes: DO NOT USE, only for import/creation algorithm/*! Add volumes to the map that close every existing hole. * These faces are marked as boundary.