3 #ifndef tools_glutess_sweep
4 #define tools_glutess_sweep
30 #define RegionBelow(r) ((ActiveRegion *) dictKey(dictPred((r)->nodeUp)))
31 #define RegionAbove(r) ((ActiveRegion *) dictKey(dictSucc((r)->nodeUp)))
41 #define DebugEvent( tess )
76 #define AddWinding(eDst,eSrc) (eDst->winding += eSrc->winding, \
77 eDst->Sym->winding += eSrc->Sym->winding)
104 if( e1->Dst == event ) {
105 if( e2->Dst == event ) {
116 if( e2->Dst == event ) {
164 }
while( reg->
eUp->
Org == org );
171 if (e == NULL)
return NULL;
185 }
while( reg->
eUp->Dst == dst );
200 if (regNew == NULL) longjmp(tess->
env,1);
202 regNew->
eUp = eNewUp;
205 if (regNew->
nodeUp == NULL) longjmp(tess->
env,1);
226 return (n >= 2) || (n <= -2);
279 ePrev = regFirst->
eUp;
280 while( regPrev != regLast ) {
284 if( e->
Org != ePrev->
Org ) {
299 if (e == NULL) longjmp(tess->
env,1);
304 if( ePrev->
Onext != e ) {
340 }
while ( e != eLast );
346 if( eTopLeft == NULL ) {
354 if( e->
Org != ePrev->
Org )
break;
356 if( e->
Onext != ePrev ) {
389 void *data[4],
GLUfloat weights[4],
int needed )
394 coords[0] = isect->
coords[0];
395 coords[1] = isect->
coords[1];
396 coords[2] = isect->
coords[2];
400 if( isect->
data == NULL ) {
402 isect->
data = data[0];
421 void *data[4] = { NULL, NULL, NULL, NULL };
422 GLUfloat weights[4] = { 0.5, 0.5, 0.0, 0.0 };
443 weights[0] = float(0.5 * t2 / (t1 + t2));
444 weights[1] = float(0.5 * t1 / (t1 + t2));
463 data[0] = orgUp->
data;
464 data[1] = dstUp->
data;
465 data[2] = orgLo->
data;
466 data[3] = dstLo->
data;
516 }
else if( eUp->
Org != eLo->
Org ) {
557 assert( !
VertEq( eUp->Dst, eLo->Dst ));
559 if(
VertLeq( eUp->Dst, eLo->Dst )) {
565 if (e == NULL) longjmp(tess->
env,1);
574 if (e == NULL) longjmp(tess->
env,1);
576 e->Rface->inside = regUp->
inside;
604 assert( !
VertEq( dstLo, dstUp ));
607 assert( orgUp != tess->
event && orgLo != tess->
event );
627 assert(
GLU_MIN( orgUp->
t, dstUp->
t ) <= isect.
t );
628 assert( isect.
t <=
GLU_MAX( orgLo->
t, dstLo->
t ));
629 assert(
GLU_MIN( dstLo->
s, dstUp->
s ) <= isect.
s );
630 assert( isect.
s <=
GLU_MAX( orgLo->
s, orgUp->
s ));
648 orgMin =
VertLeq( orgUp, orgLo ) ? orgUp : orgLo;
649 if(
VertLeq( orgMin, &isect )) {
654 if(
VertEq( &isect, orgUp ) ||
VertEq( &isect, orgLo )) {
669 if( dstLo == tess->
event ) {
674 if (regUp == NULL) longjmp(tess->
env,1);
680 if( dstUp == tess->
event ) {
687 regLo->
eUp = eLo->Oprev;
723 eUp->
Org->
s = isect.
s;
724 eUp->
Org->
t = isect.
t;
729 longjmp(tess->
env,1);
751 while( regLo->
dirty ) {
755 if( ! regUp->
dirty ) {
758 if( regUp == NULL || ! regUp->
dirty ) {
767 if( eUp->Dst != eLo->Dst ) {
788 if( eUp->
Org != eLo->
Org ) {
789 if( eUp->Dst != eLo->Dst
791 && (eUp->Dst == tess->
event || eLo->Dst == tess->
event) )
812 if( eUp->
Org == eLo->
Org && eUp->Dst == eLo->Dst ) {
864 if( eUp->Dst != eLo->Dst ) {
874 if (regUp == NULL) longjmp(tess->
env,1);
898 if (eNew == NULL) longjmp(tess->
env,1);
938 if( !
VertEq( e->Dst, vEvent )) {
957 eTopRight = reg->
eUp->
Sym;
958 eTopLeft = eLast = eTopRight->
Onext;
963 assert( eTopLeft != eTopRight );
966 eTopRight = eTopLeft->Oprev;
1009 if(
EdgeSign( eUp->Dst, vEvent, eUp->
Org ) == 0 ) {
1017 reg =
VertLeq( eLo->Dst, eUp->Dst ) ? regUp : regLo;
1020 if( reg == regUp ) {
1022 if (eNew == NULL) longjmp(tess->
env,1);
1025 if (tempHalfEdge == NULL) longjmp(tess->
env,1);
1027 eNew = tempHalfEdge->
Sym;
1053 tess->
event = vEvent;
1063 if( e == vEvent->
anEdge ) {
1078 if (regUp == NULL) longjmp(tess->
env,1);
1080 eTopLeft = reg->
eUp;
1088 if( eBottomLeft->
Onext == eTopLeft ) {
1116 if (reg == NULL) longjmp(tess->
env,1);
1119 if (e == NULL) longjmp(tess->
env,1);
1125 tess->
event = e->Dst;
1134 if (reg->
nodeUp == NULL) longjmp(tess->
env,1);
1146 if (tess->
dict == NULL) longjmp(tess->
env,1);
1174 assert( fixedEdges == 1 );
1194 for( e = eHead->
next; e != eHead; e = eNext ) {
1206 if( eLnext->
Lnext == e ) {
1210 if( eLnext == eNext || eLnext == eNext->
Sym ) { eNext = eNext->
next; }
1213 if( e == eNext || e == eNext->
Sym ) { eNext = eNext->
next; }
1230 if (pq == NULL)
return 0;
1233 for( v = vHead->
next; v != vHead; v = v->
next ) {
1235 if (v->
pqHandle == LONG_MAX)
break;
1237 if (v != vHead || !
pqInit( pq ) ) {
1276 assert( e->
Lnext != e );
1314 if( vNext == NULL || !
VertEq( vNext, v ))
break;