25 #ifdef MODULE_ROUNDING
28 #include "g-map-vertex.hh"
30 using namespace GMap3d;
32 void CControlerGMap::modeRoundingReinitAllCoefs()
34 if (!areRoundingCoefsAllocated())
43 int selected =
FMap->getNewMark();
44 FMap->negateMaskMark(selected);
45 FRounding->setRoundingCoefOfMarkedDarts(selected, 0, k0);
46 FRounding->setRoundingCoefOfMarkedDarts(selected, 1, k1);
47 FMap->negateMaskMark(selected);
48 FMap->freeMark(selected);
51 void CControlerGMap::modeRoundingSetCoefOfMarkedDarts(
int ADimension,
54 if (!areRoundingCoefsAllocated() || (ADimension!=0 && ADimension!=1))
61 bool CControlerGMap::modeRoundingGetCoefOfMarkedDarts(
int ADimension,
64 if (!areRoundingCoefsAllocated() || (ADimension!=0 && ADimension!=1))
71 TCoordinate CControlerGMap::modeRoundingSelectNextCoef(
int ADimension)
73 if (!areRoundingCoefsAllocated() || (ADimension!=0 && ADimension!=1))
78 TCoordinate coef = FRounding->selectNextRoundingCoef(mark, ADimension);
81 if (last != NULL && !
FMap->isMarked(last, mark))
89 void CControlerGMap::modeRoundingBegin()
91 assert(! areRoundingCoefsAllocated());
93 FRounding =
new CRoundingInterface(
FMap);
94 modeRoundingReinitAllCoefs();
97 void CControlerGMap::modeRoundingEnd()
99 assert(areRoundingCoefsAllocated());
105 bool CControlerGMap::areRoundingCoefsAllocated()
const
107 return FRounding != NULL;
110 void CControlerGMap::modeRoundingOperationStart()
116 void CControlerGMap::modeRoundingOperationMove()
120 void CControlerGMap::modeRoundingOperationStop()
124 bool CControlerGMap::modeRoundingRoundVertices(
bool ADig,
bool )
126 #ifndef MODULE_ROUNDING
129 #endif // MODULE_ROUNDING
130 assert(areRoundingCoefsAllocated());
137 int selected =
FMap->getNewMark();
140 int nb = FRounding->roundMarkedVertices(selected, ADig);
142 FMap->unmarkAll(selected);
143 FMap->freeMark(selected);
154 setMessage(nb, nb==1 ?
" vertex rounded" :
" vertices rounded");
155 modeRoundingReinitAllCoefs();
159 bool CControlerGMap::modeRoundingRoundEdges(
bool A3D,
bool ADig,
bool ASetback,
162 #ifndef MODULE_ROUNDING
165 #endif // MODULE_ROUNDING
166 assert(areRoundingCoefsAllocated());
173 int selected =
FMap->getNewMark();
176 int nb = FRounding->roundMarkedEdges(selected, A3D, ADig, ASetback);
178 FMap->unmarkAll(selected);
179 FMap->freeMark(selected);
190 setMessage(nb, nb==1 ?
" edge rounded" :
" edges rounded");
191 modeRoundingReinitAllCoefs();
195 #endif // MODULE_ROUNDING