52 return bbox(
a->param[
p],
b->param[
p],
c->param[
p],
53 a->param[1-
p],
b->param[1-
p],
c->param[1-
p] );
62 TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1];
71 _glu_dprintf(
"arc_ccw_turn, p = %d\n", 0 );
75 if(
v1->param[0] == v1next->
param[0] &&
v2->param[0] == v2next->
param[0] )
78 if( v2next->
param[0] <
v2->param[0] || v1next->
param[0] <
v1->param[0] )
81 if(
v1->param[1] <
v2->param[1] )
83 else if(
v1->param[1] >
v2->param[1] )
89 _glu_dprintf(
"case a\n" );
93 switch(
bbox(
v2, v2next, v1next, 1 ) ) {
102 _glu_dprintf(
"decr\n" );
107 _glu_dprintf(
"no good results\n" );
116 }
else if( v1next->
param[0] > v2next->
param[0] ) {
118 _glu_dprintf(
"case b\n" );
122 switch(
bbox(
v1, v1next, v2next, 1 ) ) {
131 _glu_dprintf(
"incr\n" );
136 _glu_dprintf(
"no good results\n" );
147 _glu_dprintf(
"case ab\n" );
151 else if( v1next->
param[1] > v2next->
param[1] )
155 _glu_dprintf(
"incr\n" );
160 _glu_dprintf(
"no good results\n" );
175 TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1];
184 _glu_dprintf(
"arc_ccw_turn, p = %d\n", 0 );
188 if(
v1->param[0] == v1next->
param[0] &&
v2->param[0] == v2next->
param[0] )
191 if( v2next->
param[0] >
v2->param[0] || v1next->
param[0] >
v1->param[0] )
194 if(
v1->param[1] <
v2->param[1] )
196 else if(
v1->param[1] >
v2->param[1] )
202 _glu_dprintf(
"case c\n" );
206 switch(
bbox( v2next,
v2, v1next, 1 ) ) {
216 _glu_dprintf(
"decr\n" );
220 _glu_dprintf(
"no good results\n" );
229 }
else if( v1next->
param[0] < v2next->
param[0] ) {
231 _glu_dprintf(
"case d\n" );
235 switch(
bbox( v1next,
v1, v2next, 1 ) ) {
245 _glu_dprintf(
"incr\n" );
249 _glu_dprintf(
"no good results\n" );
260 _glu_dprintf(
"case cd\n" );
264 else if( v1next->
param[1] > v2next->
param[1] )
269 _glu_dprintf(
"incr\n" );
273 _glu_dprintf(
"no good results\n" );
288 TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1];
297 _glu_dprintf(
"arc_ccw_turn, p = %d\n", 1 );
301 if(
v1->param[1] == v1next->
param[1] &&
v2->param[1] == v2next->
param[1] )
304 if( v2next->
param[1] <
v2->param[1] || v1next->
param[1] <
v1->param[1] )
307 if(
v1->param[0] <
v2->param[0] )
309 else if(
v1->param[0] >
v2->param[0] )
315 _glu_dprintf(
"case a\n" );
319 switch(
bbox(
v2, v2next, v1next, 0 ) ) {
328 _glu_dprintf(
"decr\n" );
333 _glu_dprintf(
"no good results\n" );
342 }
else if( v1next->
param[1] > v2next->
param[1] ) {
344 _glu_dprintf(
"case b\n" );
348 switch(
bbox(
v1, v1next, v2next, 0 ) ) {
357 _glu_dprintf(
"incr\n" );
362 _glu_dprintf(
"no good results\n" );
373 _glu_dprintf(
"case ab\n" );
377 else if( v1next->
param[0] > v2next->
param[0] )
381 _glu_dprintf(
"incr\n" );
386 _glu_dprintf(
"no good results\n" );
401 TrimVertex *v2last = &j2->pwlArc->pts[j2->pwlArc->npts-1];
410 _glu_dprintf(
"arc_ccw_turn, p = %d\n", 1 );
414 if(
v1->param[1] == v1next->
param[1] &&
v2->param[1] == v2next->
param[1] )
417 if( v2next->
param[1] >
v2->param[1] || v1next->
param[1] >
v1->param[1] )
420 if(
v1->param[0] <
v2->param[0] )
422 else if(
v1->param[0] >
v2->param[0] )
428 _glu_dprintf(
"case c\n" );
432 switch(
bbox( v2next,
v2, v1next, 0 ) ) {
442 _glu_dprintf(
"decr\n" );
446 _glu_dprintf(
"no good results\n" );
455 }
else if( v1next->
param[1] < v2next->
param[1] ) {
457 _glu_dprintf(
"case d\n" );
461 switch(
bbox( v1next,
v1, v2next, 0 ) ) {
471 _glu_dprintf(
"incr\n" );
475 _glu_dprintf(
"no good results\n" );
486 _glu_dprintf(
"case cd\n" );
490 else if( v1next->
param[0] > v2next->
param[0] )
495 _glu_dprintf(
"incr\n" );
499 _glu_dprintf(
"no good results\n" );
525 }
else if(
sb <= sc ) {
530 }
else if(
sa >
sb ) {
533 }
else if(
sb >= sc ) {
541 }
else if(
sb > sc ) {
561 if(
glu_abs(
d) < 0.0001 )
return -1;
562 return (
d < 0.0) ? 0 : 1;
static struct sockaddr_in sa
static int ccw(TrimVertex *, TrimVertex *, TrimVertex *)
int ccwTurn_sr(Arc_ptr, Arc_ptr)
int bbox(TrimVertex *, TrimVertex *, TrimVertex *, int)
int ccwTurn_tl(Arc_ptr, Arc_ptr)
int ccwTurn_sl(Arc_ptr, Arc_ptr)
int ccwTurn_tr(Arc_ptr, Arc_ptr)
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLfloat GLfloat GLfloat v2
REAL det3(TrimVertex *a, TrimVertex *b, TrimVertex *c)