From 14eb3697ecac035dab076c7c1284d497b9b52b4a Mon Sep 17 00:00:00 2001 From: granzuglia Date: Wed, 15 Jul 2009 16:25:25 +0000 Subject: [PATCH] changes in order to compile with gcc 3.x --- vcg/simplex/face/distance.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/vcg/simplex/face/distance.h b/vcg/simplex/face/distance.h index d64f281d..e92e0c18 100644 --- a/vcg/simplex/face/distance.h +++ b/vcg/simplex/face/distance.h @@ -99,8 +99,9 @@ namespace vcg { { typedef typename FaceType::ScalarType ScalarType; - const ScalarType EPSILON = ScalarType( 0.000001); - //const ScalarType EPSILON = 0.00000001; + const ScalarType EPS = ScalarType( 0.000001); + + //const ScalarType EPSILON = 0.00000001; ScalarType b,b0,b1,b2; // Calcolo distanza punto piano ScalarType d = Distance( f.cPlane(), q ); @@ -146,13 +147,13 @@ namespace vcg { // vicini (come prodotto vettore) // Nota: si potrebbe rendere un pochino piu' veloce sostituendo Area() // con il prodotto vettore dei due edge in 2d lungo il piano migliore. - if( (b=vcg::math::Min(b0,vcg::math::Min(b1,b2))) < EPSILON*DoubleArea(f)) + if( (b=vcg::math::Min(b0,vcg::math::Min(b1,b2))) < EPS*DoubleArea(f)) { ScalarType bt; if(b==b0) bt = PSDist(q,f.V(1)->cP(),f.V(2)->cP(),p); else if(b==b1) bt = PSDist(q,f.V(2)->cP(),f.V(0)->cP(),p); else if(b==b2) bt = PSDist(q,f.V(0)->cP(),f.V(1)->cP(),p); - //printf("Warning area:%g %g %g %g thr:%g bt:%g\n",Area(), b0,b1,b2,EPSILON*Area(),bt); + //printf("Warning area:%g %g %g %g thr:%g bt:%g\n",Area(), b0,b1,b2,EPS*Area(),bt); if(dist>bt) { dist = bt; return true; } else return false; } @@ -180,7 +181,7 @@ namespace vcg { if(dist>b2) { dist = b2; return true; } else return false; } - if( (b=vcg::math::Min(b0,vcg::math::Min(b1,b2))) < EPSILON*DoubleArea(f)) + if( (b=vcg::math::Min(b0,vcg::math::Min(b1,b2))) < EPS*DoubleArea(f)) { ScalarType bt; if(b==b0) bt = PSDist(q,f.V(1)->cP(),f.V(2)->cP(),p); @@ -214,7 +215,7 @@ namespace vcg { if(dist>b2) { dist = b2; return true; } else return false; } - if( (b=vcg::math::Min(b0,vcg::math::Min(b1,b2))) < EPSILON*DoubleArea(f)) + if( (b=vcg::math::Min(b0,vcg::math::Min(b1,b2))) < EPS*DoubleArea(f)) { ScalarType bt; if(b==b0) bt = PSDist(q,f.V(1)->cP(),f.V(2)->cP(),p); @@ -314,7 +315,7 @@ namespace vcg { #endif Plane3 fPlane; fPlane.Init(f.cP(0),f.cN()); - const ScalarType EPSILON = ScalarType( 0.000001); + const ScalarType EPS = ScalarType( 0.000001); ScalarType b,b0,b1,b2; // Calcolo distanza punto piano ScalarType d = Distance( fPlane, q ); @@ -384,7 +385,7 @@ namespace vcg { // vicini (come prodotto vettore) // Nota: si potrebbe rendere un pochino piu' veloce sostituendo Area() // con il prodotto vettore dei due edge in 2d lungo il piano migliore. - if( (b=vcg::math::Min(b0,vcg::math::Min(b1,b2))) < EPSILON*DoubleArea(f)) + if( (b=vcg::math::Min(b0,vcg::math::Min(b1,b2))) < EPS*DoubleArea(f)) { ScalarType bt; if(b==b0) bt = PSDist(q,f.V(1)->cP(),f.V(2)->cP(),p); @@ -421,7 +422,7 @@ namespace vcg { if(dist>b2) { dist = b2; return true; } else return false; } - if( (b=vcg::math::Min(b0,vcg::math::Min(b1,b2))) < EPSILON*DoubleArea(f)) + if( (b=vcg::math::Min(b0,vcg::math::Min(b1,b2))) < EPS*DoubleArea(f)) { ScalarType bt; if(b==b0) bt = PSDist(q,f.V(1)->cP(),f.V(2)->cP(),p); @@ -458,7 +459,7 @@ namespace vcg { if(dist>b2) { dist = b2; return true; } else return false; } - if( (b=vcg::math::Min(b0,vcg::math::Min(b1,b2))) < EPSILON*DoubleArea(f)) + if( (b=vcg::math::Min(b0,vcg::math::Min(b1,b2))) < EPS*DoubleArea(f)) { ScalarType bt; if(b==b0) bt = PSDist(q,f.V(1)->cP(),f.V(2)->cP(),p);