50 #include "directedLine.h"
51 #include "monoPolyPart.h"
58 if (compV2InX(v->getPrev()->head(), v->head()) == -1 &&
59 compV2InX(v->getNext()->head(), v->head()) == -1)
70 if (compV2InX(v->getPrev()->head(), v->head()) == 1 &&
71 compV2InX(v->getNext()->head(), v->head()) == 1)
85 if(polygon->getPrev() == polygon)
87 if(polygon->getPrev() == polygon->getNext())
89 if(polygon->getPrev()->getPrev() == polygon->getNext())
94 topV = botV = polygon;
95 for(tempV = polygon->getNext(); tempV != polygon; tempV = tempV->getNext())
97 if(compV2InY(topV->head(), tempV->head())<0) {
100 if(compV2InY(botV->head(), tempV->head())>0) {
111 for(tempV=topV->getNext(); tempV != botV; tempV = tempV->getNext())
113 if(tempV->head()[0] < C->head()[0])
116 if(is_u_maximal(tempV))
125 if(A->head()[0] < C->head()[0])
133 for(tempV=topV->getPrev(); tempV != botV; tempV = tempV->getPrev())
135 if(tempV->head()[0] > D->head()[0])
137 if(is_u_minimal(tempV))
146 if(B->head()[0] > D->head()[0])
151 if(C->head()[0] >= D->head()[0])
155 for(tempV=topV; compV2InY(tempV->head(), B->head()) == 1; tempV=tempV->getNext());
156 G = tempV->getPrev();
158 for(tempV=topV; compV2InY(tempV->head(), A->head()) == 1; tempV = tempV->getPrev());
159 H = tempV->getNext();
168 if(A == botV && B == botV)
170 ret = currentPolygon->insertPolygon(ret);
176 if(compV2InY(A->head(),B->head()) == 1)
179 for(tempV = C; tempV != D; tempV = tempV->getPrev())
181 if(tempV->head()[0] >= A->head()[0])
190 if(E->head()[0]> H->head()[0])
193 polygon->connectDiagonal_2slines(A, E,
197 ret = ret_p2->insertPolygon(ret);
198 currentPolygon = ret_p1;
204 if(G->head()[1] >= A->head()[1])
209 for(tempV = A->getNext(); tempV != botV; tempV = tempV->getNext())
212 if(tempV->head()[0] < C->head()[0])
214 if(is_u_maximal(tempV))
224 if(botV->head()[0] < C->head()[0])
233 for(tempV = H; compV2InY(tempV->head(), A->head()) == 1; tempV = tempV->getPrev());
234 H = tempV->getNext();
242 for(tempV = D; tempV != C; tempV = tempV->getNext())
244 if(tempV->head()[0] <= B->head()[0])
252 if(F->head()[0] < G->head()[0])
256 polygon->connectDiagonal_2slines(F, B,
260 ret = ret_p2->insertPolygon(ret);
261 currentPolygon = ret_p1;
263 if(H ->head()[1] >= B->head()[1])
269 for(tempV = B->getPrev(); tempV != botV; tempV = tempV->getPrev())
271 if(tempV->head()[0] > D->head()[0])
273 if(is_u_minimal(tempV))
282 if(botV->head()[0] > D->head()[0])
290 for(tempV = G; compV2InY(tempV->head(), B->head()) == 1; tempV = tempV->getNext());
291 G = tempV->getPrev();