map3.h 16.9 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1 2 3
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps  *
* version 0.1                                                                  *
4
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg           *
Pierre Kraemer's avatar
Pierre Kraemer committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
*                                                                              *
* 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.           *
*                                                                              *
20
* Web site: http://cgogn.unistra.fr/                                           *
Pierre Kraemer's avatar
Pierre Kraemer committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/

#ifndef __MAP3_H__
#define __MAP3_H__

#include "Topology/map/map2.h"

namespace CGoGN
{

/*! \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
 */
Pierre Kraemer's avatar
Pierre Kraemer committed
50 51
template <typename MAP_IMPL>
class Map3 : public Map2<MAP_IMPL>
Pierre Kraemer's avatar
Pierre Kraemer committed
52 53
{
protected:
54 55 56
	// protected copy constructor to prevent the copy of map
	Map3(const Map3<MAP_IMPL>& m):Map2<MAP_IMPL>(m) {}

57 58
	void init() ;

Pierre Kraemer's avatar
Pierre Kraemer committed
59
public:
Pierre Kraemer's avatar
Pierre Kraemer committed
60 61
	typedef MAP_IMPL IMPL;
	typedef Map2<MAP_IMPL> ParentMap;
Pierre Kraemer's avatar
Pierre Kraemer committed
62

Pierre Kraemer's avatar
Pierre Kraemer committed
63
	inline static unsigned int ORBIT_IN_PARENT(unsigned int o){ return o+7; }
64 65
	inline static unsigned int ORBIT_IN_PARENT2(unsigned int o) { return o+5; }

Pierre Kraemer's avatar
Pierre Kraemer committed
66 67 68
	static const unsigned int IN_PARENT = 7 ;
	static const unsigned int IN_PARENT2 = 5 ;

69 70 71 72 73 74 75
	static const unsigned int VERTEX_OF_PARENT = VERTEX+7;
	static const unsigned int EDGE_OF_PARENT = EDGE+7;
	static const unsigned int FACE_OF_PARENT = FACE+7;

	static const unsigned int VERTEX_OF_PARENT2 = VERTEX+5;
	static const unsigned int EDGE_OF_PARENT2 = EDGE+5;

76 77
	static const unsigned int DIMENSION = 3 ;

Pierre Kraemer's avatar
Pierre Kraemer committed
78 79
	Map3();

80
	virtual std::string mapTypeName() const;
Pierre Kraemer's avatar
Pierre Kraemer committed
81

82
	virtual unsigned int dimension() const;
Pierre Kraemer's avatar
Pierre Kraemer committed
83

84 85
	virtual void clear(bool removeAttrib);

Pierre Kraemer's avatar
Pierre Kraemer committed
86 87
	virtual unsigned int getNbInvolutions() const;
	virtual unsigned int getNbPermutations() const;
Sylvain Thery's avatar
Sylvain Thery committed
88

Pierre Kraemer's avatar
Pierre Kraemer committed
89 90 91 92
	/*! @name Basic Topological Operators
	 * Access and Modification
	 *************************************************************************/

Sylvain Thery's avatar
Sylvain Thery committed
93
	Dart phi3(Dart d) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
94 95

	template <int N>
Sylvain Thery's avatar
Sylvain Thery committed
96
	Dart phi(Dart d) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
97

Sylvain Thery's avatar
Sylvain Thery committed
98
	Dart alpha0(Dart d) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
99

Sylvain Thery's avatar
Sylvain Thery committed
100
	Dart alpha1(Dart d) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
101

Sylvain Thery's avatar
Sylvain Thery committed
102
	Dart alpha2(Dart d) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
103

Sylvain Thery's avatar
Sylvain Thery committed
104
	Dart alpha_2(Dart d) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
105 106 107

protected:
	//! Link dart d with dart e by an involution
108
	/*! @param d,e the darts to link
Pierre Kraemer's avatar
Pierre Kraemer committed
109 110 111 112 113 114
	 *	- Before:	d->d and e->e
	 *	- After:	d->e and e->d
	 */
	void phi3sew(Dart d, Dart e);

	//! Unlink the current dart by an involution
115
	/*! @param d the dart to unlink
Pierre Kraemer's avatar
Pierre Kraemer committed
116 117 118 119 120
	 * - Before:	d->e and e->d
	 * - After:		d->d and e->e
	 */
	void phi3unsew(Dart d);

121
public:
Pierre Kraemer's avatar
Pierre Kraemer committed
122 123 124 125 126
	/*! @name Generator and Deletor
	 *  To generate or delete volumes in a 3-map
	 *************************************************************************/

	//@{
127 128 129
	//! Delete a volume erasing all its darts.
	/*! The phi3-links around the volume are removed
	 *  @param d a dart of the volume
Pierre Kraemer's avatar
Pierre Kraemer committed
130
	 */
131
	virtual void deleteVolume(Dart d, bool withBoundary = true);
untereiner's avatar
untereiner committed
132 133 134 135 136 137

	//! Fill a hole with a volume
	/*! \pre Dart d is boundary marked
	 *  @param d a dart of the volume to fill
	 */
	virtual void fillHole(Dart d) ;
138 139 140 141 142 143

	//! Open the mesh Transforming a face in a hole
	/*! \pre Dart d is NOT boundary marked
	 *  @param d a dart of the face filled
	 */
	virtual void createHole(Dart d) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
144 145 146 147 148 149 150
	//@}

	/*! @name Topological Operators
	 *  Topological operations on 3-maps
	 *************************************************************************/

	//@{
Lionel Untereiner's avatar
Lionel Untereiner committed
151
	//! Split the vertex along a permutation of faces
152 153 154
	/*! \per Darts d & e MUST belong to the same vertex
	 * 	\per Darts d & e MUST belong to different volumes
	 *  \per Works only on the boundary
Lionel Untereiner's avatar
Lionel Untereiner committed
155
	 *  @param vd a vector of darts
156
	 */
untereiner's avatar
untereiner committed
157
	virtual Dart splitVertex(std::vector<Dart>& vd);
158

159
	virtual void splitVertex(Dart /*d*/, Dart /*e*/) { assert("use splitVertex(d,e) only in dimension 2");}
160

161
	//! Delete the vertex of d
162
	/*! All the volumes around the vertex are merged into one volume
163
	 *  @param d a dart of the vertex to delete
164
	 *  @return a Dart of the resulting volume
Pierre Kraemer's avatar
Pierre Kraemer committed
165
	 */
166
	virtual Dart deleteVertex(Dart d);
Pierre Kraemer's avatar
Pierre Kraemer committed
167

Pierre Kraemer's avatar
Pierre Kraemer committed
168
	//! Cut the edge of d (all darts around edge orbit are cut)
169
	/*! @param d a dart of the edge to cut
Pierre Kraemer's avatar
Pierre Kraemer committed
170
	 *  @return a dart of the new vertex
Pierre Kraemer's avatar
Pierre Kraemer committed
171
	 */
David Cazier's avatar
David Cazier committed
172
	virtual Dart cutEdge(Dart d);
Pierre Kraemer's avatar
Pierre Kraemer committed
173

Pierre Kraemer's avatar
Pierre Kraemer committed
174
	//! Uncut the edge of d (all darts around edge orbit are uncut)
175
	/*! @param d a dart of the edge to uncut
Pierre Kraemer's avatar
Pierre Kraemer committed
176
	 */
177
	virtual bool uncutEdge(Dart d);
Pierre Kraemer's avatar
Pierre Kraemer committed
178

179 180 181 182 183
	/**
	 * Precondition for deleting edge
	 */
	bool deleteEdgePreCond(Dart d);

184 185 186 187
	//! Delete the edge of d
	/*! All the volumes around the edge are merged into one volume
	 *  @param d a dart of the edge to delete
	 *  @return a Dart of the resulting volume
untereiner's avatar
untereiner committed
188 189 190 191 192 193 194 195 196 197 198
	 */
	virtual Dart deleteEdge(Dart d);

	//! 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
	 */
	virtual Dart collapseEdge(Dart d, bool delDegenerateVolumes = true);

199 200 201 202 203 204
	//! 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
	 */
205 206 207 208 209 210 211 212
//	virtual bool collapseDegeneratedFace(Dart d);

	//! Split Face Pre-condition
	/*!
	 *  @param d dart of first vertex
	 *  @param e dart of second vertex
	 */
	bool splitFacePreCond(Dart d, Dart e);
213

Pierre Kraemer's avatar
Pierre Kraemer committed
214 215 216 217 218 219 220
	//! 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
	 */
	virtual void splitFace(Dart d, Dart e);

Thomas's avatar
Thomas committed
221 222 223 224 225 226 227 228
	//! 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
	 */
	virtual bool mergeFaces(Dart d);

229 230 231 232 233 234 235
	//! Collapse a face (that is deleted) possibly merging its vertices
	/*! \warning
	 *  @param d a dart in the deleted face
	 *  @return a dart of the resulting vertex
	 */
	virtual Dart collapseFace(Dart d, bool delDegenerateVolumes = true);

236 237 238 239 240 241
	//! 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
	 */
242
	bool collapseDegeneretedVolume(Dart d);
243

244 245 246
	//!! sewVolumes Pre-condition
	bool sewVolumesPreCond(Dart d, Dart e);

247
	//! Sew two oriented volumes along their faces. 
Pierre Kraemer's avatar
Pierre Kraemer committed
248
	/*! The oriented faces should not be phi3-linked and have the same degree
249 250
	 *  @param d a dart of the first volume
	 *  @param e a dart of the second volume
251
	 *  @param withBoundary: if false, volumes must have phi3 fixed points (only for construction: import/primitives)
Pierre Kraemer's avatar
Pierre Kraemer committed
252
	 */
253
	virtual void sewVolumes(Dart d, Dart e, bool withBoundary = true);
Pierre Kraemer's avatar
Pierre Kraemer committed
254

255 256 257
	//! Unsew volumes pre-condition
	bool unsewVolumesPreCond(Dart d);

258 259
	//! Unsew two oriented volumes along their faces.
	/*! @param d a dart of one volume
Pierre Kraemer's avatar
Pierre Kraemer committed
260
	 */
261
	virtual void unsewVolumes(Dart d, bool withBoundary = true);
Pierre Kraemer's avatar
Pierre Kraemer committed
262

263
	//! Merge two volumes along their common oriented face
264
	/*! @param d a dart of common face
Pierre Kraemer's avatar
Pierre Kraemer committed
265
	 */
266
	virtual bool mergeVolumes(Dart d, bool deleteFace = true);
Pierre Kraemer's avatar
Pierre Kraemer committed
267

268
	virtual bool mergeVolumes(Dart /*d*/, Dart /*e*/) { assert("use mergeVolumes(d,e) only in dimension 2");return false;}
269

untereiner's avatar
untereiner committed
270 271 272 273
	//! Split a volume into two volumes along a edge path
	/*! @param vd a vector of darts
	 */
	virtual void splitVolume(std::vector<Dart>& vd);
274

275 276 277
	//! Split a volume into two volumes along a edge path and add the given face between
	virtual void splitVolumeWithFace(std::vector<Dart>& vd, Dart d);

278 279 280 281 282 283
	//! Collapse a volume (that is deleted) possibly merging its vertices
	/*! \warning
	 *  @param d a dart in the deleted volume
	 *  @return a dart of the resulting vertex
	 */
	virtual Dart collapseVolume(Dart d, bool delDegenerateVolumes = true);
284
	//@}
Pierre Kraemer's avatar
Pierre Kraemer committed
285

286 287 288
    //BROUILLON
    Dart faceToEdge(Dart d);

289 290 291 292 293 294 295 296 297
	/*! @name Topological Queries
	 *  Return or set various topological information
	 *************************************************************************/

	//@{
	//! Test if dart d and e belong to the same vertex
	/*! @param d a dart
	 *  @param e a dart
	 */
Sylvain Thery's avatar
Sylvain Thery committed
298
	bool sameVertex(Dart d, Dart e) const;
299

300 301 302
	//! Compute the number of edges of the vertex of d
	/*! @param d a dart
	 */
Sylvain Thery's avatar
Sylvain Thery committed
303
	unsigned int vertexDegree(Dart d) const;
304

305 306 307 308 309
	//! Check number of edges of the vertex of d with given parameter
	/*! @param d a dart
	 *	@param vd degree to compare with
	 *  @return  negative/null/positive if vertex degree is less/equal/greater than given degree
	 */
Sylvain Thery's avatar
Sylvain Thery committed
310
	int checkVertexDegree(Dart d, unsigned int vd) const;
311

312 313 314
	//! Compute the number of edges of the vertex of d on the boundary
	/*!	@param d a dart
	 */
Sylvain Thery's avatar
Sylvain Thery committed
315
	unsigned int vertexDegreeOnBoundary(Dart d) const;
316

317 318 319
	//! Tell if the vertex of d is on the boundary
	/*! @param d a dart
	 */
Sylvain Thery's avatar
Sylvain Thery committed
320
	bool isBoundaryVertex(Dart d) const;
321

untereiner's avatar
untereiner committed
322 323 324 325
	//! Find the dart of vertex that belong to the boundary
	/*! return NIL if the vertex is not on the boundary
	 *  @param d a dart
	 */
Sylvain Thery's avatar
Sylvain Thery committed
326
	Dart findBoundaryFaceOfVertex(Dart d) const;
untereiner's avatar
untereiner committed
327

328 329 330 331
	//! Test if dart d and e belong to the same oriented edge
	/*! @param d a dart
	 *  @param e a dart
	 */
Sylvain Thery's avatar
Sylvain Thery committed
332
	bool sameOrientedEdge(Dart d, Dart e) const;
333 334 335 336 337

	//! Test if dart d and e belong to the same edge
	/*! @param d a dart
	 *  @param e a dart
	 */
Sylvain Thery's avatar
Sylvain Thery committed
338
	bool sameEdge(Dart d, Dart e) const;
339

340 341
	//! Compute the number of volumes around the edge of d
	/*! @param d a dart
Pierre Kraemer's avatar
Pierre Kraemer committed
342
	 */
Sylvain Thery's avatar
Sylvain Thery committed
343
	unsigned int edgeDegree(Dart d) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
344

untereiner's avatar
untereiner committed
345 346
	//! Tell if the edge of d is on the boundary of the map
	/*! @param d a dart
untereiner's avatar
bla  
untereiner committed
347
	 */
Sylvain Thery's avatar
Sylvain Thery committed
348
	bool isBoundaryEdge(Dart d) const;
untereiner's avatar
bla  
untereiner committed
349

untereiner's avatar
untereiner committed
350 351 352
	//! Find the dart of edge that belong to the boundary
	/*! return NIL if the edge is not on the boundary
	 *  @param d a dart
untereiner's avatar
untereiner committed
353
	 */
Sylvain Thery's avatar
Sylvain Thery committed
354
	Dart findBoundaryFaceOfEdge(Dart d) const;
untereiner's avatar
untereiner committed
355

356 357 358
	//! Test if dart d and e belong to the same oriented face
	/*! @param d a dart
	 *  @param e a dart
untereiner's avatar
untereiner committed
359
	 */
Sylvain Thery's avatar
Sylvain Thery committed
360
	bool sameFace(Dart d, Dart e) const;
untereiner's avatar
untereiner committed
361

362 363
	//! Test if the face is on the boundary
	/*! @param d a dart from the face
Pierre Kraemer's avatar
Pierre Kraemer committed
364
	 */
Sylvain Thery's avatar
Sylvain Thery committed
365
	bool isBoundaryFace(Dart d) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
366

367 368
	//! Tell if a face of the volume is on the boundary
	/*  @param d a dart
369
	 */
Pierre Kraemer's avatar
Pierre Kraemer committed
370
	bool isVolumeIncidentToBoundary(Dart d) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
371

372 373 374
	//! Tell if an edge of the volume is on the boundary
	/*	@param d a dart
	 */
Sylvain Thery's avatar
Sylvain Thery committed
375
	bool hasBoundaryEdge(Dart d) const;
376

untereiner's avatar
untereiner committed
377 378 379
	//! Check the map completeness
	/*! Test if phi3 and phi2 ares involutions and if phi1 is a permutation
	 */
Sylvain Thery's avatar
Sylvain Thery committed
380
	virtual bool check() const;
Pierre Kraemer's avatar
Pierre Kraemer committed
381 382 383 384 385 386 387
	//@}

	/*! @name Cell Functors
	 *  Apply functors to all darts of a cell
	 *************************************************************************/

	//@{
388 389 390 391 392 393 394 395 396
	//! Apply a function on every dart of an orbit
	/*! @param c a cell
	 *  @param f a function
	 */
	template <unsigned int ORBIT, typename FUNC>
	void foreach_dart_of_orbit(Cell<ORBIT> c, FUNC f, unsigned int thread = 0) const ;
	template <unsigned int ORBIT, typename FUNC>
	void foreach_dart_of_orbit(Cell<ORBIT> c, FUNC& f, unsigned int thread = 0) const ;

397 398 399 400
	//! Apply a functor on each dart of a vertex
	/*! @param d a dart of the vertex
	 *  @param fonct the functor
	 */
401 402
	template <typename FUNC>
	void foreach_dart_of_vertex(Dart d, FUNC& f, unsigned int thread = 0) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
403

404 405 406 407
	//! Apply a functor on each dart of an edge
	/*! @param d a dart of the oriented edge
	 *  @param fonct the functor
	 */
408 409
	template <typename FUNC>
	void foreach_dart_of_edge(Dart d, FUNC& f, unsigned int thread = 0) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
410

411
	//! Apply a functor on each dart of a face
412 413 414
	/*! @param d a dart of the oriented face
	 *  @param fonct the functor
	 */
415 416
	template <typename FUNC>
	void foreach_dart_of_face(Dart d, FUNC& f, unsigned int thread = 0) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
417

418 419 420 421
	//! Apply a functor on each dart of a face
	/*! @param d a dart of the oriented face
	 *  @param fonct the functor
	 */
422 423
	template <typename FUNC>
	void foreach_dart_of_volume(Dart d, FUNC& f, unsigned int thread = 0) const;
424

425 426 427 428 429 430 431 432 433
	//! Apply a functor on each dart of a vertex
	/*! @param d a dart of the vertex
	 *  @param fonct the functor
	 */
	template <typename FUNC>
	void foreach_dart_of_vertex1(Dart d, FUNC& f, unsigned int thread = 0) const;

	//! Apply a functor on each dart of an edge
	/*! @param d a dart of the oriented edge
434 435
	 *  @param fonct the functor
	 */
436 437
	template <typename FUNC>
	void foreach_dart_of_edge1(Dart d, FUNC& f, unsigned int thread = 0) const;
438 439 440 441 442

	//! Apply a functor on each dart of a vertex
	/*! @param d a dart of the vertex
	 *  @param fonct the functor
	 */
443 444
	template <typename FUNC>
	void foreach_dart_of_vertex2(Dart d, FUNC& f, unsigned int thread = 0) const;
445 446 447 448 449

	//! Apply a functor on each dart of an edge
	/*! @param d a dart of the oriented edge
	 *  @param fonct the functor
	 */
450 451
	template <typename FUNC>
	void foreach_dart_of_edge2(Dart d, FUNC& f, unsigned int thread = 0) const;
452 453 454 455 456

	//! Apply a functor on each dart of an oriented face
	/*! @param d a dart of the oriented face
	 *  @param fonct the functor
	 */
457 458 459 460 461 462 463 464 465
	template <typename FUNC>
	void foreach_dart_of_face2(Dart d, FUNC& f, unsigned int thread = 0) const;

	//! Apply a functor on each dart of a cc
	/*! @param d a dart of the cc
	 *  @param fonct the functor
	 */
	template <typename FUNC>
	void foreach_dart_of_cc(Dart d, FUNC& f, unsigned int thread = 0) const;
466

Pierre Kraemer's avatar
Pierre Kraemer committed
467 468
	//@}

untereiner's avatar
untereiner committed
469 470 471 472 473
	/*! @name Close map after import or creation
	 *  These functions must be used with care, generally only by import algorithms
	 *************************************************************************/

	//@{
474 475 476 477 478
	/**
	 * create a face of map1 marked as boundary
	 */
	Dart newBoundaryCycle(unsigned int nbE);

untereiner's avatar
untereiner committed
479 480 481 482 483 484 485 486 487 488 489 490
	//! 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
	 */
	virtual unsigned int closeHole(Dart d, bool forboundary = 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.
491
	 *  @return the number of closed holes
untereiner's avatar
untereiner committed
492
	 */
493
	unsigned int closeMap();
untereiner's avatar
untereiner committed
494
	//@}
untereiner's avatar
untereiner committed
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509

	/*! @name Compute dual
	 * These functions compute the dual mesh
	 *************************************************************************/

	//@{
	//! Reverse the orientation of the map
	/*!
	 */
	void reverseOrientation();

	//! Dual mesh computation
	/*!
	 */
	void computeDual();
510

Lionel Untereiner's avatar
Lionel Untereiner committed
511 512 513 514 515 516 517 518 519
	//TODO crade a virer (espece d'extrud)
	// Prend un brin d'une 2-carte
	// - stocke 1 brin par face
	// - decoud chaque face
	// - triangule chaque face
	// - ferme par phi3 chaque volume
	// - recoud le tout
	Dart explodBorderTopo(Dart d);

520
	void computeDualTest();
untereiner's avatar
untereiner committed
521
	//@}
Pierre Kraemer's avatar
Pierre Kraemer committed
522 523 524 525 526 527 528
};

} // namespace CGoGN

#include "Topology/map/map3.hpp"

#endif