/*
* arc.c++
*
- * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arc.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $
+ * $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arc.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $
*/
#include <stdio.h>
inline long tooclose( REAL x, REAL y )
{
- return (abs(x-y) < TOL) ? 1 : 0;
+ return (glu_abs(x-y) < TOL) ? 1 : 0;
}
/*
* arctessellator.c++
*
- * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arctess.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $
+ * $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arctess.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $
*/
#include "glimports.h"
/* if(rate <= 0.06) rate = 0.06;*/
- int snsteps = 1 + (int) (abs(s2 - s1) / rate );
- int tnsteps = 1 + (int) (abs(t2 - t1) / rate );
+ int snsteps = 1 + (int) (glu_abs(s2 - s1) / rate );
+ int tnsteps = 1 + (int) (glu_abs(t2 - t1) / rate );
int nsteps = max(1,max( snsteps, tnsteps ));
REAL sstepsize = (s2 - s1) / (REAL) nsteps;
vert->param[0] = u/w;
vert->param[1] = v/w;
#ifndef NOELIMINATION
- REAL ds = abs(vert[0].param[0] - vert[-1].param[0]);
- REAL dt = abs(vert[0].param[1] - vert[-1].param[1]);
+ REAL ds = glu_abs(vert[0].param[0] - vert[-1].param[0]);
+ REAL dt = glu_abs(vert[0].param[1] - vert[-1].param[1]);
int canremove = (ds<geo_stepsize && dt<geo_stepsize) ? 1 : 0;
REAL ods=0.0, odt=0.0;
vert->param[0] = u;
vert->param[1] = v;
#ifndef NOELIMINATION
- REAL ds = abs(vert[0].param[0] - vert[-1].param[0]);
- REAL dt = abs(vert[0].param[1] - vert[-1].param[1]);
+ REAL ds = glu_abs(vert[0].param[0] - vert[-1].param[0]);
+ REAL dt = glu_abs(vert[0].param[1] - vert[-1].param[1]);
int canremove = (ds<geo_stepsize && dt<geo_stepsize) ? 1 : 0;
REAL ods=0.0, odt=0.0;
/*
* ccw.c++
*
- * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/ccw.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $
+ * $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/ccw.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $
*/
#include "glimports.h"
Subdivider::ccw( TrimVertex *a, TrimVertex *b, TrimVertex *c )
{
REAL d = det3( a, b, c );
- if( abs(d) < 0.0001 ) return -1;
+ if( glu_abs(d) < 0.0001 ) return -1;
return (d < 0.0) ? 0 : 1;
}
/*
* patch.c++
*
- * $Date: 2001/08/13 16:52:18 $ $Revision: 1.2 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/patch.cc,v 1.2 2001/08/13 16:52:18 brianp Exp $
+ * $Date: 2002/11/01 23:35:07 $ $Revision: 1.3 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/patch.cc,v 1.3 2002/11/01 23:35:07 brianp Exp $
*/
#include <stdio.h>
#include "mapdesc.h"
#include "quilt.h"
#include "nurbsconsts.h"
-#include "simplemath.h" //for abs function in ::singleStep();
+#include "simplemath.h" //for glu_abs function in ::singleStep();
/*--------------------------------------------------------------------------
void
Patchspec::singleStep()
{
- stepsize = sidestep[0] = sidestep[1] = abs(range[2]);
+ stepsize = sidestep[0] = sidestep[1] = glu_abs(range[2]);
}
void
/*
* quilt.c++
*
- * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/quilt.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
+ * $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/quilt.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $
*/
#include "glimports.h"
#include "flist.h"
#include "knotvector.h"
#include "patchlist.h"
-#include "math.h" //fabs()
+#include "math.h" //fglu_abs()
#include "simplemath.h" //min()
/* local preprocessor definitions */
patchlist.getstepsize();
{
- float edge_len_s = min(fabs(ptb[0]-pta[0]),1.0);
- float edge_len_t = min(fabs(ptb[1]-pta[1]),1.0);
+ float edge_len_s = min(glu_abs(ptb[0]-pta[0]),1.0);
+ float edge_len_t = min(glu_abs(ptb[1]-pta[1]),1.0);
if( patchlist.getStepsize(0)/edge_len_s < qspec[0].step_size )
qspec[0].step_size = patchlist.getStepsize(0)/edge_len_s;
/*
* reader.c++
*
- * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/reader.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
+ * $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/reader.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $
*/
#include <stdio.h>
#define ELIMINATE_REDUNDANT_POINTS
#ifdef ELIMINATE_REDUNDANT_POINTS
-#define equal(x,y) ( abs(x-y) <= 0.00001)
+#define equal(x,y) ( glu_abs(x-y) <= 0.00001)
#endif
#ifdef ELIMINATE_REDUNDANT_POINTS
/*
* simplemath.h
*
- * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/simplemath.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
+ * $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/simplemath.h,v 1.2 2002/11/01 23:35:07 brianp Exp $
*/
#ifndef __glusimplemath_h_
min( REAL x, REAL y ) { return ( x > y ) ? y : x; }
inline REAL
-abs( REAL x ) { return ( x < 0.0 ) ? -x : x; }
+glu_abs( REAL x ) { return ( x < 0.0 ) ? -x : x; }
#endif /* __glusimplemath_h_ */
/*
* slicer.c++
*
- * $Date: 2002/06/30 16:58:11 $ $Revision: 1.3 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/slicer.cc,v 1.3 2002/06/30 16:58:11 brianp Exp $
+ * $Date: 2002/11/01 23:35:07 $ $Revision: 1.4 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/slicer.cc,v 1.4 2002/11/01 23:35:07 brianp Exp $
*/
#include <stdlib.h>
#include "backend.h"
#include "arc.h"
#include "gridtrimvertex.h"
+#include "simplemath.h"
#include "trimvertex.h"
#include "varray.h"
#define max(a,b) ((a>b)? a:b)
#define ZERO 0.00001 /*determing whether a loop is a rectngle or not*/
-#define equalRect(a,b) ((fabs(a-b) <= ZERO)? 1:0) //only used in tessellating a rectangle
+#define equalRect(a,b) ((glu_abs(a-b) <= ZERO)? 1:0) //only used in tessellating a rectangle
static Int is_Convex(Arc_ptr loop)
{
printf("loop->head=(%f,%f)\n", loop->head()[0], loop->head()[1]);
printf("loop->next->tail=(%f,%f)\n", loop->next->tail()[0], loop->next->tail()[1]);
printf("loop->next->head=(%f,%f)\n", loop->next->head()[0], loop->next->head()[1]);
-if(fabs(loop->tail()[0] - loop->head()[0])<0.000001)
+if(fglu_abs(loop->tail()[0] - loop->head()[0])<0.000001)
printf("equal 1\n");
if(loop->next->tail()[1] == loop->next->head()[1])
printf("equal 2\n");
*/
- if( (fabs(loop->tail()[0] - loop->head()[0])<=ZERO) &&
- (fabs(loop->next->tail()[1] - loop->next->head()[1])<=ZERO) &&
- (fabs(loop->prev->tail()[1] - loop->prev->head()[1])<=ZERO) &&
- (fabs(loop->prev->prev->tail()[0] - loop->prev->prev->head()[0])<=ZERO)
+ if( (glu_abs(loop->tail()[0] - loop->head()[0])<=ZERO) &&
+ (glu_abs(loop->next->tail()[1] - loop->next->head()[1])<=ZERO) &&
+ (glu_abs(loop->prev->tail()[1] - loop->prev->head()[1])<=ZERO) &&
+ (glu_abs(loop->prev->prev->tail()[0] - loop->prev->prev->head()[0])<=ZERO)
)
return 1;
else if
- ( (fabs(loop->tail()[1] - loop->head()[1]) <= ZERO) &&
- (fabs(loop->next->tail()[0] - loop->next->head()[0]) <= ZERO) &&
- (fabs(loop->prev->tail()[0] - loop->prev->head()[0]) <= ZERO) &&
- (fabs(loop->prev->prev->tail()[1] - loop->prev->prev->head()[1]) <= ZERO)
+ ( (glu_abs(loop->tail()[1] - loop->head()[1]) <= ZERO) &&
+ (glu_abs(loop->next->tail()[0] - loop->next->head()[0]) <= ZERO) &&
+ (glu_abs(loop->prev->tail()[0] - loop->prev->head()[0]) <= ZERO) &&
+ (glu_abs(loop->prev->prev->tail()[1] - loop->prev->prev->head()[1]) <= ZERO)
)
return 1;
else
/*
* varray.c++
*
- * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/varray.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
+ * $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/varray.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $
*/
#include "glimports.h"
#include "mystdio.h"
#include "varray.h"
#include "arc.h"
-#include "math.h" // fabs()
+#include "simplemath.h" // glu_abs()
#define TINY 0.0001
inline long sgn( REAL x )
update( right, rdir, right->tail()[1] );
break;
case 0:
- if( fabs(left->tail()[1] - botarc->tail()[1]) < TINY) goto end;
- if( fabs(left->tail()[0]-right->prev->tail()[0]) < TINY &&
- fabs(left->tail()[1]-right->prev->tail()[1]) < TINY) goto end;
+ if( glu_abs(left->tail()[1] - botarc->tail()[1]) < TINY) goto end;
+ if( glu_abs(left->tail()[0]-right->prev->tail()[0]) < TINY &&
+ glu_abs(left->tail()[1]-right->prev->tail()[1]) < TINY) goto end;
left = left->next;
break;
}
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
-** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
+** $Date: 2002/11/01 23:35:08 $ $Revision: 1.2 $
*/
/*
-** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
+** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc,v 1.2 2002/11/01 23:35:08 brianp Exp $
*/
#include "gluos.h"
Real tempI;
//skip those points which are equal to v. (avoid degeneratcy)
for(tempI = index1; tempI <= leftChainEndIndex; tempI++)
- if(leftChain->getVertex(tempI)[1] < v)
+ if(leftChain->getVertex((Int) tempI)[1] < v)
break;
if(tempI > leftChainEndIndex)
ret_rightCornerWhere = 1;
else
{
- Real tempMax = leftChain->getVertex(tempI)[0];
+ Real tempMax = leftChain->getVertex((Int) tempI)[0];
for(i=(int)tempI; i<= leftChainEndIndex; i++)
if(leftChain->getVertex(i)[0] > tempMax)
{