From dda491ef0d6dcbe75256bee2428088abd0b7377b Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Mon, 21 Jan 2008 22:16:04 +0000
Subject: [PATCH] *** empty log message ***

---
 Geo/GEdge.cpp |  9 ++++-----
 Geo/GFace.cpp | 42 ++++++++++++++++--------------------------
 2 files changed, 20 insertions(+), 31 deletions(-)

diff --git a/Geo/GEdge.cpp b/Geo/GEdge.cpp
index acb7599c06..8ab9c5ce02 100644
--- a/Geo/GEdge.cpp
+++ b/Geo/GEdge.cpp
@@ -1,4 +1,4 @@
-// $Id: GEdge.cpp,v 1.33 2008-01-20 10:10:41 geuzaine Exp $
+// $Id: GEdge.cpp,v 1.34 2008-01-21 22:16:04 geuzaine Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -73,7 +73,7 @@ SBoundingBox3d GEdge::bounds() const
   if(geomType() != DiscreteCurve && geomType() != BoundaryLayerCurve){
     const int N = 10;
     for(int i = 0; i < N; i++){
-      double t = tr.low() + (double)i/(double)(N - 1) * (tr.high() - tr.low());
+      double t = tr.low() + (double)i / (double)(N - 1) * (tr.high() - tr.low());
       GPoint p = point(t);
       bbox += SPoint3(p.x(), p.y(), p.z());
     }
@@ -139,8 +139,8 @@ double GEdge::curvature(double par) const
   double eps2 = 1.e-5;
 
   Range<double> r = parBounds(0);
-  if (r.low() == par) eps2 = 0;
-  if (r.high() == par) eps1 = 0;
+  if(r.low() == par) eps2 = 0;
+  if(r.high() == par) eps1 = 0;
 
   SVector3 n1 = firstDer(par - eps1);
   SVector3 n2 = firstDer(par + eps2);
@@ -158,4 +158,3 @@ double GEdge::curvature(double par) const
   SVector3 d = one_over_D * (n2 - n1);
   return norm(d);
 }
-
diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp
index e8e3c3a762..67600f5ab2 100644
--- a/Geo/GFace.cpp
+++ b/Geo/GFace.cpp
@@ -1,4 +1,4 @@
-// $Id: GFace.cpp,v 1.40 2008-01-19 22:06:01 geuzaine Exp $
+// $Id: GFace.cpp,v 1.41 2008-01-21 22:16:04 geuzaine Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -276,7 +276,7 @@ void GFace::computeMeanPlane(const std::vector<SPoint3> &points)
   double ex[3], t1[3], t2[3];
 
   // check coherence of results for non-plane surfaces
-  if(geomType() != GEntity::Plane && geomType() != GEntity::DiscreteSurface) {
+  if(geomType() != Plane && geomType() != DiscreteSurface) {
     double res2[3], c[3], cosc, sinc, angplan;
     double eps = 1.e-3;
 
@@ -362,7 +362,7 @@ end:
       meanPlane.x, meanPlane.y, meanPlane.z);
 
   //check coherence for plane surfaces
-  if(geomType() == GEntity::Plane) {
+  if(geomType() == Plane) {
     SBoundingBox3d bb = bounds();
     double lc = norm(SVector3(bb.max(), bb.min()));
     std::list<GVertex*> verts = vertices();
@@ -405,7 +405,7 @@ void GFace::getMeanPlaneData(double plan[3][3]) const
 
 double GFace::curvature (const SPoint2 &param) const
 {
-  if (geomType() == Plane)return 0;
+  if (geomType() == Plane) return 0;
 
   // X=X(u,v) Y=Y(u,v) Z=Z(u,v)
   // curv = div n = dnx/dx + dny/dy + dnz/dz
@@ -413,30 +413,30 @@ double GFace::curvature (const SPoint2 &param) const
 
   const double eps = 1.e-3;
 
-  Pair<SVector3,SVector3> der = firstDer(param) ;
+  Pair<SVector3,SVector3> der = firstDer(param);
 
   SVector3 du = der.first();
   SVector3 dv = der.second();
-  SVector3 nml  = crossprod(du,dv);
+  SVector3 nml = crossprod(du, dv);
 
-  double detJ = norm ( nml );
+  double detJ = norm(nml);
 
   du.normalize();
   dv.normalize();
 
-  SVector3 n1 = normal(SPoint2(param.x() - eps ,  param.y()  )) ;
-  SVector3 n2 = normal(SPoint2(param.x() + eps ,  param.y()  )) ;
-  SVector3 n3 = normal(SPoint2(param.x() ,  param.y()  - eps )) ;
-  SVector3 n4 = normal(SPoint2(param.x() ,  param.y()  + eps )) ;
+  SVector3 n1 = normal(SPoint2(param.x() - eps, param.y()));
+  SVector3 n2 = normal(SPoint2(param.x() + eps, param.y()));
+  SVector3 n3 = normal(SPoint2(param.x(), param.y() - eps));
+  SVector3 n4 = normal(SPoint2(param.x(), param.y() + eps));
 
-  SVector3 dndu = 500 * ( n2-n1 );
-  SVector3 dndv = 500 * ( n4-n3 );
+  SVector3 dndu = 500 * (n2 - n1);
+  SVector3 dndv = 500 * (n4 - n3);
 
-  double c = fabs(dot(dndu,du) +  dot(dndv,dv)) / detJ; 
+  double c = fabs(dot(dndu, du) +  dot(dndv, dv)) / detJ; 
 
-  //  Msg (INFO,"c = %g detJ %g",c,detJ);
+  // Msg(INFO, "c = %g detJ %g", c, detJ);
 
-  return  c;
+  return c;
 }
 
 void GFace::XYZtoUV(const double X, const double Y, const double Z, 
@@ -483,12 +483,6 @@ void GFace::XYZtoUV(const double X, const double Y, const double Z,
 	mat[1][0] = der.right().x();
 	mat[1][1] = der.right().y();
 	mat[1][2] = der.right().z();
-
-// 	printf("X = %g Y = %g Z = %g U %g V %g deru = %g %g %g derv = %g %g %g\n",P.x(),P.y(),P.z(),U,V
-// 	       ,der.left().x(),der.left().y(),der.left().z()
-// 	       ,der.right().x(),der.right().y(),der.right().z());
-// 	getchar();
-
 	mat[2][0] = 0.;
 	mat[2][1] = 0.;
 	mat[2][2] = 0.;
@@ -527,13 +521,10 @@ void GFace::XYZtoUV(const double X, const double Y, const double Z,
   }  
 }
 
-
 SPoint2 GFace::parFromPoint(const SPoint3 &p) const
 {
   double U,V;
-
   XYZtoUV(p.x(),p.y(),p.z(),U,V,1.0);
-
   return SPoint2(U,V);
 }
 
@@ -563,5 +554,4 @@ void GFace::computeGraphicsRep(int nu, int nv)
       _graphicsRep[i][j] = gp;
     }
   }
-
 }
-- 
GitLab