98 if(
f->inside && !
f->marked ) {
127 newFace =
MaximumFan(
e );
if( newFace.
size > max.size ) { max = newFace; }
128 newFace =
MaximumFan(
e->Lnext );
if( newFace.
size > max.size ) { max = newFace; }
129 newFace =
MaximumFan(
e->Lprev );
if( newFace.
size > max.size ) { max = newFace; }
132 newFace =
MaximumStrip(
e->Lnext );
if( newFace.
size > max.size ) { max = newFace; }
133 newFace =
MaximumStrip(
e->Lprev );
if( newFace.
size > max.size ) { max = newFace; }
135 (*(max.render))( tess, max.eStart, max.size );
146#define Marked(f) (! (f)->inside || (f)->marked)
148#define AddToTrail(f,t) ((f)->trail = (t), (t) = (f), (f)->marked = TRUE)
150#define FreeTrail(t) do { \
151 while( (t) != NULL ) { \
152 (t)->marked = FALSE; t = (t)->trail; \
168 for(
e = eOrig; !
Marked(
e->Lface );
e =
e->Onext ) {
172 for(
e = eOrig; !
Marked(
e->Rface );
e =
e->Oprev ) {
183#define IsEven(n) (((n) & 1) == 0)
198 long headSize = 0, tailSize = 0;
202 for(
e = eOrig; !
Marked(
e->Lface ); ++tailSize,
e =
e->Onext ) {
211 for(
e = eOrig; !
Marked(
e->Rface ); ++headSize,
e =
e->Dnext ) {
220 newFace.
size = tailSize + headSize;
223 }
else if(
IsEven( headSize )) {
260 for( ;
f != NULL;
f =
f->trail ) {
269 newState = !
e->Rface->inside;
270 if( edgeState != newState ) {
271 edgeState = newState;
278 }
while(
e !=
f->anEdge );
295 e->Lface->marked =
TRUE;
318 e->Lface->marked =
TRUE;
324 e->Lface->marked =
TRUE;
354 }
while(
e !=
f->anEdge );
363#define SIGN_INCONSISTENT 2
378 GLdouble dot, xc, yc, zc, xp, yp, zp,
n[3];
395 norm[0] = norm[1] = norm[2] = 0.0;
403 xp = xc; yp = yc; zp = zc;
409 n[0] = yp*zc - zp*yc;
410 n[1] = zp*xc - xp*zc;
411 n[2] = xp*yc - yp*xc;
413 dot =
n[0]*norm[0] +
n[1]*norm[1] +
n[2]*norm[2];
419 norm[0] +=
n[0]; norm[1] +=
n[1]; norm[2] +=
n[2];
421 norm[0] -=
n[0]; norm[1] -=
n[1]; norm[2] -=
n[2];
423 }
else if( dot != 0 ) {
457 norm[0] = tess->
normal[0];
458 norm[1] = tess->
normal[1];
459 norm[2] = tess->
normal[2];
460 if( norm[0] == 0 && norm[1] == 0 && norm[2] == 0 ) {
480 if( sign < 0 )
return TRUE;
483 if( sign > 0 )
return TRUE;
495 for( vc =
v0+1; vc < vn; ++vc ) {
499 for( vc = vn-1; vc >
v0; --vc ) {
#define GLU_TESS_WINDING_NONZERO
#define GLU_TESS_WINDING_POSITIVE
#define GLU_TESS_WINDING_NEGATIVE
#define GLU_TESS_WINDING_ODD
#define GL_TRIANGLE_STRIP
#define GLU_TESS_WINDING_ABS_GEQ_TWO
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
static struct FaceCount MaximumFan(GLUhalfEdge *eOrig)
static void RenderStrip(GLUtesselator *tess, GLUhalfEdge *eStart, long size)
#define SIGN_INCONSISTENT
static void RenderMaximumFaceGroup(GLUtesselator *tess, GLUface *fOrig)
static struct FaceCount MaximumStrip(GLUhalfEdge *eOrig)
GLboolean __gl_renderCache(GLUtesselator *tess)
static void RenderLonelyTriangles(GLUtesselator *tess, GLUface *head)
static void RenderTriangle(GLUtesselator *tess, GLUhalfEdge *eStart, long size)
void __gl_renderMesh(GLUtesselator *tess, GLUmesh *mesh)
void __gl_renderBoundary(GLUtesselator *tess, GLUmesh *mesh)
static void RenderFan(GLUtesselator *tess, GLUhalfEdge *eStart, long size)
static int ComputeNormal(GLUtesselator *tess, GLdouble norm[3], int check)
void(* render)(GLUtesselator *, GLUhalfEdge *, long)
#define CALL_EDGE_FLAG_OR_EDGE_FLAG_DATA(a)
#define CALL_BEGIN_OR_BEGIN_DATA(a)
#define CALL_VERTEX_OR_VERTEX_DATA(a)
#define CALL_END_OR_END_DATA()