Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

map3MR_PrimalAdapt.hpp 33.4 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps  *
* version 0.1                                                                  *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg           *
*                                                                              *
* 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.           *
*                                                                              *
* Web site: http://cgogn.unistra.fr/                                           *
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/

25
#include "Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.h"
26
27
28
29

namespace CGoGN
{

30
namespace Algo
31
{
32

33
34
35
namespace Volume
{

36
37
38
39
40
41
42
43
44
45
46
47
namespace MR
{

namespace Primal
{

namespace Adaptive
{

template <typename PFP>
Map3MR<PFP>::Map3MR(typename PFP::MAP& map) :
	m_map(map),
48
	shareVertexEmbeddings(true),
49
50
51
52
53
54
	vertexVertexFunctor(NULL),
	edgeVertexFunctor(NULL),
	faceVertexFunctor(NULL),
	volumeVertexFunctor(NULL)
{

55
56
57
58
}

/*! @name Cells informations
 *************************************************************************/
59
60
template <typename PFP>
unsigned int Map3MR<PFP>::edgeLevel(Dart d)
61
{
62
	assert(m_map.getDartLevel(d) <= m_map.getCurrentLevel() || !"edgeLevel : called with a dart inserted after current level") ;
63

64
65
	// the level of an edge is the maximum of the
	// insertion levels of its darts
66
67
68
69
	unsigned int r = 0;
	Dart dit = d;
	do
	{
70
71
		unsigned int ld = m_map.getDartLevel(dit) ;
		unsigned int ldd = m_map.getDartLevel(m_map.phi2(dit)) ;
72
		unsigned int max = ld < ldd ? ldd : ld;
73

74
		r =  r < max ? max : r ;
75

76
		dit = m_map.alpha2(dit);
77
78
79
80
81
	} while(dit != d);

	return r;
}

82
83
template <typename PFP>
unsigned int Map3MR<PFP>::faceLevel(Dart d)
84
{
85
	assert(m_map.getDartLevel(d) <= m_map.getCurrentLevel() || !"faceLevel : called with a dart inserted after current level") ;
86

87
	if(m_map.getCurrentLevel() == 0)
88
89
90
		return 0 ;

	Dart it = d ;
91
92
93
	unsigned int min1 = m_map.getDartLevel(it) ;		// the level of a face is the second minimum of the
	it = m_map.phi1(it) ;
	unsigned int min2 = m_map.getDartLevel(it) ;		// insertion levels of its darts
94
95
96
97
98
99
100
101

	if(min2 < min1)
	{
		unsigned int tmp = min1 ;
		min1 = min2 ;
		min2 = tmp ;
	}

102
	it = m_map.phi1(it) ;
103
104
	while(it != d)
	{
105
		unsigned int dl = m_map.getDartLevel(it) ;
106
107
108
109
110
111
112
113
114
115
		if(dl < min2)
		{
			if(dl < min1)
			{
				min2 = min1 ;
				min1 = dl ;
			}
			else
				min2 = dl ;
		}
116
		it = m_map.phi1(it) ;
117
118
119
120
121
	}

	return min2 ;
}

122
123
template <typename PFP>
unsigned int Map3MR<PFP>::volumeLevel(Dart d)
124
{
125
	assert(m_map.getDartLevel(d) <= m_map.getCurrentLevel() || !"volumeLevel : called with a dart inserted after current level") ;
126

127
	if(m_map.getCurrentLevel() == 0)
128
129
130
131
132
		return 0 ;

	unsigned int vLevel = std::numeric_limits<unsigned int>::max(); //hook sioux

	//First : the level of a volume is the minimum of the levels of its faces
133
	Traversor3WF<typename PFP::MAP> travF(m_map, d);
134
135
136
137
138
139
140
141
142
143
144
145
146
147
	for (Dart dit = travF.begin(); dit != travF.end(); dit = travF.next())
	{
		// in a first time, the level of a face
		//the level of the volume is the minimum of the
		//levels of its faces
		unsigned int fLevel = faceLevel(dit);
		vLevel = fLevel < vLevel ? fLevel : vLevel ;
	}

	//Second : the case of all faces regularly subdivided but not the volume itself

	return vLevel;
}

148
149
template <typename PFP>
Dart Map3MR<PFP>::faceOldestDart(Dart d)
150
{
151
	assert(m_map.getDartLevel(d) <= m_map.getCurrentLevel() || !"faceOldestDart : called with a dart inserted after current level") ;
152
153
154

	Dart it = d ;
	Dart oldest = it ;
155
	unsigned int l_old = m_map.getDartLevel(oldest) ;
156
157
	do
	{
158
		unsigned int l = m_map.getDartLevel(it) ;
untereiner's avatar
untereiner committed
159
160
161
		if(l == 0)
			return it ;
		if(l < l_old)
162
163
164
165
		{
			oldest = it ;
			l_old = l ;
		}
166
		it = m_map.phi1(it) ;
167
168
169
170
	} while(it != d) ;
	return oldest ;
}

171
172
template <typename PFP>
Dart Map3MR<PFP>::volumeOldestDart(Dart d)
173
{
174
	assert(m_map.getDartLevel(d) <= m_map.getCurrentLevel() || !"volumeOldestDart : called with a dart inserted after current level") ;
175
176

	Dart oldest = d;
177
	Traversor3WF<typename PFP::MAP> travF(m_map, d);
178
179
180
181
	for (Dart dit = travF.begin(); dit != travF.end(); dit = travF.next())
	{
		//for every dart in this face
		Dart old = faceOldestDart(dit);
182
		if(m_map.getDartLevel(old) < m_map.getDartLevel(oldest))
183
184
185
186
187
188
			oldest = old;
	}

	return oldest;
}

189
190
template <typename PFP>
bool Map3MR<PFP>::edgeIsSubdivided(Dart d)
191
{
192
	assert(m_map.getDartLevel(d) <= m_map.getCurrentLevel() || !"edgeIsSubdivided : called with a dart inserted after current level") ;
193

194
	if(m_map.getCurrentLevel() == m_map.getMaxLevel())
195
196
		return false ;

197
198
199
200
	Dart d2 = m_map.phi2(d) ;
	m_map.incCurrentLevel() ;
	Dart d2_l = m_map.phi2(d) ;
	m_map.decCurrentLevel() ; ;
201
202
203
204
205
206
	if(d2 != d2_l)
		return true ;
	else
		return false ;
}

207
208
template <typename PFP>
bool Map3MR<PFP>::faceIsSubdivided(Dart d)
209
{
210
	assert(m_map.getDartLevel(d) <= m_map.getCurrentLevel() || !"faceIsSubdivided : called with a dart inserted after current level") ;
211

212
	if(m_map.getCurrentLevel() == m_map.getMaxLevel())
213
214
215
		return false ;

	// a face whose level in the current level map is lower than
untereiner's avatar
untereiner committed
216
	// the current level can be subdivided to higher levels
217
	unsigned int fLevel = faceLevel(d) ;
218
	if(fLevel < m_map.getCurrentLevel())
219
220
221
		return false ;

	bool subd = false ;
untereiner's avatar
untereiner committed
222
223
224
225
226
227
228

	//Une face dont toute les aretes sont subdivise mais pas la face elle meme renvoie false .. sinon c'est true
	Dart dit = d;
	bool edgesAreSubdivided = true;
	do
	{
		edgesAreSubdivided &= edgeIsSubdivided(dit);
229
		dit = m_map.phi1(dit);
untereiner's avatar
untereiner committed
230
231
232
233
	}while(dit != d);

	if(edgesAreSubdivided)
	{
234
235
		m_map.incCurrentLevel() ;
		if(m_map.getDartLevel(m_map.phi1(m_map.phi1(d))) == m_map.getCurrentLevel())
untereiner's avatar
untereiner committed
236
			subd = true ;
237
		m_map.decCurrentLevel() ;
untereiner's avatar
untereiner committed
238
239
240
	}
	else
		return false;
241
242
243
244

	return subd ;
}

245
246
template <typename PFP>
bool Map3MR<PFP>::volumeIsSubdivided(Dart d)
247
{
248
	assert(m_map.getDartLevel(d) <= m_map.getCurrentLevel() || !"volumeIsSubdivided : called with a dart inserted after current level") ;
249
250

	unsigned int vLevel = volumeLevel(d);
251
	if(vLevel <= m_map.getCurrentLevel())
252
253
254
255
		return false;

	//Test if all faces are subdivided
	bool facesAreSubdivided = faceIsSubdivided(d) ;
256
	Traversor3WF<typename PFP::MAP> travF(m_map, d);
257
258
259
260
261
262
263
	for (Dart dit = travF.begin(); dit != travF.end(); dit = travF.next())
	{
		facesAreSubdivided &= faceIsSubdivided(dit) ;
	}

	//But not the volume itself
	bool subd = false;
264
265
	m_map.incCurrentLevel();
	if(facesAreSubdivided && m_map.getDartLevel(m_map.phi2(m_map.phi1(m_map.phi1(d)))) == m_map.getCurrentLevel())
266
		subd = true;
267
	m_map.decCurrentLevel() ;
268
269
270
	return subd;
}

271
272
273
274
275
276
277
278
279
280
/*! @name Topological helping functions
 *************************************************************************/
template <typename PFP>
void Map3MR<PFP>::swapEdges(Dart d, Dart e)
{
	if(!m_map.PFP::MAP::ParentMap::isBoundaryEdge(d) && !m_map.PFP::MAP::ParentMap::isBoundaryEdge(e))
	{
		Dart d2 = m_map.phi2(d);
		Dart e2 = m_map.phi2(e);

281
		m_map.PFP::MAP::ParentMap::swapEdges(d,e);
282

283
284
285
286
287
//		m_map.PFP::MAP::ParentMap::unsewFaces(d);
//		m_map.PFP::MAP::ParentMap::unsewFaces(e);
//
//		m_map.PFP::MAP::ParentMap::sewFaces(d, e);
//		m_map.PFP::MAP::ParentMap::sewFaces(d2, e2);
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302

		if(m_map.template isOrbitEmbedded<VERTEX>())
		{
			m_map.template copyDartEmbedding<VERTEX>(d, m_map.phi2(m_map.phi_1(d)));
			m_map.template copyDartEmbedding<VERTEX>(e, m_map.phi2(m_map.phi_1(e)));
			m_map.template copyDartEmbedding<VERTEX>(d2, m_map.phi2(m_map.phi_1(d2)));
			m_map.template copyDartEmbedding<VERTEX>(e2, m_map.phi2(m_map.phi_1(e2)));
		}

		if(m_map.template isOrbitEmbedded<EDGE>())
		{

		}

		if(m_map.template isOrbitEmbedded<VOLUME>())
303
			m_map.template setOrbitEmbeddingOnNewCell<VOLUME>(d);
304
305


306
307
308
309
		m_map.duplicateDart(d);
		m_map.duplicateDart(d2);
		m_map.duplicateDart(e);
		m_map.duplicateDart(e2);
310
311
312
313
314
315
316
317
318
319
320
321
	}
}

template <typename PFP>
void Map3MR<PFP>::splitSurfaceInVolume(std::vector<Dart>& vd, bool firstSideClosed, bool secondSideClosed)
{
	std::vector<Dart> vd2 ;
	vd2.reserve(vd.size());

	// save the edge neighbors darts
	for(std::vector<Dart>::iterator it = vd.begin() ; it != vd.end() ; ++it)
	{
322
		vd2.push_back(m_map.phi2(*it));
323
324
325
326
	}

	assert(vd2.size() == vd.size());

327
	m_map.PFP::MAP::ParentMap::splitSurface(vd, firstSideClosed, secondSideClosed);
328
329
330
331
332
333
334

	// follow the edge path a second time to embed the vertex, edge and volume orbits
	for(unsigned int i = 0; i < vd.size(); ++i)
	{
		Dart dit = vd[i];
		Dart dit2 = vd2[i];

335
336
		m_map.duplicateDart(dit);
		m_map.duplicateDart(dit2);
337
338

		// embed the vertex embedded from the origin volume to the new darts
339
		if(m_map.template isOrbitEmbedded<VERTEX>())
340
		{
341
342
			m_map.template copyDartEmbedding<VERTEX>(m_map.phi2(dit), m_map.phi1(dit));
			m_map.template copyDartEmbedding<VERTEX>(m_map.phi2(dit2), m_map.phi1(dit2));
343
344
345
346
347
348
349
350
		}
	}

}

template <typename PFP>
void Map3MR<PFP>::splitFaceInVolume(Dart d, Dart e)
{
351
352
353
354
355
356
357
358
359
	Dart dprev = m_map.phi_1(d) ;
	Dart eprev = m_map.phi_1(e) ;

	m_map.duplicateDart(d);
	m_map.duplicateDart(e);
	m_map.duplicateDart(dprev);
	m_map.duplicateDart(eprev);

	m_map.PFP::MAP::ParentMap::splitFace(d, e) ;
360
361
362
363
364
}

template <typename PFP>
Dart Map3MR<PFP>::cutEdgeInVolume(Dart d)
{
365
366
367
368
369
370
371
372
373
374
375
376
	Dart dd = m_map.phi2(d) ;
	Dart d1 = m_map.phi1(d);
	Dart dd1 = m_map.phi1(dd);

	m_map.duplicateDart(d);
	m_map.duplicateDart(dd);
	m_map.duplicateDart(d1);
	m_map.duplicateDart(dd1);

	Dart nd = m_map.PFP::MAP::ParentMap::cutEdge(d) ;

	return nd ;
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
}


template <typename PFP>
Dart Map3MR<PFP>::cutEdge(Dart d)
{
	Dart dit = d;
	do
	{
		Dart dd = m_map.phi2(dit) ;
		Dart d1 = m_map.phi1(dit);
		Dart dd1 = m_map.phi1(dd);

		m_map.duplicateDart(dit);
		m_map.duplicateDart(dd);
		m_map.duplicateDart(d1);
		m_map.duplicateDart(dd1);

		dit = m_map.alpha2(dit);
	}while(dit != d);

	Dart nd = m_map.cutEdge(d);

	return nd;
}

template <typename PFP>
void Map3MR<PFP>::splitFace(Dart d, Dart e)
{
	Dart dprev = m_map.phi_1(d) ;
	Dart eprev = m_map.phi_1(e) ;

	m_map.duplicateDart(d);
	m_map.duplicateDart(e);
	m_map.duplicateDart(dprev);
	m_map.duplicateDart(eprev);

	m_map.duplicateDart(m_map.phi3(d));
	m_map.duplicateDart(m_map.phi3(e));
	m_map.duplicateDart(m_map.phi3(dprev));
	m_map.duplicateDart(m_map.phi3(eprev));

	m_map.splitFace(d,e);
}

template <typename PFP>
void Map3MR<PFP>::splitVolume(std::vector<Dart>& vd)
{
425
	m_map.splitVolume(vd);
426
427
428
429

	for(std::vector<Dart>::iterator it = vd.begin() ; it != vd.end() ; ++it)
	{
		Dart dit = *it;
430
		m_map.duplicateDart(dit);
431

432
433
		Dart dit2 = m_map.phi2(dit);
		m_map.duplicateDart(dit2);
434

435
436
		Dart dit23 = m_map.phi3(dit2);
		m_map.duplicateDart(dit23);
437

438
439
		Dart dit232 = m_map.phi2(dit23);
		m_map.duplicateDart(dit232);
440
441
442
443
	}
}


444
445
/*! @name Subdivision
 *************************************************************************/
446
447
template <typename PFP>
void Map3MR<PFP>::subdivideEdge(Dart d)
448
{
449
	assert(m_map.getDartLevel(d) <= m_map.getCurrentLevel() || !"subdivideEdge : called with a dart inserted after current level") ;
untereiner's avatar
untereiner committed
450
	assert(!edgeIsSubdivided(d) || !"Trying to subdivide an already subdivided edge") ;
451

452
453
	assert(m_map.getCurrentLevel() == edgeLevel(d) || !"Trying to subdivide an edge on a bad current level") ;

454
	m_map.incCurrentLevel();
untereiner's avatar
untereiner committed
455

456
	Dart nd = cutEdge(d);
457

458
	(*edgeVertexFunctor)(nd) ;
untereiner's avatar
untereiner committed
459

460
	m_map.decCurrentLevel() ;
461
462
}

463
template <typename PFP>
464
void Map3MR<PFP>::subdivideFace(Dart d, bool triQuad)
465
{
466
	assert(m_map.getDartLevel(d) <= m_map.getCurrentLevel() || !"subdivideFace : called with a dart inserted after current level") ;
467
468
469
470
471
	assert(!faceIsSubdivided(d) || !"Trying to subdivide an already subdivided face") ;

	unsigned int fLevel = faceLevel(d) ;
	Dart old = faceOldestDart(d) ;

472
473
	m_map.pushLevel() ;
	m_map.setCurrentLevel(fLevel) ;		// go to the level of the face to subdivide its edges
474
475
476
477
478
479
480
481
482

	unsigned int degree = 0 ;
	Dart it = old ;
	do
	{
		++degree ;						// compute the degree of the face

		if(!edgeIsSubdivided(it))
			subdivideEdge(it) ;			// and cut the edges (if they are not already)
483
		it = m_map.phi1(it) ;
484
485
	} while(it != old) ;

486
	m_map.setCurrentLevel(fLevel + 1) ;	// go to the next level to perform face subdivision
487

488
	if(triQuad && degree == 3)	// if subdividing a triangle
489
	{
490
491
		Dart dd = m_map.phi1(old) ;
		Dart e = m_map.phi1(dd) ;
492
		//(*vertexVertexFunctor)(e) ;
493
		e = m_map.phi1(e) ;
494
495
496
		splitFace(dd, e) ;

		dd = e ;
497
		e = m_map.phi1(dd) ;
498
		//(*vertexVertexFunctor)(e) ;
499
		e = m_map.phi1(e) ;
500
501
502
		splitFace(dd, e) ;

		dd = e ;
503
		e = m_map.phi1(dd) ;
504
		//(*vertexVertexFunctor)(e) ;
505
		e = m_map.phi1(e) ;
506
507
508
509
		splitFace(dd, e) ;
	}
	else							// if subdividing a polygonal face
	{
510
511
		Dart dd = m_map.phi1(old) ;
		Dart next = m_map.phi1(dd) ;
512
		//(*vertexVertexFunctor)(next) ;
513
		next = m_map.phi1(next) ;
514
		splitFace(dd, next) ;			// insert a first edge
515
		Dart ne = m_map.phi2(m_map.phi_1(dd));
516
517
518

		cutEdge(ne) ;					// cut the new edge to insert the central vertex

519
		dd = m_map.phi1(next) ;
520
		//(*vertexVertexFunctor)(dd) ;
521
		dd = m_map.phi1(dd) ;
522
523
		while(dd != ne)					// turn around the face and insert new edges
		{								// linked to the central vertex
524
525
			splitFace(m_map.phi1(ne), dd) ;
			dd = m_map.phi1(dd) ;
526
			//(*vertexVertexFunctor)(dd) ;
527
			dd = m_map.phi1(dd) ;
528
529
		}

530
		(*faceVertexFunctor)(m_map.phi1(ne)) ;
531
532
	}

533
	m_map.popLevel() ;
534
535
}

536
template <typename PFP>
537
unsigned int Map3MR<PFP>::subdivideVolume(Dart d, bool triQuad, bool OneLevelDifference)
538
{
539
	assert(m_map.getDartLevel(d) <= m_map.getCurrentLevel() || !"subdivideVolume : called with a dart inserted after current level") ;
540
541
542
543
544
	assert(!volumeIsSubdivided(d) || !"Trying to subdivide an already subdivided face") ;

	unsigned int vLevel = volumeLevel(d);
	Dart old = volumeOldestDart(d);

545
546
	m_map.pushLevel() ;
	m_map.setCurrentLevel(vLevel) ;		// go to the level of the volume to subdivide its faces
547

548
549
	if(m_map.getCurrentLevel() == m_map.getMaxLevel())
		m_map.addLevelBack() ;
550
551

	//
untereiner's avatar
untereiner committed
552
	// Subdivide Faces and Edges
553
	//
554
	Traversor3WF<typename PFP::MAP> traF(m_map, old);
555
556
557
558
	for(Dart dit = traF.begin(); dit != traF.end(); dit = traF.next())
	{
		//if needed subdivide face
		if(!faceIsSubdivided(dit))
559
			subdivideFace(dit,triQuad);
560
561
562
563
564
	}

	//
	// Create inside volumes
	//
untereiner's avatar
untereiner committed
565
566
	std::vector<std::pair<Dart, Dart> > subdividedFaces;
	subdividedFaces.reserve(128);
567

568
569
570
571
572
573
	bool isocta = false;
	bool ishex = false;
	bool isprism = false;
	bool ispyra = false;

	Dart centralDart = NIL;
574
	Traversor3WV<typename PFP::MAP> traWV(m_map, d);
untereiner's avatar
untereiner committed
575
	for(Dart ditWV = traWV.begin(); ditWV != traWV.end(); ditWV = traWV.next())
576
	{
577
		m_map.incCurrentLevel() ;
578

untereiner's avatar
untereiner committed
579
580
581
582
		Dart e = ditWV;
		std::vector<Dart> v ;

		do
583
		{
584
			v.push_back(m_map.phi1(e));
585
586
587

			if(m_map.phi1(m_map.phi1(m_map.phi1(e))) != e)
				v.push_back(m_map.phi1(m_map.phi1(e)));
untereiner's avatar
untereiner committed
588

589
			if(!m_map.PFP::MAP::ParentMap::isBoundaryEdge(m_map.phi1(e)))
590
				subdividedFaces.push_back(std::pair<Dart,Dart>(m_map.phi1(e),m_map.phi2(m_map.phi1(e))));
untereiner's avatar
untereiner committed
591

592
593
594
			if(m_map.phi1(m_map.phi1(m_map.phi1(e))) != e)
				if(!m_map.PFP::MAP::ParentMap::isBoundaryEdge(m_map.phi1(m_map.phi1(e))))
					subdividedFaces.push_back(std::pair<Dart,Dart>(m_map.phi1(m_map.phi1(e)),m_map.phi2(m_map.phi1(m_map.phi1(e)))));
untereiner's avatar
untereiner committed
595

596
			e = m_map.phi2(m_map.phi_1(e));
597
		}
untereiner's avatar
untereiner committed
598
		while(e != ditWV);
599

600
		m_map.splitVolume(v);
601

602
		unsigned int fdeg = m_map.faceDegree(m_map.phi2(m_map.phi1(ditWV)));
603

604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
		if(fdeg == 4)
		{
			if(m_map.PFP::MAP::ParentMap::vertexDegree(ditWV) == 3)
			{
				isocta = false;
				ispyra = true;

				Dart it = ditWV;
				if((m_map.faceDegree(it) == 3) && (m_map.faceDegree(m_map.phi2(it))) == 3)
				{
					it = m_map.phi2(m_map.phi_1(it));
				}
				else if((m_map.faceDegree(it) == 3) && (m_map.faceDegree(m_map.phi2(it)) == 4))
				{
					it = m_map.phi1(m_map.phi2(it));
				}

				Dart old = m_map.phi2(m_map.phi1(it));
				Dart dd = m_map.phi1(m_map.phi1(old));

				m_map.splitFace(old,dd) ;
625
				//centralDart = old;
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
			}
			else
			{
				isocta = true;

				Dart old = m_map.phi2(m_map.phi1(ditWV));
				Dart dd = m_map.phi1(old) ;
				m_map.splitFace(old,dd) ;

				Dart ne = m_map.phi1(old);

				m_map.cutEdge(ne);
				centralDart = m_map.phi1(ne);

				Dart stop = m_map.phi2(m_map.phi1(ne));
				ne = m_map.phi2(ne);
				do
				{
					dd = m_map.phi1(m_map.phi1(ne));
645

646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
					m_map.splitFace(ne, dd) ;

					ne = m_map.phi2(m_map.phi_1(ne));
					dd = m_map.phi1(dd);
				}
				while(dd != stop);
			}
		}
		else if(fdeg == 5)
		{
			isprism = true;

			Dart it = ditWV;
			if(m_map.faceDegree(it) == 3)
			{
				it = m_map.phi2(m_map.phi_1(it));
			}
			else if(m_map.faceDegree(m_map.phi2(m_map.phi_1(ditWV))) == 3)
			{
				it = m_map.phi2(m_map.phi_1(m_map.phi2(m_map.phi_1(it))));
			}

			Dart old = m_map.phi2(m_map.phi1(it));
			Dart dd = m_map.phi_1(m_map.phi_1(old));

			m_map.splitFace(old,dd) ;
		}
		if(fdeg == 6)
674
		{
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
			ishex = true;

			Dart dd = m_map.phi2(m_map.phi1(ditWV));;
			Dart next = m_map.phi1(m_map.phi1(dd)) ;
			m_map.splitFace(dd, next) ;		// insert a first edge

			Dart ne = m_map.phi2(m_map.phi_1(dd)) ;
			m_map.cutEdge(ne) ;				// cut the new edge to insert the central vertex
			centralDart = m_map.phi1(ne);

			dd = m_map.phi1(m_map.phi1(next)) ;
			while(dd != ne)				// turn around the face and insert new edges
			{							// linked to the central vertex
				Dart tmp = m_map.phi1(ne) ;
				m_map.splitFace(tmp, dd) ;
				dd = m_map.phi1(m_map.phi1(dd)) ;
			}
692
		}
untereiner's avatar
untereiner committed
693

694
		m_map.decCurrentLevel() ;
695
696
	}

697
	if(ishex)
698
	{
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
		m_map.incCurrentLevel();

		m_map.deleteVolume(m_map.phi3(m_map.phi2(m_map.phi1(d))));

		for (std::vector<std::pair<Dart,Dart> >::iterator it = subdividedFaces.begin(); it != subdividedFaces.end(); ++it)
		{
			Dart f1 = m_map.phi2((*it).first);
			Dart f2 = m_map.phi2((*it).second);

			if(m_map.isBoundaryFace(f1) && m_map.isBoundaryFace(f2))
			{
					m_map.sewVolumes(f1, f2);//, false);
			}
		}

		//replonger l'orbit de ditV.
715
		m_map.template setOrbitEmbedding<VERTEX>(centralDart, m_map.template getEmbedding<VERTEX>(centralDart));
716

717
718
719
		(*volumeVertexFunctor)(centralDart) ;

		m_map.decCurrentLevel() ;
720
	}
721

722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
	if(ispyra)
	{
		isocta = false;

		Dart ditV = d;

		Traversor3WV<typename PFP::MAP> traWV(m_map, d);
		for(Dart ditWV = traWV.begin(); ditWV != traWV.end(); ditWV = traWV.next())
		{
			if(m_map.PFP::MAP::ParentMap::vertexDegree(ditWV) == 4)
				ditV = ditWV;
		}

		m_map.incCurrentLevel();
		Dart x = m_map.phi_1(m_map.phi2(m_map.phi1(ditV)));

		Dart f = x;
		do
		{
			Dart f3 = m_map.phi3(f);
			Dart tmp =  m_map.phi_1(m_map.phi2(m_map.phi_1(m_map.phi2(m_map.phi_1(f3))))); //future voisin par phi2
			swapEdges(f3, tmp);

			f = m_map.phi2(m_map.phi_1(f));
		}while(f != x);
untereiner's avatar
untereiner committed
747

748
749
		//replonger l'orbit de ditV.
		m_map.template setOrbitEmbedding<VERTEX>(x, m_map.template getEmbedding<VERTEX>(x));
750
		(*volumeVertexFunctor)(x) ;
751
752
753
754
755

		m_map.decCurrentLevel() ;
	}

	if(isocta)
untereiner's avatar
untereiner committed
756
	{
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
		Traversor3WV<typename PFP::MAP> traWV(m_map, d);

		for(Dart ditWV = traWV.begin(); ditWV != traWV.end(); ditWV = traWV.next())
		{
			m_map.incCurrentLevel();
			Dart x = m_map.phi_1(m_map.phi2(m_map.phi1(ditWV)));

			if(!Algo::Volume::Modelisation::Tetrahedralization::isTetrahedron<PFP>(m_map,x))
			{
				DartMarkerStore me(m_map);

				Dart f = x;

				do
				{
					Dart f3 = m_map.phi3(f);

					if(!me.isMarked(f3))
					{
						Dart tmp =  m_map.phi_1(m_map.phi2(m_map.phi_1(m_map.phi2(m_map.phi_1(f3))))); //future voisin par phi2

						Dart f32 = m_map.phi2(f3);
						swapEdges(f3, tmp);

						me.markOrbit<EDGE>(f3);
						me.markOrbit<EDGE>(f32);
					}

					f = m_map.phi2(m_map.phi_1(f));
				}while(f != x);

			}

790
791
			m_map.template setOrbitEmbedding<VERTEX>(x, m_map.template getEmbedding<VERTEX>(x));
			(*volumeVertexFunctor)(x) ;
792
793
794

			m_map.decCurrentLevel() ;
		}
untereiner's avatar
untereiner committed
795
796
	}

797
	if(isprism)
untereiner's avatar
untereiner committed
798
	{
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
		m_map.incCurrentLevel();

		Dart ditWV = d;
		if(m_map.faceDegree(d) == 3)
		{
			ditWV = m_map.phi2(m_map.phi_1(d));
		}
		else if(m_map.faceDegree(m_map.phi2(m_map.phi_1(d))) == 3)
		{
			ditWV = m_map.phi1(m_map.phi2(d));
		}

		ditWV = m_map.phi3(m_map.phi_1(m_map.phi2(m_map.phi1(ditWV))));


		std::vector<Dart> path;

		Dart dtemp = ditWV;
		do
		{
			//future voisin par phi2
			Dart sF1 = m_map.phi1(m_map.phi2(m_map.phi3(dtemp)));
			Dart wrongVolume = m_map.phi3(sF1);
			Dart sF2 = m_map.phi3(m_map.phi2(wrongVolume));
			Dart tmp =  m_map.phi3(m_map.phi2(m_map.phi1(sF2)));
			swapEdges(dtemp, tmp);

			m_map.deleteVolume(wrongVolume);
			m_map.sewVolumes(sF1,sF2);

			path.push_back(dtemp);
			dtemp = m_map.phi_1(m_map.phi2(m_map.phi_1(dtemp)));


		}while(dtemp != ditWV);

		m_map.splitVolume(path);

		m_map.decCurrentLevel() ;
untereiner's avatar
untereiner committed
838
839
	}

840
	m_map.incCurrentLevel();
841

842
	m_map.popLevel() ;
843
844

	return vLevel;
845
846
}

847
848
849
850
851
template <typename PFP>
unsigned int Map3MR<PFP>::subdivideHexa(Dart d, bool OneLevelDifference)
{
	assert(m_map.getDartLevel(d) <= m_map.getCurrentLevel() || !"subdivideVolume : called with a dart inserted after current level") ;
	assert(!volumeIsSubdivided(d) || !"Trying to subdivide an already subdivided face") ;
852

853
854
	unsigned int vLevel = volumeLevel(d);
	Dart old = volumeOldestDart(d);
855

856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
	m_map.pushLevel() ;
	m_map.setCurrentLevel(vLevel) ;		// go to the level of the volume to subdivide its faces

	if(m_map.getCurrentLevel() == m_map.getMaxLevel())
		m_map.addLevelBack() ;

	//
	// Subdivide Faces and Edges
	//
	Traversor3WF<typename PFP::MAP> traF(m_map, old);
	for(Dart dit = traF.begin(); dit != traF.end(); dit = traF.next())
	{
		//if needed subdivide face
		if(!faceIsSubdivided(dit))
			subdivideFace(dit,false);
	}

	std::vector<std::pair<Dart, Dart> > subdividedFaces;
	subdividedFaces.reserve(128);
	Dart centralDart = NIL;
	Traversor3WV<typename PFP::MAP> traWV(m_map, d);
	for(Dart ditWV = traWV.begin(); ditWV != traWV.end(); ditWV = traWV.next())
	{
		m_map.incCurrentLevel() ;
		(*vertexVertexFunctor)(ditWV) ;

		Dart e = ditWV;
		std::vector<Dart> v ;

		do
		{
			v.push_back(m_map.phi1(e));
			v.push_back(m_map.phi1(m_map.phi1(e)));

			if(!m_map.PFP::MAP::ParentMap::isBoundaryEdge(m_map.phi1(e)))
				subdividedFaces.push_back(std::pair<Dart,Dart>(m_map.phi1(e),m_map.phi2(m_map.phi1(e))));

			if(m_map.phi1(m_map.phi1(m_map.phi1(e))) != e)
				if(!m_map.PFP::MAP::ParentMap::isBoundaryEdge(m_map.phi1(m_map.phi1(e))))
					subdividedFaces.push_back(std::pair<Dart,Dart>(m_map.phi1(m_map.phi1(e)),m_map.phi2(m_map.phi1(m_map.phi1(e)))));

			e = m_map.phi2(m_map.phi_1(e));
		}
		while(e != ditWV);

		m_map.splitVolume(v);

		Dart dd = m_map.phi2(m_map.phi1(ditWV));;
		Dart next = m_map.phi1(m_map.phi1(dd)) ;
		m_map.splitFace(dd, next) ;		// insert a first edge

		Dart ne = m_map.phi2(m_map.phi_1(dd)) ;
		m_map.cutEdge(ne) ;				// cut the new edge to insert the central vertex
		centralDart = m_map.phi1(ne);

		dd = m_map.phi1(m_map.phi1(next)) ;
		while(dd != ne)				// turn around the face and insert new edges
		{							// linked to the central vertex
			Dart tmp = m_map.phi1(ne) ;
			m_map.splitFace(tmp, dd) ;
			dd = m_map.phi1(m_map.phi1(dd)) ;
		}

		m_map.decCurrentLevel() ;


	}

	m_map.incCurrentLevel();

	m_map.deleteVolume(m_map.phi3(m_map.phi2(m_map.phi1(d))));

	for (std::vector<std::pair<Dart,Dart> >::iterator it = subdividedFaces.begin(); it != subdividedFaces.end(); ++it)
	{
		Dart f1 = m_map.phi2((*it).first);
		Dart f2 = m_map.phi2((*it).second);

		if(m_map.isBoundaryFace(f1) && m_map.isBoundaryFace(f2))
		{
			m_map.sewVolumes(f1, f2);//, false);
		}
	}

	(*volumeVertexFunctor)(centralDart) ;

	m_map.popLevel() ;

	return vLevel;
}
945
946
947
948




949
950
template <typename PFP>
void Map3MR<PFP>::subdivideVolumeTetOcta(Dart d)
951
{
952
	assert(m_map.getDartLevel(d) <= m_map.getCurrentLevel() || !"subdivideVolumeTetOcta : called with a dart inserted after current level") ;
953
954
955
956
957
	assert(!volumeIsSubdivided(d) || !"Trying to subdivide an already subdivided face") ;

	unsigned int vLevel = volumeLevel(d);
	Dart old = volumeOldestDart(d);

958
959
	m_map.pushLevel() ;
	m_map.setCurrentLevel(vLevel) ;		// go to the level of the face to subdivide its edges
960

961
962
	if(m_map.getCurrentLevel() == m_map.getMaxLevel())
		m_map.addLevelBack() ;
963

untereiner's avatar
untereiner committed
964
965
	unsigned int j = 0;

966
	//
untereiner's avatar
untereiner committed
967
	// Subdivide Faces and Edges
968
	//
969
	Traversor3WF<typename PFP::MAP> traF(m_map, old);
970
971
	for(Dart dit = traF.begin(); dit != traF.end(); dit = traF.next())
	{
972
		std::cout << "CurrentLevel = " << m_map.getCurrentLevel() << std::endl;
untereiner's avatar
untereiner committed
973
974
975
		std::cout << "face level = " << faceLevel(dit) << std::endl;
		//std::cout << "d = " << dit << " is Subdivided ? " << faceIsSubdivided(dit) << std::endl;

976
977
		//if needed subdivide face
		if(!faceIsSubdivided(dit))
untereiner's avatar
untereiner committed
978
979
		{
			std::cout << "subdivide face = " << dit << std::endl;
980
			subdivideFace(dit, true);
untereiner's avatar
untereiner committed
981
982
			++j;
		}
983
984
985
986
987
988
989
	}

	//
	// Create inside volumes
	//
	Dart centralDart = NIL;
	bool isNotTet = false;
990
991
	Traversor3WV<typename PFP::MAP> traV(m_map, old);
	m_map.setCurrentLevel(vLevel + 1) ;
992
993
	for(Dart dit = traV.begin(); dit != traV.end(); dit = traV.next())
	{
994
		//m_map.template setOrbitEmbedding<VERTEX>(dit, EMBNULL);
995
996
		(*vertexVertexFunctor)(dit) ;

997
		Dart f1 = m_map.phi1(dit);
998
999
1000
1001
1002
		Dart e = dit;
		std::vector<Dart> v ;

		do
		{
1003
1004
			v.push_back(m_map.phi1(e));
			e = m_map.phi2(m_map.phi_1(e));
1005
1006
1007
		}
		while(e != dit);

untereiner's avatar
untereiner committed
1008
1009
		std::cout << "v size = " << v.size() << std::endl;

1010
1011
1012
		splitVolume(v) ;

		//if is not a tetrahedron
1013
		unsigned int fdeg = m_map.faceDegree(m_map.phi2(f1));
1014
1015
1016
		if(fdeg > 3)
		{
			isNotTet = true;
1017
1018
			Dart old = m_map.phi2(m_map.phi1(dit));
			Dart dd = m_map.phi1(old) ;
1019
1020
			splitFace(old,dd) ;

1021
			Dart ne = m_map.phi1(old);
1022
1023

			cutEdge(ne);
1024
			centralDart = m_map.phi1(ne);
untereiner's avatar
untereiner committed
1025
			//(*volumeVertexFunctor)(centralDart) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
1026
			//propagateOrbitEmbedding<VERTEX>(centralDart) ;
1027

1028
1029
			Dart stop = m_map.phi2(m_map.phi1(ne));
			ne = m_map.phi2(ne);
1030
1031
			do
			{
1032
				dd = m_map.phi1(m_map.phi1(ne));
1033
1034
1035

				splitFace(ne, dd) ;

1036
1037
				ne = m_map.phi2(m_map.phi_1(ne));
				dd = m_map.phi1(dd);
1038
1039
1040
1041
1042
1043
1044
1045
			}
			while(dd != stop);
		}
	}

	//switch inner faces
	if(isNotTet)
	{
1046
		DartMarkerStore me(m_map);
1047
1048
1049

		for(Dart dit = traV.begin(); dit != traV.end(); dit = traV.next())
		{
1050
			Dart x = m_map.phi_1(m_map.phi2(m_map.phi1(dit)));
1051
1052
1053
1054
			Dart f = x;

			do
			{
1055
				Dart f3 = m_map.phi3(f);
1056
1057
1058

				if(!me.isMarked(f3))
				{
1059
					Dart tmp =  m_map.phi_1(m_map.phi2(m_map.phi_1(m_map.phi2(m_map.phi_1(f3))))); //future voisin par phi2
untereiner's avatar
untereiner committed
1060
					//centralDart = tmp;
1061

1062
					Dart f32 = m_map.phi2(f3);
1063
1064
					swapEdges(f3, tmp);

Pierre Kraemer's avatar
Pierre Kraemer committed
1065
1066
					me.markOrbit<EDGE>(f3);
					me.markOrbit<EDGE>(f32);
1067
1068
				}

1069
				f = m_map.phi2(m_map.phi_1(f));
1070
1071
1072
			}while(f != x);
		}

1073
1074
		//m_map.template setOrbitEmbedding<VERTEX>(centralDart, EMBNULL);
		m_map.template setOrbitEmbedding<VERTEX>(centralDart, m_map.template getEmbedding<VERTEX>(centralDart));
untereiner's avatar
untereiner committed
1075
		(*volumeVertexFunctor)(centralDart) ;
1076
		//propagateOrbitEmbedding<VERTEX>(centralDart) ;
1077
1078
	}

1079
	m_map.popLevel();
1080
1081
}

untereiner's avatar
untereiner committed
1082

1083
1084
1085
1086
1087
1088
} // namespace Adaptive

} // namespace Primal

} // namespace MR

1089
1090
} // namespace Volume

1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
} // namespace Algo

} // namespace CGoGN












1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
//	Traversor3WV<typename PFP::MAP> traWV(m_map, d);
//	for(Dart ditWV = traWV.begin(); ditWV != traWV.end(); ditWV = traWV.next())
//	{
//		m_map.setCurrentLevel(m_map.getMaxLevel()) ;
//
//		Dart e = ditWV;
//		std::vector<Dart> v ;
//
//		do
//		{
//			v.push_back(m_map.phi1(e));
//			v.push_back(m_map.phi1(m_map.phi1(e)));
//
//			if(!m_map.PFP::MAP::ParentMap::isBoundaryEdge(m_map.phi1(e)))
//				subdividedFaces.push_back(std::pair<Dart,Dart>(m_map.phi1(e),m_map.phi2(m_map.phi1(e))));
//
//			if(!m_map.PFP::MAP::ParentMap::isBoundaryEdge(m_map.phi1(m_map.phi1(e))))
//				subdividedFaces.push_back(std::pair<Dart,Dart>(m_map.phi1(m_map.phi1(e)),m_map.phi2(m_map.phi1(m_map.phi1(e)))));
//
//			e = m_map.phi2(m_map.phi_1(e));
//		}
//		while(e != ditWV);
//
//		splitSurfaceInVolume(v);
//
//		Dart dd = m_map.phi2(m_map.phi1(ditWV));
//		Dart next = m_map.phi1(m_map.phi1(dd)) ;
//		m_map.PFP::MAP::ParentMap::splitFace(dd, next) ;
//
//		Dart ne = m_map.phi2(m_map.phi_1(dd));
//		m_map.PFP::MAP::ParentMap::cutEdge(ne) ;
//		centralDart = m_map.phi1(ne);
//
//		dd = m_map.phi1(m_map.phi1(next)) ;
//		while(dd != ne)
//		{
//			Dart tmp = m_map.phi1(ne) ;
//			m_map.PFP::MAP::ParentMap::splitFace(tmp, dd) ;
//			dd = m_map.phi1(m_map.phi1(dd)) ;
//		}
//
//		(*vertexVertexFunctor)(ditWV) ;
//
//		m_map.setCurrentLevel(m_map.getMaxLevel() - 1) ; //Utile ?
//	}
//
//	//m_map.setCurrentLevel(m_map.getMaxLevel()) ;
//	//DartMarkerNoUnmark mf(m_map);
//
//	m_map.setCurrentLevel(m_map.getMaxLevel()) ;
//	//4 couture des relations precedemment sauvegarde
//	for (std::vector<std::pair<Dart,Dart> >::iterator it = subdividedFaces.begin(); it != subdividedFaces.end(); ++it)
//	{
//		Dart f1 = m_map.phi2((*it).first);
//		Dart f2 = m_map.phi2((*it).second);
//
//		//if(isBoundaryFace(f1) && isBoundaryFace(f2))
//		if(m_map.phi3(f1) == f1 && m_map.phi3(f2) == f2)
//			m_map.sewVolumes(f1, f2, false);
//	}
//
//	m_map.template setOrbitEmbedding<VERTEX>(centralDart, m_map.template getEmbedding<VERTEX>(centralDart));
//	(*volumeVertexFunctor)(centralDart) ;
//
//	//A optimiser
//	m_map.setCurrentLevel(m_map.getMaxLevel()-1) ;
//	TraversorE<typename PFP::MAP> travE2(m_map);
//	for (Dart d = travE2.begin(); d != travE2.end(); d = travE2.next())
//	{
//		m_map.setCurrentLevel(m_map.getMaxLevel()) ;
//		m_map.setCurrentLevel(m_map.getMaxLevel()-1) ;
//		m_map.template setOrbitEmbedding<VERTEX>(m_map.phi1(d), m_map.template getEmbedding<VERTEX>(m_map.phi1(d)));
//	}
//	m_map.setCurrentLevel(m_map.getMaxLevel()) ;
//
//	m_map.setCurrentLevel(m_map.getMaxLevel()-1) ;
//	TraversorF<typename PFP::MAP> travF2(m_map) ;
//	for (Dart d = travF2.begin(); d != travF2.end(); d = travF2.next())
//	{
//		m_map.setCurrentLevel(m_map.getMaxLevel()) ;
//		m_map.template setOrbitEmbedding<VERTEX>(m_map.phi2(m_map.phi1(d)), m_map.template getEmbedding<VERTEX>(m_map.phi2(m_map.phi1(d))));
//		m_map.setCurrentLevel(m_map.getMaxLevel()-1) ;
//	}
//	m_map.setCurrentLevel(m_map.getMaxLevel()) ;
//
//	std::cout << std::endl;
//
//	m_map.popLevel();
1194
1195
1196
1197




untereiner's avatar
untereiner committed
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225


//void Map3MR_PrimalAdapt::saveRelationsAroundVertex(Dart d, std::vector<std::pair<Dart, Dart> >& vd)
//{
//	assert(getDartLevel(d) <= getCurrentLevel() || !"saveRelationsAroundVertex : called with a dart inserted after current level") ;
//
//	//le brin est forcement du niveau cur
//	Dart dit = d;
//
//	do
//	{
//		vd.push_back(std::pair<Dart,Dart>(dit,phi2(dit)));
//
//		dit = phi2(phi_1(dit));
//
//	}while(dit != d);
//}
//
//void Map3MR_PrimalAdapt::unsewAroundVertex(std::vector<std::pair<Dart, Dart> >& vd)
//{
//	//unsew the edge path
//	for(std::vector<std::pair<Dart, Dart> >::iterator it = vd.begin() ; it != vd.end() ; ++it)
//	{
//		Dart dit = (*it).first;
//		Dart dit2 = (*it).second;
//
//		Map2::unsewFaces(dit);
//
1226
//		if(isOrbitEmbedded<VERTEX>())
untereiner's avatar
untereiner committed
1227
//		{
Pierre Kraemer's avatar
Pierre Kraemer committed
1228
1229
//			copyDartEmbedding<VERTEX>(phi2(dit2), dit);
//			copyDartEmbedding<VERTEX>(phi2(dit), dit2);
untereiner's avatar
untereiner committed
1230
1231
//		}
//
1232
//		if(isOrbitEmbedded<EDGE>())
untereiner's avatar
untereiner committed
1233
1234
1235
1236
1237
1238
1239
1240
1241