summaryrefslogtreecommitdiffstats
path: root/src/glu/sgi/libnurbs/nurbtess
diff options
context:
space:
mode:
Diffstat (limited to 'src/glu/sgi/libnurbs/nurbtess')
-rw-r--r--src/glu/sgi/libnurbs/nurbtess/directedLine.cc6
-rw-r--r--src/glu/sgi/libnurbs/nurbtess/partitionY.cc8
-rw-r--r--src/glu/sgi/libnurbs/nurbtess/polyDBG.cc6
-rw-r--r--src/glu/sgi/libnurbs/nurbtess/polyUtil.h12
-rw-r--r--src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc8
-rw-r--r--src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc22
-rw-r--r--src/glu/sgi/libnurbs/nurbtess/sampledLine.cc5
7 files changed, 35 insertions, 32 deletions
diff --git a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc
index af8d095d4b2..81e01049154 100644
--- a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc
+++ b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc
@@ -31,10 +31,10 @@
** 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: 2001/11/29 16:16:55 $ $Revision: 1.2 $
*/
/*
-** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/directedLine.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/directedLine.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $
*/
#include <stdlib.h>
@@ -596,7 +596,7 @@ Real directedLine::polyArea()
y2 = temp->next->head()[1];
ret += -( x2*y1-x1*y2);
}
- return 0.5*ret;
+ return Real(0.5)*ret;
}
/*******************split or combine polygons begin********************/
diff --git a/src/glu/sgi/libnurbs/nurbtess/partitionY.cc b/src/glu/sgi/libnurbs/nurbtess/partitionY.cc
index d7e6bcb5d49..216ac07e060 100644
--- a/src/glu/sgi/libnurbs/nurbtess/partitionY.cc
+++ b/src/glu/sgi/libnurbs/nurbtess/partitionY.cc
@@ -31,10 +31,10 @@
** 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: 2001/11/29 16:16:55 $ $Revision: 1.2 $
*/
/*
-** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/partitionY.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/partitionY.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $
*/
#include <stdlib.h>
@@ -231,7 +231,7 @@ Int sweepRangeEqual(sweepRange* src1, sweepRange* src2)
*/
inline/*static*/ Real intersectHoriz(Real x1, Real y1, Real x2, Real y2, Real y)
{
- return ((y2==y1)? (x1+x2)*0.5 : x1 + ((y-y1)/(y2-y1)) * (x2-x1));
+ return ((y2==y1)? (x1+x2)*Real(0.5) : x1 + ((y-y1)/(y2-y1)) * (x2-x1));
/*
if(y2 == y1) return (x1+x2)*0.5;
else return x1 + ((y-y1)/(y2-y1)) * (x2-x1);
@@ -309,7 +309,7 @@ static Int compEdges(directedLine *e1, directedLine *e2)
Real Ymax = min(e1_Ymax, e2_Ymax);
Real Ymin = max(e1_Ymin, e2_Ymin);
- Real y = 0.5*(Ymax + Ymin);
+ Real y = Real(0.5)*(Ymax + Ymin);
/* Real x1 = intersectHoriz(e1->head()[0], e1->head()[1], e1->tail()[0], e1->tail()[1], y);
Real x2 = intersectHoriz(e2->head()[0], e2->head()[1], e2->tail()[0], e2->tail()[1], y);
diff --git a/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc b/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc
index bdf16ef96ec..e4a65c2eb3c 100644
--- a/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc
+++ b/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc
@@ -31,10 +31,10 @@
** 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: 2001/11/29 16:16:55 $ $Revision: 1.2 $
*/
/*
-** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/polyDBG.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/polyDBG.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $
*/
#include <stdlib.h>
@@ -395,7 +395,7 @@ poly->printList();
*/
/*for debug purpose*/
assert( (DBG_rayIntersectPoly(v,1,0,poly) % 2 )
- == (DBG_rayIntersectPoly(v,1,0.1234, poly) % 2 )
+ == (DBG_rayIntersectPoly(v,1,Real(0.1234), poly) % 2 )
);
if(DBG_rayIntersectPoly(v, 1, 0, poly) % 2 == 1)
return 1;
diff --git a/src/glu/sgi/libnurbs/nurbtess/polyUtil.h b/src/glu/sgi/libnurbs/nurbtess/polyUtil.h
index a18a83799fd..19c76d37d31 100644
--- a/src/glu/sgi/libnurbs/nurbtess/polyUtil.h
+++ b/src/glu/sgi/libnurbs/nurbtess/polyUtil.h
@@ -31,20 +31,24 @@
** 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: 2001/11/29 16:16:55 $ $Revision: 1.2 $
*/
/*
-** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/polyUtil.h,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/polyUtil.h,v 1.2 2001/11/29 16:16:55 kschultz Exp $
*/
#ifndef _POLYUTIL_H
#define _POLYUTIL_H
#include "definitions.h"
-
+#ifdef __cplusplus
+extern "C" {
+#endif
Real area(Real A[2], Real B[2], Real C[2]);
Int pointLeftLine(Real A[2], Real B[2], Real P[2]);
Int pointLeft2Lines(Real A[2], Real B[2], Real C[2], Real P[2]);
-
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc
index c3c6ee9defb..b66647aa994 100644
--- a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc
+++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc
@@ -31,10 +31,10 @@
** 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: 2001/11/29 16:16:55 $ $Revision: 1.2 $
*/
/*
-** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.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/sampleCompBot.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $
*/
#include <stdlib.h>
@@ -327,7 +327,7 @@ Int findBotSeparator(vertexArray* leftChain,
{
oldLeftI = leftCorner-1;
oldRightI = rightCorner;
- leftMax = leftChain->getVertex(leftCorner)[0] - 1.0 ; //initilize to be left of leftCorner
+ leftMax = leftChain->getVertex(leftCorner)[0] - Real(1.0) ; //initilize to be left of leftCorner
rightMin = rightChain->getVertex(rightCorner)[0];
}
else //rightlower
@@ -335,7 +335,7 @@ Int findBotSeparator(vertexArray* leftChain,
oldLeftI = leftCorner;
oldRightI = rightCorner-1;
leftMax = leftChain->getVertex(leftCorner)[0];
- rightMin = rightChain->getVertex(rightCorner)[0] + 1.0;
+ rightMin = rightChain->getVertex(rightCorner)[0] + Real(1.0);
}
//i: the current working leftChain Index
diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc b/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc
index 76a36e06e2d..0d012d47cea 100644
--- a/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc
+++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc
@@ -31,10 +31,10 @@
** 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: 2001/11/29 16:16:55 $ $Revision: 1.2 $
*/
/*
-** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.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/sampleCompTop.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $
*/
#include <stdlib.h>
@@ -343,7 +343,7 @@ Int findTopSeparator(vertexArray* leftChain,
{
oldLeftI = leftEndIndex+1;
oldRightI = rightEndIndex;
- leftMax = leftChain->getVertex(leftEndIndex)[0] - 1.0; //initilza to left of leftU
+ leftMax = leftChain->getVertex(leftEndIndex)[0] - Real(1.0); //initilza to left of leftU
rightMin = rightChain->getVertex(rightEndIndex)[0];
}
else
@@ -351,7 +351,7 @@ Int findTopSeparator(vertexArray* leftChain,
oldLeftI = leftEndIndex;
oldRightI = rightEndIndex+1;
leftMax = leftChain->getVertex(leftEndIndex)[0];
- rightMin = rightChain->getVertex(rightEndIndex)[0] + 1.0;
+ rightMin = rightChain->getVertex(rightEndIndex)[0] + Real(1.0);
}
//i: the current working leftChain index,
@@ -826,19 +826,19 @@ static void sampleCompTopSimpleOpt(gridWrap* grid,
//find l in [j, k-1] so that dec_chain[l][0] 0 is closest to
// inc_chain[i]
int l;
- Real tempI = j;
- Real tempMin = fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(j)[0]);
+ Real tempI = Real(j);
+ Real tempMin = (Real)fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(j)[0]);
for(l=j+1; l<= k-1; l++)
{
if(fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(l)[0])
<= tempMin)
{
- tempMin = fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(l)[0]);
- tempI = l;
+ tempMin = (Real)fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(l)[0]);
+ tempI = (Real)l;
}
}
//inc_chain[i] and dec_chain[tempI] are connected.
- monoTriangulationRecGenOpt(dec_chain->getVertex(tempI),
+ monoTriangulationRecGenOpt(dec_chain->getVertex((int)tempI),
botVertex,
inc_chain, i, inc_end,
dec_chain, (int)(tempI+1), dec_end,
@@ -866,12 +866,12 @@ static void sampleCompTopSimpleOpt(gridWrap* grid,
//inc_chain[l][0] is the closet to dec_chain[j][0]
int tempI = i;
int l;
- Real tempMin = fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(j)[0]);
+ Real tempMin = (Real)fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(j)[0]);
for(l=i+1; l<=k-1; l++)
{
if(fabs(inc_chain->getVertex(l)[0] - dec_chain->getVertex(j)[0]) <= tempMin)
{
- tempMin = fabs(inc_chain->getVertex(l)[0] - dec_chain->getVertex(j)[0]);
+ tempMin = (Real)fabs(inc_chain->getVertex(l)[0] - dec_chain->getVertex(j)[0]);
tempI = l;
}
}
diff --git a/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc b/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc
index 66e1a7f77c4..15332eb41c1 100644
--- a/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc
+++ b/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc
@@ -31,10 +31,10 @@
** 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: 2001/11/29 16:16:55 $ $Revision: 1.2 $
*/
/*
-** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampledLine.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/sampledLine.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $
*/
#include <stdlib.h>
@@ -96,7 +96,6 @@ sampledLine::sampledLine(Int n_points, Real2 pts[])
sampledLine::sampledLine(Real pt1[2], Real pt2[2])
{
- int i;
npoints = 2;
points = (Real2*) malloc(sizeof(Real2) * 2);
assert(points);