81{
82
85 if(polygon->
getPrev() == polygon)
86 return polygon;
88 return polygon;
90 return polygon;
91
92
94 topV = botV = polygon;
95 for(tempV = polygon->
getNext(); tempV != polygon; tempV = tempV->
getNext())
96 {
98 topV = tempV;
99 }
101 botV = tempV;
102 }
103 }
104
105
107
108
111 for(tempV=topV->
getNext(); tempV != botV; tempV = tempV->
getNext())
112 {
113 if(tempV->
head()[0] <
C->head()[0])
115
117 {
119 break;
120 }
121 }
123 {
125 if(
A->head()[0] <
C->head()[0])
127 }
128
129
130
133 for(tempV=topV->
getPrev(); tempV != botV; tempV = tempV->
getPrev())
134 {
135 if(tempV->
head()[0] >
D->head()[0])
138 {
140 break;
141 }
142 }
144 {
146 if(
B->head()[0] >
D->head()[0])
148 }
149
150
151 if(
C->head()[0] >=
D->head()[0])
152 return polygon;
153
154
157
160
161
164 while(1)
165 {
166
167
168 if(
A == botV &&
B == botV)
169 {
172 }
173 else
174 {
177 {
179 for(tempV =
C; tempV !=
D; tempV = tempV->
getPrev())
180 {
181 if(tempV->
head()[0] >=
A->head()[0])
182 {
184 break;
185 }
186 }
187
190 if(
E->head()[0]>
H->head()[0])
192
194 &ret_p1,
195 &ret_p2,
198 currentPolygon = ret_p1;
199
204 if(
G->head()[1] >=
A->head()[1])
206
207
209 for(tempV =
A->getNext(); tempV != botV; tempV = tempV->
getNext())
210 {
211
212 if(tempV->
head()[0] <
C->head()[0])
215 {
217 break;
218 }
219 }
220
221 if(tempV == botV)
222 {
224 if(botV->
head()[0] <
C->head()[0])
226 }
227
228
231 else
232 {
235 }
236
237 }
238 else
239 {
240
242 for(tempV =
D; tempV !=
C; tempV = tempV->
getNext())
243 {
244 if(tempV->
head()[0] <=
B->head()[0])
245 {
247 break;
248 }
249 }
252 if(
F->head()[0] <
G->head()[0])
254
255
257 &ret_p1,
258 &ret_p2,
261 currentPolygon = ret_p1;
263 if(
H ->
head()[1] >=
B->head()[1])
265
266
267
269 for(tempV =
B->getPrev(); tempV != botV; tempV = tempV->
getPrev())
270 {
271 if(tempV->
head()[0] >
D->head()[0])
274 {
276 break;
277 }
278 }
279 if(tempV == botV)
280 {
282 if(botV->
head()[0] >
D->head()[0])
284 }
285
288 else
289 {
292 }
293 }
294 }
295 }
296}
struct outqueuenode * head
#define G(r, i, a, b, c, d)
directedLine * insertPolygon(directedLine *newpolygon)
void connectDiagonal_2slines(directedLine *v1, directedLine *v2, directedLine **ret_p1, directedLine **ret_p2, directedLine *list)
Int compV2InY(Real A[2], Real B[2])
static Int is_u_maximal(directedLine *v)
static Int is_u_minimal(directedLine *v)