29 using namespace GMap3d;
48 assert(ADim>=0 && ADim<=2);
56 assert(ADim>=0 && ADim<=2);
59 int mark = getNewMark();
62 CDart* current = NULL;
68 current = alpha((*it)++, ADim);
69 if ( !isMarked(current, mark) )
71 t2 = alpha(current, ADim);
72 while ( isMarked(t2, mark) )
74 t2 = alpha(alpha(t2, ADim+1), ADim);
77 if ( t2 != alpha(current, ADim) )
80 if (!isFree(t2, ADim)) unsew(t2, ADim);
81 if (current!=t2) sew(current, t2, ADim);
106 assert(ADim>=0 && ADim<=2);
111 for ( ; cov.
cont(); ++cov )
113 if ( isMarked(*cov, AMarkNumber) )
123 CDart* current = NULL;
128 if ( !isMarked( *cov, AMarkNumber) &&
129 isMarked( alpha(*cov, ADim), AMarkNumber) )
132 t2 = alpha(current, ADim);
134 while (isMarked(t2, AMarkNumber))
136 t2 = alpha(alpha(t2, ADim+1), ADim);
139 if ( t2 != alpha(current, ADim) )
141 unsew(current, ADim);
142 if ( !isFree(t2, ADim) ) unsew(t2, ADim);
143 if ( t2!=current ) sew(current, t2, ADim);
152 if ( isMarked(*cov, AMarkNumber) )
165 int toDelete = getNewMark();
166 int fictiveEdge = getNewMark();
167 int treated = getNewMark();
169 CDart* current = NULL;
180 if ( !isMarked(current, treated) )
183 if ( !isFree2(current) &&
184 alpha1(current)!=alpha2(current) &&
186 isSameOrbit(current, alpha2(current),
ORBIT_FACE) )
188 assert( isFree3(current) );
200 if ( isMarked(current, AMarkNumber) && !isMarked(current, toDelete) )
205 ( aDart, fictiveEdge );
209 remove( aDart, 0, false );
219 unsetMark(*cov, fictiveEdge);
220 unsetMark(*cov, treated);
222 if ( isMarked(*cov, toDelete) )
230 freeMark(fictiveEdge);
238 bool disconnect =
false;
239 int toDelete = getNewMark();
241 CDart* current = NULL;
246 std::stack<CDart*> FToTreat;
251 while ( ! FToTreat.empty() )
253 current = FToTreat.top();
256 if ( isMarked(current, AMarkNumber) && !isMarked(current, toDelete) )
258 if ( (alpha1(current) !=alpha2(current) ||
263 FToTreat.push(alpha1(current));
266 FToTreat.push(
alpha01(current));
268 remove(current, 1,
false);
276 if ( isMarked(current, AMarkNumber) && !isMarked(current, toDelete) )
283 if ( alpha1(current)==alpha2(current) &&
289 else if ( alpha1(current) ==alpha2(current) ||
298 it.
cont() && !disconnect; ++it)
299 if (*it==alpha2(current)) disconnect =
true;
305 FToTreat.push(alpha1(current));
308 FToTreat.push(
alpha01(current));
310 remove(current, 1,
false);
320 if ( isMarked(*cov, toDelete) )
338 int toDelete = getNewMark();
339 int treated = getNewMark();
341 CDart* current = NULL;
349 int index = getNewDirectInfo();
351 else std::cout<<
"Not enough directInfo to use union-find trees."<<std::endl;
362 if ( isMarked(current, AMarkNumber) &&
363 !isMarked(current, toDelete) &&
364 ( (alpha1(current) !=alpha2(current) ||
369 (!isSameOrbit(current, alpha2(current),
ORBIT_FACE))) )
372 remove(current, 1,
false);
379 if ( !isMarked(current, toDelete) && !isMarked(current, treated) )
390 unsetMark(*cov, treated);
392 if ( isMarked(*cov, toDelete) ) delMapDart(cov++);
399 if ( index!=-1 ) freeDirectInfo(index);
403 c.
display(
"Temps de simplification");
412 int toDelete = getNewMark();
413 int treated = getNewMark();
415 CDart* current = NULL;
417 int fictiveFaces = getNewMark();
418 int markFace = getNewMark();
421 bool existFictiveDart;
436 if ( isMarked(current, AMarkNumber) &&
437 !isMarked(current, toDelete) &&
438 ( (alpha1(current) !=alpha2(current) ||
441 !isSameOrbit(current, alpha2(current),
ORBIT_FACE) )
444 remove(current, 1,
false);
448 if ( !isMarked(current, toDelete) && !isMarked(current, treated) )
453 if ( !isFree3(current) &&
465 if ( isMarked(current, AMarkNumber) && !isMarked(current, toDelete) )
467 if ( (res=
findEdgeType(current, &aDart, fictiveFaces))==2 &&
472 remove(aDart, 1,
false);
478 if ( isMarked(alpha2(aDart), fictiveFaces) )
483 remove(aDart, 1,
false);
490 negateMaskMark(treated);
497 if ( !isMarked(current, toDelete) && !isMarked(current, treated) )
499 existFictiveDart =
false;
503 if ( !isMarked(*it, treated) )
505 setMark(*it, treated);
506 if ( isMarked(*it, fictiveFaces ) )
508 existFictiveDart =
true;
515 if ( isMarked(*it2, markFace) )
517 setMark(*it2, treated);
524 if ( (nbDarts/4)%2==1 )
531 if ( generator || !existFictiveDart )
541 unsetMark(*cov, fictiveFaces);
542 unsetMark(*cov, treated);
543 unsetMark(*cov, markFace);
545 if ( isMarked(*cov, toDelete) )
553 freeMark(fictiveFaces);
561 treated=getNewMark();
562 negateMaskMark(treated);
564 negateMaskMark(treated);
574 int toDelete = getNewMark();
575 int treated = getNewMark();
576 int toTreat2 = getNewMark();
578 CDart* current = NULL;
579 std::stack<CDart*> FToTreat;
580 bool dangling =
false;
590 if ( ! FToTreat.empty() )
592 current = FToTreat.top();
604 if ( isMarked(current, AMarkNumber) && !isFree3(current) &&
605 !isMarked(current, toDelete) && !isMarked(current, treated) )
616 for ( ; itFace.
cont(); ++itFace )
618 setMark( *itFace, treated );
619 setMark( alpha3(*itFace), treated );
621 if (
alpha23(*itFace)==*itFace ) dangling =
true;
630 for ( itFace.
reinit(); itFace.
cont(); ++itFace )
632 if (
alpha23(*itFace)!=*itFace )
634 if ( isMarked(alpha2(*itFace), treated) )
636 FToTreat.push(alpha2(*itFace));
639 if ( isMarked(
alpha32(*itFace), treated) )
641 FToTreat.push(
alpha32(*itFace));
646 setMark( *itFace, toDelete );
647 setMark( alpha3(*itFace), toDelete );
651 remove(current, 2,
false);
662 unsetMark( current, treated );
664 if ( isMarked(current, AMarkNumber) && !isMarked(current, toDelete) &&
720 unsetMark( current, treated );
723 if ( isMarked(current, toDelete) )