29 using namespace GMap3d;
64 #define VTX(d) (AVertexDI < 0 ? findVertex(d) : \
65 (CAttributeVertex*)getDirectInfo(d, AVertexDI))
74 CDart *face, *d1, *d2, *d3, *iter, *best;
76 int mark = getNewMark();
77 list<CDart*> new_edges;
95 if (((v2 - v1) * (v3 - v1)).dot(normal) > 0.0) {
101 (isMarked(iter, mark) ||
109 if (coef > best_coef) {
126 assert(best != NULL);
134 new_edges.push_back(alpha1(d3));
135 if (ANewEdgesMark >= 0)
137 if (AVertexDI >= 0) {
145 while (!new_edges.empty()) {
147 swapEdge(new_edges.front(), AVertexDI);
148 new_edges.pop_front();
159 int mark = getNewMark();
163 if (isMarked(*dca, AMark) )
165 if (!isMarked(*dca, mark))
172 if (isFree0(*dcf) || isFree1(*dcf))
197 p[2] = *
VTX(alpha0(AEdge));
218 result = diff2 > diff1;
226 if ( isFree2(AEdge) || isFree1(AEdge) || isFree1(alpha0(AEdge)) ||
227 isFree1(alpha2(AEdge)) || isFree1(
alpha20(AEdge)) )
231 CDart *old[2] = {alpha1(d[0]), alpha1(d[1])};
234 for (
int i = 0; i < 2; i++) {
247 sew1(alpha2(d[i]), d2);
251 for (
int i = 0; i < 2; i++)
266 CPlane plane1(ANormal * (AVertex2 - AVertex1), AVertex1);
267 CPlane plane2(ANormal * (AVertex3 - AVertex2), AVertex2);
268 CPlane plane3(ANormal * (AVertex1 - AVertex3), AVertex3);
281 CVertex AB = AVertex2 - AVertex1;
282 CVertex AC = AVertex3 - AVertex1;
283 CVertex BC = AVertex3 - AVertex2;
289 CPlane plane(AB, (AVertex1 + AVertex2) / 2.0);
294 cerr <<
"CTriangulationTools::getTriangleCoef: "
295 <<
"Erreur dans le calcul du coefficient !" << endl
304 assert(coef >= 0.0 && coef < 1.0);