subdivision3.hpp 18 KB
Newer Older
untereiner's avatar
untereiner 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           *
untereiner's avatar
untereiner 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/                                           *
untereiner's avatar
untereiner committed
21
22
23
24
25
26
27
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/

#include "Algo/Geometry/centroid.h"
#include "Algo/Modelisation/subdivision.h"
#include "Algo/Modelisation/extrusion.h"
28
#include "Geometry/intersection.h"
untereiner's avatar
untereiner committed
29
30
31
32
33
34
35
36
37
38
39
40
41

namespace CGoGN
{

namespace Algo
{

namespace Modelisation
{

template <typename PFP>
Dart cut3Ear(typename PFP::MAP& map, Dart d)
{
Pierre Kraemer's avatar
Pierre Kraemer committed
42
43
44
45
46
47
48
49
	Dart e = d;
	int nb = 0;
	Dart dNew;

	Dart dRing;
	Dart dRing2;

	//count the valence of the vertex
untereiner's avatar
untereiner committed
50
51
	do
	{
Pierre Kraemer's avatar
Pierre Kraemer committed
52
53
54
		nb++;
		e = map.phi1(map.phi2(e));
	} while (e != d);
untereiner's avatar
untereiner committed
55

Pierre Kraemer's avatar
Pierre Kraemer committed
56
57
58
59
60
61
62
	if(nb < 3)
	{
		CGoGNout << "Warning : cannot cut 2 volumes without creating a degenerated face " << CGoGNendl;
		return d;
	}
	else
	{
63
64
		std::vector<Dart> vPath;

Pierre Kraemer's avatar
Pierre Kraemer committed
65
66
67
68
69
70
		//triangulate around the vertex
		do
		{
			Dart dN = map.phi1(map.phi2(e));
			if(map.template phi<111>(e) != e)
				map.splitFace(map.phi_1(e), map.phi1(e));
untereiner's avatar
untereiner committed
71

72
			dRing = map.phi2(map.phi1(e));
untereiner's avatar
untereiner committed
73

74
			vPath.push_back(dRing); //remember all darts from the ring
untereiner's avatar
untereiner committed
75

Pierre Kraemer's avatar
Pierre Kraemer committed
76
77
			e = dN;
		} while (e != d);
untereiner's avatar
untereiner committed
78

79
		map.splitVolume(vPath);
Pierre Kraemer's avatar
Pierre Kraemer committed
80
	}
untereiner's avatar
untereiner committed
81

Pierre Kraemer's avatar
Pierre Kraemer committed
82
83
	return map.phi2(dRing);
}
untereiner's avatar
untereiner committed
84

85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
template <typename PFP>
Dart sliceConvexVolume(typename PFP::MAP& map, typename PFP::TVEC3& position, Dart d, Geom::Plane3D<typename PFP::REAL > pl)
{
	Dart dRes=NIL;
	unsigned int nbInter = 0;
	unsigned int nbVertices = 0;
	CellMarkerStore vs(map, VERTEX);			//marker for new vertices from edge cut
	CellMarkerStore cf(map, FACE);
	Dart dPath;

	MarkerForTraversor<typename PFP::MAP::ParentMap > mte(map,EDGE);
	MarkerForTraversor<typename PFP::MAP::ParentMap > mtf(map,FACE);

	//search edges and vertices crossing the plane
	Traversor3WE<typename PFP::MAP::ParentMap > te(map,d);
	for(Dart dd = te.begin() ;dd != te.end() ; dd = te.next())
	{
		if(!mte.isMarked(dd))
		{
			if(fabs(pl.distance(position[dd]))<0.000001f)
			{
				nbVertices++;
				vs.mark(dd); //mark vertex on slicing path
				mte.mark(dd);
			}
			else
			{
				typename PFP::VEC3 interP;
				typename PFP::VEC3 vec(Algo::Geometry::vectorOutOfDart<PFP>(map,dd,position));
				Geom::Intersection inter = Geom::intersectionLinePlane<typename PFP::VEC3, typename Geom::Plane3D<typename PFP::REAL > >(position[dd],vec,pl,interP);

				if(inter==Geom::FACE_INTERSECTION)
				{
					Dart dOp = map.phi1(dd);
					typename PFP::VEC3 v2(interP-position[dd]);
					typename PFP::VEC3 v3(interP-position[dOp]);
					if(vec.norm2()>v2.norm2() && vec.norm2()>v3.norm2())
					{
						nbInter++;

						cf.mark(dd);			//mark face and opposite face to split
						cf.mark(map.phi2(dd));

						map.cutEdge(dd);
						Dart dN = map.phi1(dd);

						mte.mark(dN);

						vs.mark(dN);			//mark vertex for split
						position[dN] = interP; 	//place
					}
				}
			}
		}
	}

//	std::cout << "edges cut: " << nbInter << std::endl;
	unsigned int nbSplit=0;

	//slice when at least two edges are concerned
	if(nbInter>1)
	{
		Traversor3WF<typename PFP::MAP::ParentMap > tf(map,d);
		for(Dart dd = tf.begin() ; dd != tf.end() ; dd = tf.next())
		{
			//for faces with a new vertex
			if(cf.isMarked(dd))
			{
				cf.unmark(dd);

				Dart dS = dd;
				bool split=false;

158
159
				do
				{
160
161
162
163
164
					//find the new vertex
					if(vs.isMarked(dS))
					{
						Dart dSS = map.phi1(dS);
						//search an other new vertex (or an existing vertex intersected with the plane) in order to split the face
165
166
						do
						{
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
							if(vs.isMarked(dSS))
							{
								nbSplit++;
								map.splitFace(dS,dSS);
								dPath=map.phi_1(dS);
								split=true;
							}
							dSS = map.phi1(dSS);
						} while(!split && dSS!=dS);
					}
					dS = map.phi1(dS);
				} while(!split && dS!=dd);
			}
		}

//		std::cout << "face split " << nbSplit << std::endl;

		//define the path to split
		std::vector<Dart> vPath;
		vPath.reserve((nbSplit+nbVertices)+1);
		vPath.push_back(dPath);
		for(std::vector<Dart>::iterator it = vPath.begin() ;it != vPath.end() ; ++it)
		{
			Dart dd = map.phi1(*it);

			Dart ddd = map.phi1(map.phi2(dd));

			while(!vs.isMarked(map.phi1(ddd)) && ddd!=dd)
				ddd = map.phi1(map.phi2(ddd));

			if(vs.isMarked(map.phi1(ddd)) && !map.sameVertex(ddd,*vPath.begin()))
				vPath.push_back(ddd);
		}

		assert(vPath.size()>2);
		map.splitVolume(vPath);
		dRes = map.phi2(*vPath.begin());
	}

	return dRes;
}

209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
template <typename PFP>
Dart sliceConvexVolume(typename PFP::MAP& map, typename PFP::TVEC3& position, Dart d, CellMarker& edgesToCut, CellMarker& verticesToSplit)
{
	typedef typename PFP::VEC3 VEC3;

	Dart dRes;
	unsigned int nbInter = 0;
	unsigned int nbVertices = 0;
	CellMarkerStore vs(map, VERTEX);			//marker for new vertices from edge cut
	CellMarkerStore cf(map, FACE);
	Dart dPath;

	MarkerForTraversor<typename PFP::MAP::ParentMap > mte(map,EDGE);
	MarkerForTraversor<typename PFP::MAP::ParentMap > mtf(map,FACE);

	//search edges and vertices crossing the plane
	Traversor3WE<typename PFP::MAP::ParentMap > te(map,d);
	for(Dart dd = te.begin() ;dd != te.end() ; dd = te.next())
	{
		if(!mte.isMarked(dd) && edgesToCut.isMarked(dd))
		{
			nbInter++;
			VEC3 p = (position[dd]+position[map.phi1(dd)])*0.5f;
			cf.mark(dd);			//mark face and opposite face to split
			cf.mark(map.phi2(dd));

			map.cutEdge(dd);
			Dart dN = map.phi1(dd);

			mte.mark(dN);

			vs.mark(dN);		//mark vertex for split
			position[dN] = p;
		}
	}

//	std::cout << "edges cut: " << nbInter << std::endl;
	unsigned int nbSplit=0;

	//at least two edges are concerned
	assert(nbInter>1);

	Traversor3WF<typename PFP::MAP::ParentMap > tf(map,d);
	for(Dart dd = tf.begin() ; dd != tf.end() ; dd = tf.next())
	{
		//for faces with a new vertex
		if(cf.isMarked(dd))
		{
			cf.unmark(dd);

			Dart dS = dd;
			bool split=false;

			do {
				//find the new vertex
				if(vs.isMarked(dS) || verticesToSplit.isMarked(dS))
				{
					Dart dSS = map.phi1(dS);
					//search an other new vertex (or an existing vertex intersected with the plane) in order to split the face
					do {
						if(vs.isMarked(dSS) || verticesToSplit.isMarked(dSS))
						{
							nbSplit++;
							map.splitFace(dS,dSS);
							dPath=map.phi_1(dS);
							split=true;
						}
						dSS = map.phi1(dSS);
					} while(!split && dSS!=dS);
				}
				dS = map.phi1(dS);
			} while(!split && dS!=dd);
		}

		//define the path to split
		std::vector<Dart> vPath;
		vPath.reserve((nbSplit+nbVertices)+1);
		vPath.push_back(dPath);
		for(std::vector<Dart>::iterator it = vPath.begin() ;it != vPath.end() ; ++it)
		{
			Dart dd = map.phi1(*it);

			Dart ddd = map.phi1(map.phi2(dd));

			while(!vs.isMarked(map.phi1(ddd)) && ddd!=dd)
				ddd = map.phi1(map.phi2(ddd));

			if(vs.isMarked(map.phi1(ddd)) && !map.sameVertex(ddd,*vPath.begin()))
				vPath.push_back(ddd);
		}

		assert(vPath.size()>2);
		map.splitVolume(vPath);
		dRes = map.phi2(*vPath.begin());
	}

	return dRes;
}

template <typename PFP>
309
std::vector<Dart> sliceConvexVolumes(typename PFP::MAP& map, typename PFP::TVEC3& position,CellMarker& volumesToCut, CellMarker& edgesToCut, CellMarker& verticesToSplit)
310
{
311
	std::vector<Dart> vRes;
312
313

    typedef typename PFP::VEC3 VEC3;
314
    CellMarker localVerticesToSplit(map, VERTEX); //marker for new vertices from edge cut
315
316
317
318
319
320
321
322
323
324

    //Step 1: Cut the edges and mark the resulting vertices as vertices to be face-split
    TraversorE<typename PFP::MAP> te(map);
    CellMarkerStore cf(map, FACE);

    for(Dart d = te.begin(); d != te.end(); d=te.next()) //cut all edges
    {
        if(edgesToCut.isMarked(d))
        {
            VEC3 p = (position[d]+position[map.phi1(d)])*0.5f;
325
326
327
328
329

            //turn around the edge and mark for future split face
            Traversor3EF<typename PFP::MAP> t3ef(map,d);
            for(Dart dd = t3ef.begin() ; dd != t3ef.end() ; dd = t3ef.next())
            	cf.mark(dd);			//mark face to split
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350

            map.cutEdge(d);
            Dart dN = map.phi1(d);

            localVerticesToSplit.mark(dN);		//mark vertex for split
            position[dN] = p;
        }
    }

    //Step 2: Split faces with cut edges
    TraversorF<typename PFP::MAP> tf(map);
    for(Dart d = tf.begin(); d != tf.end(); d=tf.next())
    {
        if(cf.isMarked(d))
        {
            cf.unmark(d);
            Dart dS = d;
            bool split=false;
            do
            {
                //find the new vertex
351
                if(localVerticesToSplit.isMarked(dS) || verticesToSplit.isMarked(dS))
352
                {
353
354
                	//start from phi1(phi1()) to avoid the creation of faces of degree 2
                    Dart dSS = map.phi1(map.phi1(dS));
355
                    //search an other new vertex (or an existing vertex to split) in order to split the face
356

357
358
                    do
                    {
359
360
                        if((localVerticesToSplit.isMarked(dSS) || verticesToSplit.isMarked(dSS))
                        		&& !map.sameVertex(dS,dSS))
361
362
363
364
365
366
                        {
                            map.splitFace(dS,dSS);
                            split=true;
                        }
                        dSS = map.phi1(dSS);
                    } while(!split && dSS!=dS);
367
                    split=true; //go out of the first loop if no split case has been found
368
369
370
371
372
373
374
375
376
377
                }
                dS = map.phi1(dS);
            } while(!split && dS!=d);
        }
    }

    //Step 3 : Find path and split volumes
    TraversorW<typename PFP::MAP> tw(map);
    for(Dart d = tw.begin(); d != tw.end(); d=tw.next()) //Parcours des volumes
    {
378
379
        if(volumesToCut.isMarked(d))
        {
380
381
382
383
384
385
386
387
388
            Traversor3WV<typename PFP::MAP> t3wv(map,d);
            Dart dPath;
            bool found=false;

            //find a vertex of the volume to start the path to split
            for(Dart dd = t3wv.begin(); dd != t3wv.end() && !found; dd=t3wv.next())
            {
                if(localVerticesToSplit.isMarked(dd) || verticesToSplit.isMarked(dd))
                {
389
                    Dart ddd = dd;
390
                    while(!localVerticesToSplit.isMarked(map.phi1(ddd))
391
                    		&& !verticesToSplit.isMarked(map.phi1(ddd)))
392
393
394
395
396
397
398
                        ddd = map.phi1(map.phi2(ddd));
                    found=true;
                    dPath=ddd;
                }
            }
            //define the path to split
            std::vector<Dart> vPath;
399
            vPath.reserve(32);
400
401
402
            vPath.push_back(dPath);
            CellMarker cmf(map,FACE);

403

404
            //define the path to split for the whole volume
405
406
            bool pathFound=false;
            for(std::vector<Dart>::iterator it = vPath.begin() ; !pathFound && it != vPath.end(); ++it)
407
408
409
            {
                Dart dd = map.phi1(*it);

410
411
412
                if(map.sameVertex(dd,*vPath.begin()))
                	pathFound=true;
                else
413
                {
414
415
416
417
418
419
                	Dart ddd = map.phi1(map.phi2(dd));

                	while(!localVerticesToSplit.isMarked(map.phi1(ddd)) && !verticesToSplit.isMarked(map.phi1(ddd)))
                		ddd = map.phi1(map.phi2(ddd));

                	vPath.push_back(ddd);
420
421
422
423
424
                }
            }

            assert(vPath.size()>2);
            map.splitVolume(vPath);
425
            vRes.push_back(map.phi2(*vPath.begin()));
426
427
428
        }
    }

429
    return vRes;
430
431
}

untereiner's avatar
untereiner committed
432
433
434
template <typename PFP, typename EMBV, typename EMB>
void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelect& selected)
{
435
	//std::vector<Dart> l_centers;
untereiner's avatar
untereiner committed
436
437
438
	std::vector<Dart> l_vertices;

	//pre-computation : compute the centroid of all volume
439
	AutoAttributeHandler< EMB > attBary(map, VOLUME);
440
	TraversorW<typename PFP::MAP> traW(map, selected);
untereiner's avatar
untereiner committed
441
442

	for (Dart d = map.begin(); d != map.end(); map.next(d))
443
		attBary[d] = Algo::Geometry::volumeCentroidGen<PFP,EMBV,EMB>(map, d, attributs);
untereiner's avatar
untereiner committed
444

445
446
447
448
449
	//subdivision
	//1. cut edges
	DartMarkerNoUnmark mv(map);
	TraversorE<typename PFP::MAP> travE(map);
	for (Dart d = travE.begin(); d != travE.end(); d = travE.next())
untereiner's avatar
untereiner committed
450
451
452
453
454
	{
		//memorize each vertices per volumes
		if(selected(d) && !mv.isMarked(d))
		{
			l_vertices.push_back(d);
455
			mv.markOrbit(PFP::MAP::ORBIT_IN_PARENT(VERTEX),d);
untereiner's avatar
untereiner committed
456
457
		}

458
459
460
		Dart f = map.phi1(d);
		map.cutEdge(d) ;
		Dart e = map.phi1(d) ;
untereiner's avatar
untereiner committed
461

462
463
464
		attributs[e] =  attributs[d];
		attributs[e] += attributs[f];
		attributs[e] *= 0.5;
untereiner's avatar
untereiner committed
465

untereiner's avatar
untereiner committed
466
467
		travE.skip(d) ;
		travE.skip(e) ;
untereiner's avatar
untereiner committed
468
469
	}

470
471
472
	//2. split faces - quadrangule faces
	TraversorF<typename PFP::MAP> travF(map) ;
	for (Dart d = travF.begin(); d != travF.end(); d = travF.next())
untereiner's avatar
untereiner committed
473
	{
474
		EMB center = Algo::Geometry::faceCentroidGen<PFP,EMBV,EMB>(map,d,attributs);
untereiner's avatar
untereiner committed
475

476
477
478
		Dart dd = map.phi1(d) ;
		Dart next = map.phi1(map.phi1(dd)) ;
		map.splitFace(dd, next) ;
untereiner's avatar
untereiner committed
479

480
481
		Dart ne = map.phi2(map.phi_1(dd)) ;
		map.cutEdge(ne) ;
untereiner's avatar
untereiner committed
482
		travF.skip(dd) ;
untereiner's avatar
untereiner committed
483

484
		attributs[map.phi1(ne)] = center;
untereiner's avatar
untereiner committed
485

486
487
488
489
490
		dd = map.phi1(map.phi1(next)) ;
		while(dd != ne)
		{
			Dart tmp = map.phi1(ne) ;
			map.splitFace(tmp, dd) ;
untereiner's avatar
untereiner committed
491
			travF.skip(tmp) ;
492
			dd = map.phi1(map.phi1(dd)) ;
untereiner's avatar
untereiner committed
493
		}
494

untereiner's avatar
untereiner committed
495
		travF.skip(ne) ;
untereiner's avatar
untereiner committed
496
497
	}

498
499
500
501
	//3. create inside volumes

	std::vector<std::pair<Dart, Dart> > subdividedFaces;
	subdividedFaces.reserve(2048);
untereiner's avatar
untereiner committed
502
503
	for (std::vector<Dart>::iterator it = l_vertices.begin(); it != l_vertices.end(); ++it)
	{
504
505
506
		Dart e = *it;
		std::vector<Dart> v ;

untereiner's avatar
untereiner committed
507
508
		do
		{
509
510
511
512
513
			v.push_back(map.phi1(e));
			v.push_back(map.phi1(map.phi1(e)));

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

515
516
			if(!map.PFP::MAP::ParentMap::isBoundaryEdge(map.phi1(map.phi1(e))))
				subdividedFaces.push_back(std::pair<Dart,Dart>(map.phi1(map.phi1(e)),map.phi2(map.phi1(map.phi1(e)))));
untereiner's avatar
untereiner committed
517

518
			e = map.phi2(map.phi_1(e));
untereiner's avatar
untereiner committed
519
		}
520
		while(e != *it);
untereiner's avatar
untereiner committed
521

522
523
524
		//
		// SplitSurfaceInVolume
		//
untereiner's avatar
untereiner committed
525

526
527
		std::vector<Dart> vd2 ;
		vd2.reserve(v.size());
untereiner's avatar
untereiner committed
528

529
530
531
532
533
		// save the edge neighbors darts
		for(std::vector<Dart>::iterator it2 = v.begin() ; it2 != v.end() ; ++it2)
		{
			vd2.push_back(map.phi2(*it2));
		}
untereiner's avatar
untereiner committed
534

535
		assert(vd2.size() == v.size());
untereiner's avatar
untereiner committed
536

537
		map.PFP::MAP::ParentMap::splitSurface(v, true, false);
untereiner's avatar
untereiner committed
538

539
540
541
542
543
		// follow the edge path a second time to embed the vertex, edge and volume orbits
		for(unsigned int i = 0; i < v.size(); ++i)
		{
			Dart dit = v[i];
			Dart dit2 = vd2[i];
untereiner's avatar
untereiner committed
544

545
546
547
548
549
550
			// embed the vertex embedded from the origin volume to the new darts
			if(map.isOrbitEmbedded(VERTEX))
			{
				map.copyDartEmbedding(VERTEX, map.phi2(dit), map.phi1(dit));
				map.copyDartEmbedding(VERTEX, map.phi2(dit2), map.phi1(dit2));
			}
untereiner's avatar
untereiner committed
551

552
553
554
555
556
557
558
			// embed the edge embedded from the origin volume to the new darts
			if(map.isOrbitEmbedded(EDGE))
			{
				unsigned int eEmb = map.getEmbedding(EDGE, dit) ;
				map.setDartEmbedding(EDGE, map.phi2(dit), eEmb);
				map.setDartEmbedding(EDGE, map.phi2(dit2), eEmb);
			}
untereiner's avatar
untereiner committed
559

560
561
562
563
564
565
566
			// embed the volume embedded from the origin volume to the new darts
			if(map.isOrbitEmbedded(VOLUME))
			{
				map.copyDartEmbedding(VOLUME, map.phi2(dit), dit);
				map.copyDartEmbedding(VOLUME, map.phi2(dit2), dit2);
			}
		}
untereiner's avatar
untereiner committed
567

568
569
570
		//
		//
		//
untereiner's avatar
untereiner committed
571

572
573
574
		Dart dd = map.phi2(map.phi1(*it));
		Dart next = map.phi1(map.phi1(dd)) ;
		map.PFP::MAP::ParentMap::splitFace(dd, next);
untereiner's avatar
untereiner committed
575

576
577
578
579
580
581
582
583
		if (map.isOrbitEmbedded(VERTEX))
		{
			map.copyDartEmbedding(VERTEX, map.phi_1(next), dd) ;
			map.copyDartEmbedding(VERTEX, map.phi_1(dd), next) ;
		}

		Dart ne = map.phi2(map.phi_1(dd));
		map.PFP::MAP::ParentMap::cutEdge(ne);
untereiner's avatar
untereiner committed
584

untereiner's avatar
untereiner committed
585

586
587
//		dd = map.phi1(map.phi1(next)) ;
//		while(dd != ne)
untereiner's avatar
untereiner committed
588
//		{
589
590
591
592
593
594
595
596
597
598
//			Dart tmp = map.phi1(ne) ;
//			map.PFP::MAP::ParentMap::splitFace(tmp, dd);
//
//			if (map.isOrbitEmbedded(VERTEX))
//			{
//				map.copyDartEmbedding(VERTEX, map.phi_1(dd), tmp) ;
//				map.copyDartEmbedding(VERTEX, map.phi_1(tmp), dd) ;
//			}
//
//			dd = map.phi1(map.phi1(dd)) ;
untereiner's avatar
untereiner committed
599
//		}
600
601
//
	}
untereiner's avatar
untereiner committed
602

603
604
605
//		setCurrentLevel(getMaxLevel()) ;
//		//4 couture des relations precedemment sauvegarde
//		for (std::vector<std::pair<Dart,Dart> >::iterator it = subdividedFaces.begin(); it != subdividedFaces.end(); ++it)
untereiner's avatar
untereiner committed
606
//		{
607
608
609
610
611
612
//			Dart f1 = phi2((*it).first);
//			Dart f2 = phi2((*it).second);
//
//			//if(isBoundaryFace(f1) && isBoundaryFace(f2))
//			if(phi3(f1) == f1 && phi3(f2) == f2)
//				sewVolumes(f1, f2, false);
untereiner's avatar
untereiner committed
613
//		}
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
//		embedOrbit(VERTEX, centralDart, getEmbedding(VERTEX, centralDart));
		//attributs[map.phi1(ne)] = attBary[*it];
//
//		setCurrentLevel(getMaxLevel() - 1) ;
//	}
//
//	//A optimiser
//
//	TraversorE<typename PFP::MAP> travE2(map);
//	for (Dart d = travE2.begin(); d != travE2.end(); d = travE2.next())
//	{
//		map.embedOrbit(VERTEX, map.phi1(d), map.getEmbedding(VERTEX, map.phi1(d)));
//	}
//
//	TraversorF<typename PFP::MAP> travF2(map) ;
//	for (Dart d = travF2.begin(); d != travF2.end(); d = travF2.next())
//	{
//		map.embedOrbit(VERTEX, map.phi2(map.phi1(d)), map.getEmbedding(VERTEX, map.phi2(map.phi1(d))));
//	}


untereiner's avatar
untereiner committed
635
636
637
638
639
640
641
642
}

} //namespace Modelisation

} //namespace Algo

} //namespace CGoGN