summaryrefslogtreecommitdiffstats
path: root/src/glu/sgi/libnurbs/internals
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-11-01 23:35:07 +0000
committerBrian Paul <[email protected]>2002-11-01 23:35:07 +0000
commit034e8641bb2e3a8ff9b313719ba3c44282bf07c1 (patch)
tree95aeb5a5cce64a4cd1f489141657484656a7c22a /src/glu/sgi/libnurbs/internals
parent026b40f41617d0cda62a253143136bb5657829d6 (diff)
renamed abs() function glu_abs()
Diffstat (limited to 'src/glu/sgi/libnurbs/internals')
-rw-r--r--src/glu/sgi/libnurbs/internals/arc.cc6
-rw-r--r--src/glu/sgi/libnurbs/internals/arctess.cc16
-rw-r--r--src/glu/sgi/libnurbs/internals/ccw.cc6
-rw-r--r--src/glu/sgi/libnurbs/internals/patch.cc8
-rw-r--r--src/glu/sgi/libnurbs/internals/quilt.cc10
-rw-r--r--src/glu/sgi/libnurbs/internals/reader.cc6
-rw-r--r--src/glu/sgi/libnurbs/internals/simplemath.h6
-rw-r--r--src/glu/sgi/libnurbs/internals/slicer.cc25
-rw-r--r--src/glu/sgi/libnurbs/internals/varray.cc12
9 files changed, 48 insertions, 47 deletions
diff --git a/src/glu/sgi/libnurbs/internals/arc.cc b/src/glu/sgi/libnurbs/internals/arc.cc
index 4f7fb9ed302..845f05fab92 100644
--- a/src/glu/sgi/libnurbs/internals/arc.cc
+++ b/src/glu/sgi/libnurbs/internals/arc.cc
@@ -35,8 +35,8 @@
/*
* 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>
@@ -332,7 +332,7 @@ Arc::check( void )
inline long tooclose( REAL x, REAL y )
{
- return (abs(x-y) < TOL) ? 1 : 0;
+ return (glu_abs(x-y) < TOL) ? 1 : 0;
}
diff --git a/src/glu/sgi/libnurbs/internals/arctess.cc b/src/glu/sgi/libnurbs/internals/arctess.cc
index 0559c35029e..b3222a88d76 100644
--- a/src/glu/sgi/libnurbs/internals/arctess.cc
+++ b/src/glu/sgi/libnurbs/internals/arctess.cc
@@ -35,8 +35,8 @@
/*
* 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"
@@ -247,8 +247,8 @@ ArcTessellator::pwl( Arc *arc, REAL s1, REAL s2, REAL t1, REAL t2, REAL rate )
/* 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;
@@ -395,8 +395,8 @@ ArcTessellator::tessellateNonlinear( Arc *arc, REAL geo_stepsize, REAL arc_steps
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;
@@ -454,8 +454,8 @@ ArcTessellator::tessellateNonlinear( Arc *arc, REAL geo_stepsize, REAL arc_steps
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;
diff --git a/src/glu/sgi/libnurbs/internals/ccw.cc b/src/glu/sgi/libnurbs/internals/ccw.cc
index 16f87dddd0d..4cd92e8780e 100644
--- a/src/glu/sgi/libnurbs/internals/ccw.cc
+++ b/src/glu/sgi/libnurbs/internals/ccw.cc
@@ -35,8 +35,8 @@
/*
* 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"
@@ -562,6 +562,6 @@ int
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;
}
diff --git a/src/glu/sgi/libnurbs/internals/patch.cc b/src/glu/sgi/libnurbs/internals/patch.cc
index b04262b439e..dca20a85f21 100644
--- a/src/glu/sgi/libnurbs/internals/patch.cc
+++ b/src/glu/sgi/libnurbs/internals/patch.cc
@@ -35,8 +35,8 @@
/*
* 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>
@@ -49,7 +49,7 @@
#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();
/*--------------------------------------------------------------------------
@@ -464,7 +464,7 @@ Patch::getstepsize( void )
void
Patchspec::singleStep()
{
- stepsize = sidestep[0] = sidestep[1] = abs(range[2]);
+ stepsize = sidestep[0] = sidestep[1] = glu_abs(range[2]);
}
void
diff --git a/src/glu/sgi/libnurbs/internals/quilt.cc b/src/glu/sgi/libnurbs/internals/quilt.cc
index b1a9e617a30..17d3c991423 100644
--- a/src/glu/sgi/libnurbs/internals/quilt.cc
+++ b/src/glu/sgi/libnurbs/internals/quilt.cc
@@ -35,8 +35,8 @@
/*
* 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"
@@ -48,7 +48,7 @@
#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 */
@@ -265,8 +265,8 @@ Quilt::findSampleRates( Flist& slist, Flist& tlist )
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;
diff --git a/src/glu/sgi/libnurbs/internals/reader.cc b/src/glu/sgi/libnurbs/internals/reader.cc
index 35bf2ee6f11..271a32fbc16 100644
--- a/src/glu/sgi/libnurbs/internals/reader.cc
+++ b/src/glu/sgi/libnurbs/internals/reader.cc
@@ -35,8 +35,8 @@
/*
* 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>
@@ -55,7 +55,7 @@
#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
diff --git a/src/glu/sgi/libnurbs/internals/simplemath.h b/src/glu/sgi/libnurbs/internals/simplemath.h
index e5aaddf0ed4..f2efee35f13 100644
--- a/src/glu/sgi/libnurbs/internals/simplemath.h
+++ b/src/glu/sgi/libnurbs/internals/simplemath.h
@@ -35,8 +35,8 @@
/*
* 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_
@@ -51,6 +51,6 @@ inline REAL
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_ */
diff --git a/src/glu/sgi/libnurbs/internals/slicer.cc b/src/glu/sgi/libnurbs/internals/slicer.cc
index 0d7149144dc..6418e816690 100644
--- a/src/glu/sgi/libnurbs/internals/slicer.cc
+++ b/src/glu/sgi/libnurbs/internals/slicer.cc
@@ -35,8 +35,8 @@
/*
* 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>
@@ -50,6 +50,7 @@
#include "backend.h"
#include "arc.h"
#include "gridtrimvertex.h"
+#include "simplemath.h"
#include "trimvertex.h"
#include "varray.h"
@@ -81,7 +82,7 @@ Int num_quads = 0;
#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)
{
@@ -233,23 +234,23 @@ printf("loop->tail=(%f,%f)\n", loop->tail()[0], loop->tail()[1]);
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
diff --git a/src/glu/sgi/libnurbs/internals/varray.cc b/src/glu/sgi/libnurbs/internals/varray.cc
index c97b030e820..969bba080e2 100644
--- a/src/glu/sgi/libnurbs/internals/varray.cc
+++ b/src/glu/sgi/libnurbs/internals/varray.cc
@@ -35,8 +35,8 @@
/*
* 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"
@@ -44,7 +44,7 @@
#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 )
@@ -114,9 +114,9 @@ Varray::init( REAL delta, Arc_ptr toparc, Arc_ptr botarc )
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;
}