Go to the documentation of this file.
3 #ifndef tools_glutess_geom
4 #define tools_glutess_geom
8 #define VertEq(u,v) ((u)->s == (v)->s && (u)->t == (v)->t)
9 #define VertLeq(u,v) (((u)->s < (v)->s) || ((u)->s == (v)->s && (u)->t <= (v)->t))
11 #define EdgeEval(u,v,w) __gl_edgeEval(u,v,w)
12 #define EdgeSign(u,v,w) __gl_edgeSign(u,v,w)
16 #define TransLeq(u,v) (((u)->t < (v)->t) || \
17 ((u)->t == (v)->t && (u)->s <= (v)->s))
18 #define TransEval(u,v,w) __gl_transEval(u,v,w)
19 #define TransSign(u,v,w) __gl_transSign(u,v,w)
22 #define EdgeGoesLeft(e) VertLeq( (e)->Dst, (e)->Org )
23 #define EdgeGoesRight(e) VertLeq( (e)->Org, (e)->Dst )
25 #define VertL1dist(u,v) (GLU_ABS(u->s - v->s) + GLU_ABS(u->t - v->t))
27 #define VertCCW(u,v,w) __gl_vertCCW(u,v,w)
59 if( gapL + gapR > 0 ) {
61 return (v->
t - u->
t) + (u->
t - w->
t) * (gapL / (gapL + gapR));
63 return (v->
t - w->
t) + (w->
t - u->
t) * (gapR / (gapL + gapR));
87 if( gapL + gapR > 0 ) {
88 return (v->
t - w->
t) * gapL + (v->
t - u->
t) * gapR;
118 if( gapL + gapR > 0 ) {
120 return (v->
s - u->
s) + (u->
s - w->
s) * (gapL / (gapL + gapR));
122 return (v->
s - w->
s) + (w->
s - u->
s) * (gapR / (gapL + gapR));
142 if( gapL + gapR > 0 ) {
143 return (v->
s - w->
s) * gapL + (v->
s - u->
s) * gapR;
158 return (u->
s*(v->
t - w->
t) + v->
s*(w->
t - u->
t) + w->
s*(u->
t - v->
t)) >= 0;
169 #define Interpolate(a,x,b,y) \
170 (a = (a < 0) ? 0 : a, b = (b < 0) ? 0 : b, \
171 ((a <= b) ? ((b == 0) ? ((x+y) / 2) \
172 : (x + (y-x) * (a/(a+b)))) \
173 : (y + (x-y) * (b/(a+b)))))
176 #define Swap(a,b) do { GLUvertex *t = a; a = b; b = t; } while(false)
202 v->
s = (o2->
s + d1->
s) / 2;
203 }
else if(
VertLeq( d1, d2 )) {
207 if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; }
213 if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; }
225 v->
t = (o2->
t + d1->
t) / 2;
230 if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; }
236 if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; }
int __gl_vertCCW(GLUvertex *u, GLUvertex *v, GLUvertex *w)
int __gl_vertLeq(GLUvertex *u, GLUvertex *v)
inlined C code : ///////////////////////////////////
#define EdgeEval(u, v, w)
void __gl_edgeIntersect(GLUvertex *o1, GLUvertex *d1, GLUvertex *o2, GLUvertex *d2, GLUvertex *v)
GLUdouble __gl_transSign(GLUvertex *u, GLUvertex *v, GLUvertex *w)
#define EdgeSign(u, v, w)
GLUdouble __gl_edgeEval(GLUvertex *u, GLUvertex *v, GLUvertex *w)
GLUdouble __gl_transEval(GLUvertex *u, GLUvertex *v, GLUvertex *w)
#define Interpolate(a, x, b, y)
GLUdouble __gl_edgeSign(GLUvertex *u, GLUvertex *v, GLUvertex *w)
#define TransEval(u, v, w)
#define TransSign(u, v, w)