Import Geant4 10.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2019-12-06 15:12:28 +01:00
parent b2a62ae692
commit 5baee230e9
2997 changed files with 141580 additions and 98673 deletions
@@ -78,8 +78,8 @@ GLUAPI void GLUAPIENTRY gluTessVertex (GLUtesselator* tess, GLUdouble *location,
/* //////////////////////////////////////////////////////////////// */
/* Boolean values */
#define GLU_FALSE 0x0
#define GLU_TRUE 0x1
#define TOOLS_GLU_FALSE 0x0
#define TOOLS_GLU_TRUE 0x1
/* Primitives */
#define GLU_LINE_LOOP 0x0002
@@ -32,7 +32,7 @@
inline int __gl_vertLeq( GLUvertex *u, GLUvertex *v )
{
/* Returns GLU_TRUE if u is lexicographically <= v. */
/* Returns TOOLS_GLU_TRUE if u is lexicographically <= v. */
return VertLeq( u, v );
}
@@ -80,8 +80,8 @@ gluNewTess( void )
tess->relTolerance = GLU_TESS_DEFAULT_TOLERANCE;
tess->windingRule = GLU_TESS_WINDING_ODD;
tess->flagBoundary = GLU_FALSE;
tess->boundaryOnly = GLU_FALSE;
tess->flagBoundary = TOOLS_GLU_FALSE;
tess->boundaryOnly = TOOLS_GLU_FALSE;
tess->callBegin = &static_noBegin;
tess->callEdgeFlag = &static_noEdgeFlag;
@@ -222,7 +222,7 @@ gluGetTessProperty( GLUtesselator *tess, GLUenum which, GLUdouble *value )
*value= tess->windingRule;
break;
case GLU_TESS_BOUNDARY_ONLY:
assert(tess->boundaryOnly == GLU_TRUE || tess->boundaryOnly == GLU_FALSE);
assert(tess->boundaryOnly == TOOLS_GLU_TRUE || tess->boundaryOnly == TOOLS_GLU_FALSE);
*value= tess->boundaryOnly;
break;
default:
@@ -398,7 +398,7 @@ inline/*static*/ int static_EmptyCache( GLUtesselator *tess )
if ( !static_AddVertex( tess, v->coords, v->data ) ) return 0;
}
tess->cacheCount = 0;
tess->emptyCache = GLU_FALSE;
tess->emptyCache = TOOLS_GLU_FALSE;
return 1;
}
@@ -407,7 +407,7 @@ inline/*static*/ int static_EmptyCache( GLUtesselator *tess )
inline void GLUAPIENTRY
gluTessVertex( GLUtesselator *tess, GLUdouble coords[3], void *data )
{
int i, tooLarge = GLU_FALSE;
int i, tooLarge = TOOLS_GLU_FALSE;
GLUdouble x, clamped[3];
RequireState( tess, T_IN_CONTOUR );
@@ -423,11 +423,11 @@ gluTessVertex( GLUtesselator *tess, GLUdouble coords[3], void *data )
x = coords[i];
if( x < - GLU_TESS_MAX_COORD ) {
x = - GLU_TESS_MAX_COORD;
tooLarge = GLU_TRUE;
tooLarge = TOOLS_GLU_TRUE;
}
if( x > GLU_TESS_MAX_COORD ) {
x = GLU_TESS_MAX_COORD;
tooLarge = GLU_TRUE;
tooLarge = TOOLS_GLU_TRUE;
}
clamped[i] = x;
}
@@ -458,7 +458,7 @@ gluTessBeginPolygon( GLUtesselator *tess, void *data )
tess->state = T_IN_POLYGON;
tess->cacheCount = 0;
tess->emptyCache = GLU_FALSE;
tess->emptyCache = TOOLS_GLU_FALSE;
tess->mesh = NULL;
tess->polygonData= data;
@@ -477,7 +477,7 @@ gluTessBeginContour( GLUtesselator *tess )
* -- these can be generated accidentally with the obsolete
* NextContour() interface.
*/
tess->emptyCache = GLU_TRUE;
tess->emptyCache = TOOLS_GLU_TRUE;
}
}
@@ -543,7 +543,7 @@ gluTessEndPolygon( GLUtesselator *tess )
* Otherwise we tessellate all the regions marked "inside".
*/
if( tess->boundaryOnly ) {
rc = __gl_meshSetWindingNumber( mesh, 1, GLU_TRUE );
rc = __gl_meshSetWindingNumber( mesh, 1, TOOLS_GLU_TRUE );
} else {
rc = __gl_meshTessellateInterior( mesh );
}
@@ -359,7 +359,7 @@ inline/*static*/ void static_MakeFace( GLUface *newFace, GLUhalfEdge *eOrig, GLU
fNew->anEdge = eOrig;
fNew->data = NULL;
fNew->trail = NULL;
fNew->marked = GLU_FALSE;
fNew->marked = TOOLS_GLU_FALSE;
/* The new face is marked "inside" if the old one was. This is a
* convenience for the common case where a face has been split in two.
@@ -503,19 +503,19 @@ inline GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh )
*/
inline int __gl_meshSplice( GLUhalfEdge *eOrg, GLUhalfEdge *eDst )
{
int joiningLoops = GLU_FALSE;
int joiningVertices = GLU_FALSE;
int joiningLoops = TOOLS_GLU_FALSE;
int joiningVertices = TOOLS_GLU_FALSE;
if( eOrg == eDst ) return 1;
if( eDst->Org != eOrg->Org ) {
/* We are merging two disjoint vertices -- destroy eDst->Org */
joiningVertices = GLU_TRUE;
joiningVertices = TOOLS_GLU_TRUE;
static_KillVertex( eDst->Org, eOrg->Org );
}
if( eDst->Lface != eOrg->Lface ) {
/* We are connecting two disjoint loops -- destroy eDst->Lface */
joiningLoops = GLU_TRUE;
joiningLoops = TOOLS_GLU_TRUE;
static_KillFace( eDst->Lface, eOrg->Lface );
}
@@ -560,14 +560,14 @@ inline int __gl_meshSplice( GLUhalfEdge *eOrg, GLUhalfEdge *eDst )
inline int __gl_meshDelete( GLUhalfEdge *eDel )
{
GLUhalfEdge *eDelSym = eDel->Sym;
int joiningLoops = GLU_FALSE;
int joiningLoops = TOOLS_GLU_FALSE;
/* First step: disconnect the origin vertex eDel->Org. We make all
* changes to get a consistent mesh in this "intermediate" state.
*/
if( eDel->Lface != eDel->Rface ) {
/* We are joining two loops into one -- remove the left face */
joiningLoops = GLU_TRUE;
joiningLoops = TOOLS_GLU_TRUE;
static_KillFace( eDel->Lface, eDel->Rface );
/* G.Barrand : note : Coverity says that there is a problem using eDel->Lface->anEdge in the below,
but it appears that at the out of the upper static_KillFace() call (then here), eDel->Lface before
@@ -687,7 +687,7 @@ inline GLUhalfEdge *__gl_meshSplitEdge( GLUhalfEdge *eOrg )
inline GLUhalfEdge *__gl_meshConnect( GLUhalfEdge *eOrg, GLUhalfEdge *eDst )
{
GLUhalfEdge *eNewSym;
int joiningLoops = GLU_FALSE;
int joiningLoops = TOOLS_GLU_FALSE;
GLUhalfEdge *eNew = static_MakeEdge( eOrg );
if (eNew == NULL) return NULL;
@@ -695,7 +695,7 @@ inline GLUhalfEdge *__gl_meshConnect( GLUhalfEdge *eOrg, GLUhalfEdge *eDst )
if( eDst->Lface != eOrg->Lface ) {
/* We are connecting two disjoint loops -- destroy eDst->Lface */
joiningLoops = GLU_TRUE;
joiningLoops = TOOLS_GLU_TRUE;
static_KillFace( eDst->Lface, eOrg->Lface );
}
@@ -803,8 +803,8 @@ inline GLUmesh *__gl_meshNewMesh( void )
f->anEdge = NULL;
f->data = NULL;
f->trail = NULL;
f->marked = GLU_FALSE;
f->inside = GLU_FALSE;
f->marked = TOOLS_GLU_FALSE;
f->inside = TOOLS_GLU_FALSE;
e->next = e;
e->Sym = eSym;
@@ -150,14 +150,14 @@ inline void __gl_projectPolygon( GLUtesselator *tess )
GLUvertex *v, *vHead = &tess->mesh->vHead;
GLUdouble norm[3];
GLUdouble *sUnit, *tUnit;
int i, computedNormal = GLU_FALSE;
int i, computedNormal = TOOLS_GLU_FALSE;
norm[0] = tess->normal[0];
norm[1] = tess->normal[1];
norm[2] = tess->normal[2];
if( norm[0] == 0 && norm[1] == 0 && norm[2] == 0 ) {
static_ComputeNormal( tess, norm );
computedNormal = GLU_TRUE;
computedNormal = TOOLS_GLU_TRUE;
}
sUnit = tess->sUnit;
tUnit = tess->tUnit;
@@ -104,7 +104,7 @@ inline PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) )
return NULL;
}
pq->initialized = GLU_FALSE;
pq->initialized = TOOLS_GLU_FALSE;
pq->freeList = 0;
pq->leq = leq;
@@ -184,7 +184,7 @@ inline void pqInit( PriorityQ *pq )
for( i = pq->size; i >= 1; --i ) {
static_FloatDown( pq, i );
}
pq->initialized = GLU_TRUE;
pq->initialized = TOOLS_GLU_TRUE;
}
/* really __gl_pqHeapInsert */
@@ -376,7 +376,7 @@ inline PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) )
pq->size = 0;
pq->max = INIT_SIZE();
pq->initialized = GLU_FALSE;
pq->initialized = TOOLS_GLU_FALSE;
pq->leq = leq;
return pq;
}
@@ -464,7 +464,7 @@ inline int pqInit( PriorityQ *pq )
}
}
pq->max = pq->size;
pq->initialized = GLU_TRUE;
pq->initialized = TOOLS_GLU_TRUE;
__gl_pqHeapInit( pq->heap ); /* always succeeds */
#ifndef NDEBUG
@@ -64,7 +64,7 @@ inline void __gl_renderMesh( GLUtesselator *tess, GLUmesh *mesh )
tess->lonelyTriList = NULL;
for( f = mesh->fHead.next; f != &mesh->fHead; f = f->next ) {
f->marked = GLU_FALSE;
f->marked = TOOLS_GLU_FALSE;
}
for( f = mesh->fHead.next; f != &mesh->fHead; f = f->next ) {
@@ -122,10 +122,10 @@ inline/*static*/ void static_RenderMaximumFaceGroup( GLUtesselator *tess, GLUfac
*/
#define Marked(f) (! (f)->inside || (f)->marked)
#define AddToTrail(f,t) ((f)->trail = (t), (t) = (f), (f)->marked = GLU_TRUE)
#define AddToTrail(f,t) ((f)->trail = (t), (t) = (f), (f)->marked = TOOLS_GLU_TRUE)
//#define FreeTrail(t) if( 1 ) { while( (t) != NULL ) { (t)->marked = GLU_FALSE; t = (t)->trail; } } else
#define FreeTrail(t) do { while( (t) != NULL ) { (t)->marked = GLU_FALSE; t = (t)->trail; } } while(false)
//#define FreeTrail(t) if( 1 ) { while( (t) != NULL ) { (t)->marked = TOOLS_GLU_FALSE; t = (t)->trail; } } else
#define FreeTrail(t) do { while( (t) != NULL ) { (t)->marked = TOOLS_GLU_FALSE; t = (t)->trail; } } while(false)
inline/*static*/ struct FaceCount static_MaximumFan( GLUhalfEdge *eOrig )
{
@@ -235,7 +235,7 @@ inline/*static*/ void static_RenderLonelyTriangles( GLUtesselator *tess, GLUface
e = f->anEdge;
do {
if( tess->flagBoundary ) {
/* Set the "edge state" to GLU_TRUE just before we output the
/* Set the "edge state" to TOOLS_GLU_TRUE just before we output the
* first vertex of each edge on the polygon boundary.
*/
newState = ! e->Rface->inside;
@@ -264,7 +264,7 @@ inline/*static*/ void static_RenderFan( GLUtesselator *tess, GLUhalfEdge *e, lon
CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data );
while( ! Marked( e->Lface )) {
e->Lface->marked = GLU_TRUE;
e->Lface->marked = TOOLS_GLU_TRUE;
--size;
e = e->Onext;
CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data );
@@ -286,13 +286,13 @@ inline/*static*/ void static_RenderStrip( GLUtesselator *tess, GLUhalfEdge *e, l
CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data );
while( ! Marked( e->Lface )) {
e->Lface->marked = GLU_TRUE;
e->Lface->marked = TOOLS_GLU_TRUE;
--size;
e = e->Dprev;
CALL_VERTEX_OR_VERTEX_DATA( e->Org->data );
if( Marked( e->Lface )) break;
e->Lface->marked = GLU_TRUE;
e->Lface->marked = TOOLS_GLU_TRUE;
--size;
e = e->Onext;
CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data );
@@ -338,8 +338,8 @@ inline int SIGN_INCONSISTENT() {
inline/*static*/ int static_ComputeNormal( GLUtesselator *tess, GLUdouble norm[3], int check )
/*
* If check==GLU_FALSE, we compute the polygon normal and place it in norm[].
* If check==GLU_TRUE, we check that each triangle in the fan from v0 has a
* If check==TOOLS_GLU_FALSE, we compute the polygon normal and place it in norm[].
* If check==TOOLS_GLU_TRUE, we check that each triangle in the fan from v0 has a
* consistent orientation with respect to norm[]. If triangles are
* consistently oriented CCW, return 1; if CW, return -1; if all triangles
* are degenerate return 0; otherwise (no consistent orientation) return
@@ -412,7 +412,7 @@ inline/*static*/ int static_ComputeNormal( GLUtesselator *tess, GLUdouble norm[3
* as a triangle fan. This handles convex polygons, as well as some
* non-convex polygons if we get lucky.
*
* Returns GLU_TRUE if the polygon was successfully rendered. The rendering
* Returns TOOLS_GLU_TRUE if the polygon was successfully rendered. The rendering
* output is provided as callbacks (see the api).
*/
inline GLUboolean __gl_renderCache( GLUtesselator *tess )
@@ -425,24 +425,24 @@ inline GLUboolean __gl_renderCache( GLUtesselator *tess )
if( tess->cacheCount < 3 ) {
/* Degenerate contour -- no output */
return GLU_TRUE;
return TOOLS_GLU_TRUE;
}
norm[0] = tess->normal[0];
norm[1] = tess->normal[1];
norm[2] = tess->normal[2];
if( norm[0] == 0 && norm[1] == 0 && norm[2] == 0 ) {
static_ComputeNormal( tess, norm, GLU_FALSE );
static_ComputeNormal( tess, norm, TOOLS_GLU_FALSE );
}
sign = static_ComputeNormal( tess, norm, GLU_TRUE );
sign = static_ComputeNormal( tess, norm, TOOLS_GLU_TRUE );
if( sign == SIGN_INCONSISTENT() ) {
/* Fan triangles did not have a consistent orientation */
return GLU_FALSE;
return TOOLS_GLU_FALSE;
}
if( sign == 0 ) {
/* All triangles were degenerate */
return GLU_TRUE;
return TOOLS_GLU_TRUE;
}
/* Make sure we do the right thing for each winding rule */
@@ -451,13 +451,13 @@ inline GLUboolean __gl_renderCache( GLUtesselator *tess )
case GLU_TESS_WINDING_NONZERO:
break;
case GLU_TESS_WINDING_POSITIVE:
if( sign < 0 ) return GLU_TRUE;
if( sign < 0 ) return TOOLS_GLU_TRUE;
break;
case GLU_TESS_WINDING_NEGATIVE:
if( sign > 0 ) return GLU_TRUE;
if( sign > 0 ) return TOOLS_GLU_TRUE;
break;
case GLU_TESS_WINDING_ABS_GEQ_TWO:
return GLU_TRUE;
return TOOLS_GLU_TRUE;
}
CALL_BEGIN_OR_BEGIN_DATA( tess->boundaryOnly ? GLU_LINE_LOOP
@@ -475,7 +475,7 @@ inline GLUboolean __gl_renderCache( GLUtesselator *tess )
}
}
CALL_END_OR_END_DATA();
return GLU_TRUE;
return TOOLS_GLU_TRUE;
}
#endif
@@ -146,7 +146,7 @@ inline/*static*/ int static_FixUpperEdge( ActiveRegion *reg, GLUhalfEdge *newEdg
{
assert( reg->fixUpperEdge );
if ( !__gl_meshDelete( reg->eUp ) ) return 0;
reg->fixUpperEdge = GLU_FALSE;
reg->fixUpperEdge = TOOLS_GLU_FALSE;
reg->eUp = newEdge;
newEdge->activeRegion = reg;
@@ -203,9 +203,9 @@ inline/*static*/ ActiveRegion *static_AddRegionBelow( GLUtesselator *tess,
/* __gl_dictListInsertBefore */
regNew->nodeUp = dictInsertBefore( tess->dict, regAbove->nodeUp, regNew );
if (regNew->nodeUp == NULL) longjmp(tess->env,1);
regNew->fixUpperEdge = GLU_FALSE;
regNew->sentinel = GLU_FALSE;
regNew->dirty = GLU_FALSE;
regNew->fixUpperEdge = TOOLS_GLU_FALSE;
regNew->sentinel = TOOLS_GLU_FALSE;
regNew->dirty = TOOLS_GLU_FALSE;
eNewUp->activeRegion = regNew;
return regNew;
@@ -226,9 +226,9 @@ inline/*static*/ GLUboolean static_IsWindingInside( GLUtesselator *tess, int n )
return (n >= 2) || (n <= -2);
}
/*LINTED*/
assert( GLU_FALSE );
assert( TOOLS_GLU_FALSE );
/*NOTREACHED*/
return GLU_FALSE; /* avoid compiler complaints */
return TOOLS_GLU_FALSE; /* avoid compiler complaints */
}
@@ -278,7 +278,7 @@ inline/*static*/ GLUhalfEdge *static_FinishLeftRegions( GLUtesselator *tess,
regPrev = regFirst;
ePrev = regFirst->eUp;
while( regPrev != regLast ) {
regPrev->fixUpperEdge = GLU_FALSE; /* placement was OK */
regPrev->fixUpperEdge = TOOLS_GLU_FALSE; /* placement was OK */
reg = RegionBelow( regPrev );
e = reg->eUp;
if( e->Org != ePrev->Org ) {
@@ -329,7 +329,7 @@ inline/*static*/ void static_AddRightEdges( GLUtesselator *tess, ActiveRegion *r
{
ActiveRegion *reg, *regPrev;
GLUhalfEdge *e, *ePrev;
int firstTime = GLU_TRUE;
int firstTime = TOOLS_GLU_TRUE;
/* Insert the new right-going edges in the dictionary */
e = eFirst;
@@ -365,17 +365,17 @@ inline/*static*/ void static_AddRightEdges( GLUtesselator *tess, ActiveRegion *r
/* Check for two outgoing edges with same slope -- process these
* before any intersection tests (see example in __gl_computeInterior).
*/
regPrev->dirty = GLU_TRUE;
regPrev->dirty = TOOLS_GLU_TRUE;
if( ! firstTime && static_CheckForRightSplice( tess, regPrev )) {
AddWinding( e, ePrev );
static_DeleteRegion( tess, regPrev );
if ( !__gl_meshDelete( ePrev ) ) longjmp(tess->env,1);
}
firstTime = GLU_FALSE;
firstTime = TOOLS_GLU_FALSE;
regPrev = reg;
ePrev = e;
}
regPrev->dirty = GLU_TRUE;
regPrev->dirty = TOOLS_GLU_TRUE;
assert( regPrev->windingNumber - e->winding == reg->windingNumber );
if( cleanUp ) {
@@ -406,7 +406,7 @@ inline/*static*/ void static_CallCombine( GLUtesselator *tess, GLUvertex *isect,
* generated intersection points.
*/
CALL_ERROR_OR_ERROR_DATA( GLU_TESS_NEED_COMBINE_CALLBACK );
tess->fatalError = GLU_TRUE;
tess->fatalError = TOOLS_GLU_TRUE;
}
}
}
@@ -423,7 +423,7 @@ inline/*static*/ void static_SpliceMergeVertices( GLUtesselator *tess, GLUhalfEd
data[0] = e1->Org->data;
data[1] = e2->Org->data;
static_CallCombine( tess, e1->Org, data, weights, GLU_FALSE );
static_CallCombine( tess, e1->Org, data, weights, TOOLS_GLU_FALSE );
if ( !__gl_meshSplice( e1, e2 ) ) longjmp(tess->env,1);
}
@@ -469,7 +469,7 @@ inline/*static*/ void static_GetIntersectData( GLUtesselator *tess, GLUvertex *i
static_VertexWeights( isect, orgUp, dstUp, &weights[0] );
static_VertexWeights( isect, orgLo, dstLo, &weights[2] );
static_CallCombine( tess, isect, data, weights, GLU_TRUE );
static_CallCombine( tess, isect, data, weights, TOOLS_GLU_TRUE );
}
inline/*static*/ int static_CheckForRightSplice( GLUtesselator *tess, ActiveRegion *regUp )
@@ -504,14 +504,14 @@ inline/*static*/ int static_CheckForRightSplice( GLUtesselator *tess, ActiveRegi
GLUhalfEdge *eLo = regLo->eUp;
if( VertLeq( eUp->Org, eLo->Org )) {
if( EdgeSign( eLo->Dst, eUp->Org, eLo->Org ) > 0 ) return GLU_FALSE;
if( EdgeSign( eLo->Dst, eUp->Org, eLo->Org ) > 0 ) return TOOLS_GLU_FALSE;
/* eUp->Org appears to be below eLo */
if( ! VertEq( eUp->Org, eLo->Org )) {
/* Splice eUp->Org into eLo */
if ( __gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1);
if ( !__gl_meshSplice( eUp, eLo->Oprev ) ) longjmp(tess->env,1);
regUp->dirty = regLo->dirty = GLU_TRUE;
regUp->dirty = regLo->dirty = TOOLS_GLU_TRUE;
} else if( eUp->Org != eLo->Org ) {
/* merge the two vertices, discarding eUp->Org */
@@ -519,14 +519,14 @@ inline/*static*/ int static_CheckForRightSplice( GLUtesselator *tess, ActiveRegi
static_SpliceMergeVertices( tess, eLo->Oprev, eUp );
}
} else {
if( EdgeSign( eUp->Dst, eLo->Org, eUp->Org ) < 0 ) return GLU_FALSE;
if( EdgeSign( eUp->Dst, eLo->Org, eUp->Org ) < 0 ) return TOOLS_GLU_FALSE;
/* eLo->Org appears to be above eUp, so splice eLo->Org into eUp */
RegionAbove(regUp)->dirty = regUp->dirty = GLU_TRUE;
RegionAbove(regUp)->dirty = regUp->dirty = TOOLS_GLU_TRUE;
if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1);
if ( !__gl_meshSplice( eLo->Oprev, eUp ) ) longjmp(tess->env,1);
}
return GLU_TRUE;
return TOOLS_GLU_TRUE;
}
inline/*static*/ int static_CheckForLeftSplice( GLUtesselator *tess, ActiveRegion *regUp )
@@ -557,25 +557,25 @@ inline/*static*/ int static_CheckForLeftSplice( GLUtesselator *tess, ActiveRegio
assert( ! VertEq( eUp->Dst, eLo->Dst ));
if( VertLeq( eUp->Dst, eLo->Dst )) {
if( EdgeSign( eUp->Dst, eLo->Dst, eUp->Org ) < 0 ) return GLU_FALSE;
if( EdgeSign( eUp->Dst, eLo->Dst, eUp->Org ) < 0 ) return TOOLS_GLU_FALSE;
/* eLo->Dst is above eUp, so splice eLo->Dst into eUp */
RegionAbove(regUp)->dirty = regUp->dirty = GLU_TRUE;
RegionAbove(regUp)->dirty = regUp->dirty = TOOLS_GLU_TRUE;
e = __gl_meshSplitEdge( eUp );
if (e == NULL) longjmp(tess->env,1);
if ( !__gl_meshSplice( eLo->Sym, e ) ) longjmp(tess->env,1);
e->Lface->inside = regUp->inside;
} else {
if( EdgeSign( eLo->Dst, eUp->Dst, eLo->Org ) > 0 ) return GLU_FALSE;
if( EdgeSign( eLo->Dst, eUp->Dst, eLo->Org ) > 0 ) return TOOLS_GLU_FALSE;
/* eUp->Dst is below eLo, so splice eUp->Dst into eLo */
regUp->dirty = regLo->dirty = GLU_TRUE;
regUp->dirty = regLo->dirty = TOOLS_GLU_TRUE;
e = __gl_meshSplitEdge( eLo );
if (e == NULL) longjmp(tess->env,1);
if ( !__gl_meshSplice( eUp->Lnext, eLo->Sym ) ) longjmp(tess->env,1);
e->Rface->inside = regUp->inside;
}
return GLU_TRUE;
return TOOLS_GLU_TRUE;
}
@@ -585,7 +585,7 @@ inline/*static*/ int static_CheckForIntersect( GLUtesselator *tess, ActiveRegion
* they intersect. If so, create the intersection and add it
* to the data structures.
*
* Returns GLU_TRUE if adding the new intersection resulted in a recursive
* Returns TOOLS_GLU_TRUE if adding the new intersection resulted in a recursive
* call to AddRightEdges(); in this case all "dirty" regions have been
* checked for intersections, and possibly regUp has been deleted.
*/
@@ -607,16 +607,16 @@ inline/*static*/ int static_CheckForIntersect( GLUtesselator *tess, ActiveRegion
assert( orgUp != tess->event && orgLo != tess->event );
assert( ! regUp->fixUpperEdge && ! regLo->fixUpperEdge );
if( orgUp == orgLo ) return GLU_FALSE; /* right endpoints are the same */
if( orgUp == orgLo ) return TOOLS_GLU_FALSE; /* right endpoints are the same */
tMinUp = GLU_MIN( orgUp->t, dstUp->t );
tMaxLo = GLU_MAX( orgLo->t, dstLo->t );
if( tMinUp > tMaxLo ) return GLU_FALSE; /* t ranges do not overlap */
if( tMinUp > tMaxLo ) return TOOLS_GLU_FALSE; /* t ranges do not overlap */
if( VertLeq( orgUp, orgLo )) {
if( EdgeSign( dstLo, orgUp, orgLo ) > 0 ) return GLU_FALSE;
if( EdgeSign( dstLo, orgUp, orgLo ) > 0 ) return TOOLS_GLU_FALSE;
} else {
if( EdgeSign( dstUp, orgLo, orgUp ) < 0 ) return GLU_FALSE;
if( EdgeSign( dstUp, orgLo, orgUp ) < 0 ) return TOOLS_GLU_FALSE;
}
/* At this point the edges intersect, at least marginally */
@@ -654,7 +654,7 @@ inline/*static*/ int static_CheckForIntersect( GLUtesselator *tess, ActiveRegion
if( VertEq( &isect, orgUp ) || VertEq( &isect, orgLo )) {
/* Easy case -- intersection at one of the right endpoints */
(void) static_CheckForRightSplice( tess, regUp );
return GLU_FALSE;
return TOOLS_GLU_FALSE;
}
if( (! VertEq( dstUp, tess->event )
@@ -674,8 +674,8 @@ inline/*static*/ int static_CheckForIntersect( GLUtesselator *tess, ActiveRegion
if (regUp == NULL) longjmp(tess->env,1);
eUp = RegionBelow(regUp)->eUp;
static_FinishLeftRegions( tess, RegionBelow(regUp), regLo );
static_AddRightEdges( tess, regUp, eUp->Oprev, eUp, eUp, GLU_TRUE );
return GLU_TRUE;
static_AddRightEdges( tess, regUp, eUp->Oprev, eUp, eUp, TOOLS_GLU_TRUE );
return TOOLS_GLU_TRUE;
}
if( dstUp == tess->event ) {
/* Splice dstUp into eLo, and process the new region(s) */
@@ -686,27 +686,27 @@ inline/*static*/ int static_CheckForIntersect( GLUtesselator *tess, ActiveRegion
e = RegionBelow(regUp)->eUp->Rprev;
regLo->eUp = eLo->Oprev;
eLo = static_FinishLeftRegions( tess, regLo, NULL );
static_AddRightEdges( tess, regUp, eLo->Onext, eUp->Rprev, e, GLU_TRUE );
return GLU_TRUE;
static_AddRightEdges( tess, regUp, eLo->Onext, eUp->Rprev, e, TOOLS_GLU_TRUE );
return TOOLS_GLU_TRUE;
}
/* Special case: called from ConnectRightVertex. If either
* edge passes on the wrong side of tess->event, split it
* (and wait for ConnectRightVertex to splice it appropriately).
*/
if( EdgeSign( dstUp, tess->event, &isect ) >= 0 ) {
RegionAbove(regUp)->dirty = regUp->dirty = GLU_TRUE;
RegionAbove(regUp)->dirty = regUp->dirty = TOOLS_GLU_TRUE;
if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1);
eUp->Org->s = tess->event->s;
eUp->Org->t = tess->event->t;
}
if( EdgeSign( dstLo, tess->event, &isect ) <= 0 ) {
regUp->dirty = regLo->dirty = GLU_TRUE;
regUp->dirty = regLo->dirty = TOOLS_GLU_TRUE;
if (__gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1);
eLo->Org->s = tess->event->s;
eLo->Org->t = tess->event->t;
}
/* leave the rest for ConnectRightVertex */
return GLU_FALSE;
return TOOLS_GLU_FALSE;
}
/* General case -- split both edges, splice into new vertex.
@@ -729,8 +729,8 @@ inline/*static*/ int static_CheckForIntersect( GLUtesselator *tess, ActiveRegion
longjmp(tess->env,1);
}
static_GetIntersectData( tess, eUp->Org, orgUp, dstUp, orgLo, dstLo );
RegionAbove(regUp)->dirty = regUp->dirty = regLo->dirty = GLU_TRUE;
return GLU_FALSE;
RegionAbove(regUp)->dirty = regUp->dirty = regLo->dirty = TOOLS_GLU_TRUE;
return TOOLS_GLU_FALSE;
}
inline/*static*/ void static_WalkDirtyRegions( GLUtesselator *tess, ActiveRegion *regUp )
@@ -760,7 +760,7 @@ inline/*static*/ void static_WalkDirtyRegions( GLUtesselator *tess, ActiveRegion
return;
}
}
regUp->dirty = GLU_FALSE;
regUp->dirty = TOOLS_GLU_FALSE;
eUp = regUp->eUp;
eLo = regLo->eUp;
@@ -859,7 +859,7 @@ inline/*static*/ void static_ConnectRightVertex( GLUtesselator *tess, ActiveRegi
ActiveRegion *regLo = RegionBelow(regUp);
GLUhalfEdge *eUp = regUp->eUp;
GLUhalfEdge *eLo = regLo->eUp;
int degenerate = GLU_FALSE;
int degenerate = TOOLS_GLU_FALSE;
if( eUp->Dst != eLo->Dst ) {
(void) static_CheckForIntersect( tess, regUp );
@@ -874,15 +874,15 @@ inline/*static*/ void static_ConnectRightVertex( GLUtesselator *tess, ActiveRegi
if (regUp == NULL) longjmp(tess->env,1);
eTopLeft = RegionBelow( regUp )->eUp;
static_FinishLeftRegions( tess, RegionBelow(regUp), regLo );
degenerate = GLU_TRUE;
degenerate = TOOLS_GLU_TRUE;
}
if( VertEq( eLo->Org, tess->event )) {
if ( !__gl_meshSplice( eBottomLeft, eLo->Oprev ) ) longjmp(tess->env,1);
eBottomLeft = static_FinishLeftRegions( tess, regLo, NULL );
degenerate = GLU_TRUE;
degenerate = TOOLS_GLU_TRUE;
}
if( degenerate ) {
static_AddRightEdges( tess, regUp, eBottomLeft->Onext, eTopLeft, eTopLeft, GLU_TRUE );
static_AddRightEdges( tess, regUp, eBottomLeft->Onext, eTopLeft, eTopLeft, TOOLS_GLU_TRUE );
return;
}
@@ -900,8 +900,8 @@ inline/*static*/ void static_ConnectRightVertex( GLUtesselator *tess, ActiveRegi
/* Prevent cleanup, otherwise eNew might disappear before we've even
* had a chance to mark it as a temporary edge.
*/
static_AddRightEdges( tess, regUp, eNew, eNew->Onext, eNew->Onext, GLU_FALSE );
eNew->Sym->activeRegion->fixUpperEdge = GLU_TRUE;
static_AddRightEdges( tess, regUp, eNew, eNew->Onext, eNew->Onext, TOOLS_GLU_FALSE );
eNew->Sym->activeRegion->fixUpperEdge = TOOLS_GLU_TRUE;
static_WalkDirtyRegions( tess, regUp );
}
@@ -912,7 +912,7 @@ inline/*static*/ void static_ConnectRightVertex( GLUtesselator *tess, ActiveRegi
* TOLERANCE_NONZERO will be useful. They were debugged before the
* code to merge identical vertices in the main loop was added.
*/
//#define TOLERANCE_NONZERO GLU_FALSE
//#define TOLERANCE_NONZERO TOOLS_GLU_FALSE
inline/*static*/ void static_ConnectLeftDegenerate( GLUtesselator *tess,
ActiveRegion *regUp, GLUvertex *vEvent )
@@ -930,7 +930,7 @@ inline/*static*/ void static_ConnectLeftDegenerate( GLUtesselator *tess,
/* e->Org is an unprocessed vertex - just combine them, and wait
* for e->Org to be pulled from the queue
*/
assert( /*TOLERANCE_NONZERO*/ GLU_FALSE );
assert( /*TOLERANCE_NONZERO*/ TOOLS_GLU_FALSE );
static_SpliceMergeVertices( tess, e, vEvent->anEdge );
return;
}
@@ -941,7 +941,7 @@ inline/*static*/ void static_ConnectLeftDegenerate( GLUtesselator *tess,
if( regUp->fixUpperEdge ) {
/* This edge was fixable -- delete unused portion of original edge */
if ( !__gl_meshDelete( e->Onext ) ) longjmp(tess->env,1);
regUp->fixUpperEdge = GLU_FALSE;
regUp->fixUpperEdge = TOOLS_GLU_FALSE;
}
if ( !__gl_meshSplice( vEvent->anEdge, e ) ) longjmp(tess->env,1);
static_SweepEvent( tess, vEvent ); /* recurse */
@@ -951,7 +951,7 @@ inline/*static*/ void static_ConnectLeftDegenerate( GLUtesselator *tess,
/* vEvent coincides with e->Dst, which has already been processed.
* Splice in the additional right-going edges.
*/
assert( /*TOLERANCE_NONZERO*/ GLU_FALSE );
assert( /*TOLERANCE_NONZERO*/ TOOLS_GLU_FALSE );
regUp = static_TopRightRegion( regUp );
reg = RegionBelow( regUp );
eTopRight = reg->eUp->Sym;
@@ -970,7 +970,7 @@ inline/*static*/ void static_ConnectLeftDegenerate( GLUtesselator *tess,
/* e->Dst had no left-going edges -- indicate this to AddRightEdges() */
eTopLeft = NULL;
}
static_AddRightEdges( tess, regUp, eTopRight->Onext, eLast, eTopLeft, GLU_TRUE );
static_AddRightEdges( tess, regUp, eTopRight->Onext, eLast, eTopLeft, TOOLS_GLU_TRUE );
}
@@ -1036,7 +1036,7 @@ inline/*static*/ void static_ConnectLeftVertex( GLUtesselator *tess, GLUvertex *
/* The new vertex is in a region which does not belong to the polygon.
* We don''t need to connect this vertex to the rest of the mesh.
*/
static_AddRightEdges( tess, regUp, vEvent->anEdge, vEvent->anEdge, NULL, GLU_TRUE );
static_AddRightEdges( tess, regUp, vEvent->anEdge, vEvent->anEdge, NULL, TOOLS_GLU_TRUE );
}
}
@@ -1089,7 +1089,7 @@ inline/*static*/ void static_SweepEvent( GLUtesselator *tess, GLUvertex *vEvent
/* No right-going edges -- add a temporary "fixable" edge */
static_ConnectRightVertex( tess, regUp, eBottomLeft );
} else {
static_AddRightEdges( tess, regUp, eBottomLeft->Onext, eTopLeft, eTopLeft, GLU_TRUE );
static_AddRightEdges( tess, regUp, eBottomLeft->Onext, eTopLeft, eTopLeft, TOOLS_GLU_TRUE );
}
}
@@ -1126,10 +1126,10 @@ inline/*static*/ void static_AddSentinel( GLUtesselator *tess, GLUdouble t )
reg->eUp = e;
reg->windingNumber = 0;
reg->inside = GLU_FALSE;
reg->fixUpperEdge = GLU_FALSE;
reg->sentinel = GLU_TRUE;
reg->dirty = GLU_FALSE;
reg->inside = TOOLS_GLU_FALSE;
reg->fixUpperEdge = TOOLS_GLU_FALSE;
reg->sentinel = TOOLS_GLU_TRUE;
reg->dirty = TOOLS_GLU_FALSE;
reg->nodeUp = dictInsert( tess->dict, reg ); /* __gl_dictListInsertBefore */
if (reg->nodeUp == NULL) longjmp(tess->env,1);
}
@@ -1295,7 +1295,7 @@ inline int __gl_computeInterior( GLUtesselator *tess )
{
GLUvertex *v, *vNext;
tess->fatalError = GLU_FALSE;
tess->fatalError = TOOLS_GLU_FALSE;
/* Each vertex defines an event for our sweep line. Start by inserting
* all the vertices in a priority queue. Events are processed in
@@ -26,7 +26,7 @@
* polygon have a winding number of "value", and regions outside
* have a winding number of 0.
*
* If keepOnlyBoundary is GLU_TRUE, it also deletes all edges which do not
* If keepOnlyBoundary is TOOLS_GLU_TRUE, it also deletes all edges which do not
* separate an interior region from an exterior one.
*/
@@ -173,7 +173,7 @@ inline void __gl_meshDiscardExterior( GLUmesh *mesh )
* polygon have a winding number of "value", and regions outside
* have a winding number of 0.
*
* If keepOnlyBoundary is GLU_TRUE, it also deletes all edges which do not
* If keepOnlyBoundary is TOOLS_GLU_TRUE, it also deletes all edges which do not
* separate an interior region from an exterior one.
*/
inline int __gl_meshSetWindingNumber( GLUmesh *mesh, int value,
@@ -63,8 +63,8 @@
#undef GLU_MIN
#undef GLU_MAX
#undef GLU_ABS
#undef GLU_FALSE
#undef GLU_TRUE
#undef TOOLS_GLU_FALSE
#undef TOOLS_GLU_TRUE
#undef GLU_LINE_LOOP
#undef GLU_TRIANGLES
#undef GLU_TRIANGLE_STRIP