25 #include "g-map-vertex.hh"
33 using namespace GMap3d;
44 for (CDynamicCoverageAll it(
FMap); it.cont(); ++it)
53 mergeMarkedCells(deleted, 3,
true);
78 CDart* current = NULL;
85 for (CDynamicCoverageAll it(
FMap); it.cont(); )
88 if (
FMap->isMarked(current,AMark2) )
92 getDartWithEmbedding(current),deleted);
93 FMap->delMapDart(current);
97 mergeMarkedCells(deleted, 3,
true);
102 for (CDynamicCoverageAll it(
FMap); it.cont(); )
106 if ( AMark0!=-1 &&
FMap->isMarked(current,AMark0) )
111 FMap->delMapDart(current);
113 else if ( AMark1!=-1 &&
FMap->isMarked(current,AMark1) )
118 FMap->delMapDart(current);
132 assert(1 <= ADim && ADim <= 3);
155 setMessage(nb, ADim, (nb == 1 ?
"-merge done" :
235 setMessage(
"Coplanar face merging impossible");
246 " edge removed between coplanar faces" :
247 " edges removed between coplanar faces"));
262 int nb =
FMap->deleteNullLengthEdges();
274 " null length edge removed" :
275 " null length edges removed");
290 int nb =
FMap->deleteFlatFaces();
302 " face made of two edges removed" :
303 " faces made of two edges removed");
318 int nb =
FMap->deleteFlatVolumes();
322 setMessage(
"No volume made of only two faces");
330 " volume made of two faces removed" :
331 " volumes made of two faces removed");
362 setMessage(nb, (nb == 1 ?
" 1-removal done" :
" 1-removals done"));
393 setMessage(nb, (nb == 1 ?
" 2-removal done" :
" 2-removals done"));
423 setMessage(nb, (nb == 1 ?
" edge shifted." :
" edges shifted."));
438 int nb =
FMap->removeDanglingEdges();
452 setMessage(nb, (nb == 1 ?
" dangling edge removed" :
453 " dangling edges removed"));
469 int nbdarts, nbvertices, nbedges, nbfaces, nbvolumes, nbcc;
471 &nbfaces,&nbvolumes,&nbcc,
472 NULL,NULL,NULL,NULL);
473 std::cout<<
"Map before simplification: darts="<<nbdarts
474 <<
", vertices="<<nbvertices
475 <<
", edges="<<nbedges
476 <<
", faces="<<nbfaces
477 <<
", volumes="<<nbvolumes
478 <<
", cc="<<nbcc<<std::endl;
485 m0=
FMap->getNewMark();
486 m1=
FMap->getNewMark();
494 int nb =
FMap->simplify2DObject(m0,m1);
498 c.display(
"Time for simplification");
504 setMessage(
"Nothing was simplified, the map was already in "
505 "its minimal form.");
520 setMessage(nb, (nb == 1 ?
" dart removed during the simplification." :
521 " darts removed during the simplification."));
525 &nbfaces,&nbvolumes,&nbcc,
526 NULL,NULL,NULL,NULL);
527 std::cout<<
"Map after simplification: darts="<<nbdarts
528 <<
", vertices="<<nbvertices
529 <<
", edges="<<nbedges
530 <<
", faces="<<nbfaces
531 <<
", volumes="<<nbvolumes
532 <<
", cc="<<nbcc<<std::endl;
547 int nbdarts, nbvertices, nbedges, nbfaces, nbvolumes, nbcc;
549 &nbfaces,&nbvolumes,&nbcc,
550 NULL,NULL,NULL,NULL);
551 std::cout<<
"Map before simplification: darts="<<nbdarts
552 <<
", vertices="<<nbvertices
553 <<
", edges="<<nbedges
554 <<
", faces="<<nbfaces
555 <<
", volumes="<<nbvolumes
556 <<
", cc="<<nbcc<<std::endl;
564 m0=
FMap->getNewMark();
565 m1=
FMap->getNewMark();
566 m2=
FMap->getNewMark();
576 nb =
FMap->simplify3DObject(m0, m1, m2);
578 nb =
FMap->simplify3DObject();
582 c.display(
"Time for simplification");
588 setMessage(
"Nothing was simplified, the map was already in "
589 "its minimal form.");
605 setMessage(nb, (nb == 1 ?
" dart removed during the simplification." :
606 " darts removed during the simplification."));
610 &nbfaces,&nbvolumes,&nbcc,
611 NULL,NULL,NULL,NULL);
612 std::cout<<
"Map after simplification: darts="<<nbdarts
613 <<
", vertices="<<nbvertices
614 <<
", edges="<<nbedges
615 <<
", faces="<<nbfaces
616 <<
", volumes="<<nbvolumes
617 <<
", cc="<<nbcc<<std::endl;
626 assert(1 <= ADimension && ADimension <= 3);
639 setMessage(ADimension,
"-contraction not possible");
647 setMessage(nb, ADimension, (nb == 1 ?
"-contraction done" :
648 "-contractions done"));
667 case ORBIT_EDGE : dim = 1;
break;
668 case ORBIT_FACE : dim = 2;
break;
669 case ORBIT_VOLUME : dim = 3;
break;
670 default:
setMessage(
"Selected orbit not correct");
return false;
685 setMessage(nb, dim, (nb == 1 ?
"-contraction done" :
686 "-contractions done"));
712 setMessage(nb, nb == 1 ?
" vertex inserted" :
" vertices inserted");
733 NULL, &dart1, &dart2) == 2)
735 if (!
FMap->isSameOrbit(dart1, dart2, ORBIT_VERTEX))
738 FMap->insertEdge(dart1, dart2);
753 setMessage(nb, nb == 1 ?
" edge inserted" :
" edges inserted");
780 setMessage(nb, nb == 1 ?
" face inserted" :
" faces inserted");
807 setMessage(nb, nb == 1 ?
" border closed" :
" borders closed");
826 setMessage(
"No ", ADimension,
"-border closed");
833 setMessage(nb, ADimension, nb == 1 ?
"-border closed" :