From 09dd6cb204f126a776c62445d831f859cdc636e0 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 3 Feb 2007 13:06:44 +0000 Subject: [PATCH] cleaned last gcc warnings tagging gmsh_2_0_0 --- Geo/Geo.h | 2 +- Geo/MVertex.h | 2 +- Geo/gmshSurface.cpp | 45 +++++++++++++-------------- Geo/gmshSurface.h | 39 ++++++++++++----------- Mesh/meshGRegionDelaunayInsertion.cpp | 8 ++--- doc/gmsh.html | 2 +- 6 files changed, 49 insertions(+), 49 deletions(-) diff --git a/Geo/Geo.h b/Geo/Geo.h index 9922ae7ded..6870eaacbf 100644 --- a/Geo/Geo.h +++ b/Geo/Geo.h @@ -79,7 +79,7 @@ class Vertex { double lc, u, w; Coord Pos; Vertex(double X=0., double Y=0., double Z=0., double l=1., double W=1.) - : geometry(0), Visible(1), lc(l), w(W) + : geometry(0), Num(0), Visible(1), lc(l), u(0.), w(W) { Pos.X = X; Pos.Y = Y; diff --git a/Geo/MVertex.h b/Geo/MVertex.h index ba4b9c1ca6..157a84195a 100644 --- a/Geo/MVertex.h +++ b/Geo/MVertex.h @@ -58,7 +58,7 @@ class MVertex{ // get the "polynomial order" of the vertex inline int getPolynomialOrder(){ return _order; } - inline int setPolynomialOrder(char order){ _order = order; } + inline void setPolynomialOrder(char order){ _order = order; } // get/set the coordinates inline double x() const { return _x; } diff --git a/Geo/gmshSurface.cpp b/Geo/gmshSurface.cpp index 2d5a2a0a25..0e8bfd5621 100644 --- a/Geo/gmshSurface.cpp +++ b/Geo/gmshSurface.cpp @@ -1,4 +1,4 @@ -// $Id: gmshSurface.cpp,v 1.3 2007-02-02 17:16:46 remacle Exp $ +// $Id: gmshSurface.cpp,v 1.4 2007-02-03 13:06:44 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -24,35 +24,34 @@ std::map<int,gmshSurface*> gmshSurface::allGmshSurfaces; -gmshSurface * gmshSphere :: NewSphere ( int iSphere , double x, double y, double z, double r ) +gmshSurface * gmshSphere::NewSphere(int iSphere, double x, double y, double z, double r) { - gmshSphere *sph = new gmshSphere ( x,y,z,r ); + gmshSphere *sph = new gmshSphere(x, y, z, r); - if (allGmshSurfaces.find(iSphere) != allGmshSurfaces.end()) - { - Msg(GERROR,"gmshSurface %d already exists",iSphere); - } - - allGmshSurfaces [iSphere] = sph; + if(allGmshSurfaces.find(iSphere) != allGmshSurfaces.end()){ + Msg(GERROR,"gmshSurface %d already exists",iSphere); + } + + allGmshSurfaces[iSphere] = sph; + return sph; } -gmshSurface * gmshSurface :: surfaceByTag ( int iSurface ) +gmshSurface * gmshSurface::surfaceByTag(int iSurface) { - std::map<int,gmshSurface*>::iterator it = allGmshSurfaces.find(iSurface); - if (it == allGmshSurfaces.end()) - { - Msg(GERROR,"gmshSurface %d does not exist",iSurface); - return 0; - } + std::map<int, gmshSurface*>::iterator it = allGmshSurfaces.find(iSurface); + if(it == allGmshSurfaces.end()){ + Msg(GERROR,"gmshSurface %d does not exist",iSurface); + return 0; + } return it->second; } -SPoint3 gmshSphere::point (double par1, double par2) const +SPoint3 gmshSphere::point (double par1, double par2) const { - par2+= M_PI*.5; - const double x = xc + r * sin ( par2 ) * cos ( par1 ); - const double y = yc + r * sin ( par2 ) * sin ( par1 ); - const double z = zc - r * cos ( par2 ); - // printf("%g %g - %g %g %g\n",par1,par2,x,y,z); - return SPoint3 (x,y,z); + par2 += M_PI*.5; + const double x = xc + r * sin(par2) * cos(par1); + const double y = yc + r * sin(par2) * sin(par1); + const double z = zc - r * cos(par2); + // printf("%g %g - %g %g %g\n",par1,par2,x,y,z); + return SPoint3(x, y, z); } diff --git a/Geo/gmshSurface.h b/Geo/gmshSurface.h index 8a24c9259b..2d672dc19e 100644 --- a/Geo/gmshSurface.h +++ b/Geo/gmshSurface.h @@ -32,15 +32,17 @@ class gmshSurface { protected: - static std::map<int,gmshSurface*> allGmshSurfaces; + static std::map<int, gmshSurface*> allGmshSurfaces; public: - static void reset () { + virtual ~gmshSurface(){} + static void reset () + { std::map<int,gmshSurface*>::iterator it = allGmshSurfaces.begin(); - for ( ; it != allGmshSurfaces.end();++it) + for (; it != allGmshSurfaces.end(); ++it) delete it->second; allGmshSurfaces.clear(); }; - static gmshSurface* surfaceByTag ( int tag ) ; + static gmshSurface* surfaceByTag(int tag); virtual Range<double> parBounds(int i) const = 0; /// Underlying geometric representation of this entity. enum gmshSurfaceType { @@ -52,9 +54,8 @@ public: Torus }; virtual gmshSurface::gmshSurfaceType geomType() const = 0; - virtual SPoint3 point (double par1, double par2) const = 0; - virtual SPoint3 point (const SPoint2 &p) const - {return point(p.x(),p.y()); } + virtual SPoint3 point(double par1, double par2) const = 0; + virtual SPoint3 point(const SPoint2 &p) const { return point(p.x(), p.y()); } virtual SPoint2 parFromPoint(double x, double y, double z) const = 0; // Return the normal to the face at the given parameter location. virtual SVector3 normal(const SPoint2 ¶m) const = 0; @@ -62,21 +63,21 @@ public: virtual Pair<SVector3,SVector3> firstDer(const SPoint2 ¶m) const = 0; }; - class gmshSphere : public gmshSurface { double xc, yc, zc, r; - gmshSphere ( double _x, double _y, double _z, double _r) : xc(_x),yc(_y),zc(_z),r(_r){} + gmshSphere(double _x, double _y, double _z, double _r) : xc(_x), yc(_y), zc(_z), r(_r){} public: - static gmshSurface * NewSphere ( int _iSphere, double _x, double _y, double _z, double _r ); - virtual Range<double> parBounds(int i) const { - if (i == 0) return Range<double> ( 0. , 2 * M_PI) ; - if (i == 1) return Range<double> ( 0. , M_PI) ; + static gmshSurface *NewSphere(int _iSphere, double _x, double _y, double _z, double _r); + virtual Range<double> parBounds(int i) const + { + if(i == 0) return Range<double>(0., 2 * M_PI); + if(i == 1) return Range<double>(0., M_PI); throw; } - /// Underlying geometric representation of this entity. - virtual gmshSurface::gmshSurfaceType geomType() const {return gmshSurface::Sphere;} - virtual SPoint3 point (double par1, double par2) const ; + // Underlying geometric representation of this entity. + virtual gmshSurface::gmshSurfaceType geomType() const { return gmshSurface::Sphere; } + virtual SPoint3 point(double par1, double par2) const; virtual SPoint2 parFromPoint(double x, double y, double z) const { // 2 be done @@ -85,9 +86,9 @@ public: // Return the normal to the face at the given parameter location. virtual SVector3 normal(const SPoint2 ¶m) const { - SPoint3 p1 = gmshSurface::point (param); - SPoint3 p2 (xc,yc,zc); - SVector3 n (p1,p2); + SPoint3 p1 = gmshSurface::point(param); + SPoint3 p2(xc, yc, zc); + SVector3 n(p1, p2); n.normalize(); return n; } diff --git a/Mesh/meshGRegionDelaunayInsertion.cpp b/Mesh/meshGRegionDelaunayInsertion.cpp index b836b39909..e10cbaa4d3 100644 --- a/Mesh/meshGRegionDelaunayInsertion.cpp +++ b/Mesh/meshGRegionDelaunayInsertion.cpp @@ -1,4 +1,4 @@ -// $Id: meshGRegionDelaunayInsertion.cpp,v 1.14 2007-01-31 12:27:18 remacle Exp $ +// $Id: meshGRegionDelaunayInsertion.cpp,v 1.15 2007-02-03 13:06:44 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -304,9 +304,9 @@ bool find_triangle_in_model ( GModel *model , MTriangle *tri, GFace **gfound, bo static compareMTriangleLexicographic cmp; - GEntity *g1 = tri->getVertex(0)->onWhat(); - GEntity *g2 = tri->getVertex(1)->onWhat(); - GEntity *g3 = tri->getVertex(2)->onWhat(); +// GEntity *g1 = tri->getVertex(0)->onWhat(); +// GEntity *g2 = tri->getVertex(1)->onWhat(); +// GEntity *g3 = tri->getVertex(2)->onWhat(); // if (g1 && g2 && g3 && !force) // { diff --git a/doc/gmsh.html b/doc/gmsh.html index 0c94403a84..fcba973118 100644 --- a/doc/gmsh.html +++ b/doc/gmsh.html @@ -25,7 +25,7 @@ generator with built-in pre- and post-processing facilities</h1> <p> <h3 align="center">Christophe Geuzaine and Jean-François Remacle</h3> <p> -<h3 align=center>Version 2.0, January XX 2006</h3> +<h3 align=center>Version 2.0, February 5 2006</h3> <p> <center> <a href="#Description">Description</a> | -- GitLab