From 920a7e4ac73b6abd0e3b0bc159dffe5388f5c67d Mon Sep 17 00:00:00 2001
From: Michel Rasquin <michel.rasquin@cenaero.be>
Date: Fri, 8 Sep 2017 08:49:12 +0200
Subject: [PATCH] Fix name-hiding issues of overriding member fcts in derived
 classes

---
 Geo/GFaceCompound.h    |  2 ++
 Geo/GModelFactory.h    |  1 +
 Geo/GVertex.cpp        |  5 +++++
 Geo/GVertex.h          |  3 ++-
 Geo/GenericFace.h      |  1 +
 Geo/discreteDiskFace.h |  1 +
 Geo/discreteFace.h     |  1 +
 Geo/gmshFace.h         |  1 +
 Geo/gmshSurface.h      |  3 +++
 Mesh/Field.cpp         | 21 +++++++++++++++++++++
 Mesh/Field.h           |  4 +---
 Mesh/yamakawa.h        |  2 ++
 12 files changed, 41 insertions(+), 4 deletions(-)

diff --git a/Geo/GFaceCompound.h b/Geo/GFaceCompound.h
index b00fdd4731..38f61dbd24 100644
--- a/Geo/GFaceCompound.h
+++ b/Geo/GFaceCompound.h
@@ -146,6 +146,7 @@ class GFaceCompound : public GFace {
   Range<double> parBounds(int i) const
   { return trivial() ? (*(_compound.begin()))->parBounds(i) : Range<double>(-1, 1); }
 
+  using GFace::point;
   GPoint point(double par1, double par2) const;
   GPoint pointInRemeshedOctree(double par1, double par2) const;
   SPoint2 parFromPoint(const SPoint3 &p, bool onSurface=true) const;
@@ -216,6 +217,7 @@ class GFaceCompound : public GFace {
   }
   virtual ~GFaceCompound() {}
   virtual void deleteMesh() {}
+  using GFace::point;
   GPoint point(double par1, double par2) const { return GPoint(); }
   Pair<SVector3, SVector3> firstDer(const SPoint2 &param) const
   {
diff --git a/Geo/GModelFactory.h b/Geo/GModelFactory.h
index cfecc2c715..a8e08221b5 100644
--- a/Geo/GModelFactory.h
+++ b/Geo/GModelFactory.h
@@ -220,6 +220,7 @@ class GeoFactory : public GModelFactory {
   GFace *addPlanarFace(GModel *gm, std::vector<std::vector<GEdge *> > edges);
   GFace *addPlanarFace(GModel *gm, const std::vector<std::vector<GEdgeSigned> > &edges);
   GRegion *addVolume(GModel *gm, std::vector<std::vector<GFace *> > faces);
+  using GModelFactory::addCircleArc;
   GEdge *addCircleArc(GModel *gm,GVertex *begin, GVertex *center, GVertex *end);
   std::vector<GFace *> addRuledFaces(GModel *gm, std::vector<std::vector<GEdge *> > edges);
   std::vector<GEntity*> extrudeBoundaryLayer(GModel *gm, GEntity *e, int nbLayers,
diff --git a/Geo/GVertex.cpp b/Geo/GVertex.cpp
index 72b9d93cd6..51b3f33e9b 100644
--- a/Geo/GVertex.cpp
+++ b/Geo/GVertex.cpp
@@ -85,6 +85,11 @@ unsigned int GVertex::getNumMeshElements()
   return points.size();
 }
 
+void GVertex::getNumMeshElements(unsigned *const c) const
+{
+  c[0] += points.size();  
+}
+
 MElement *GVertex::getMeshElement(unsigned int index)
 {
   if(index < points.size())
diff --git a/Geo/GVertex.h b/Geo/GVertex.h
index ea9cc6c42a..d1d0915f7d 100644
--- a/Geo/GVertex.h
+++ b/Geo/GVertex.h
@@ -79,7 +79,8 @@ class GVertex : public GEntity
 
   // get number of elements in the mesh
   unsigned int getNumMeshElements();
-
+  void getNumMeshElements(unsigned *const c) const;
+  
   // get the element at the given index
   MElement *getMeshElement(unsigned int index);
 
diff --git a/Geo/GenericFace.h b/Geo/GenericFace.h
index 4b71fcf778..8dc7423c3b 100644
--- a/Geo/GenericFace.h
+++ b/Geo/GenericFace.h
@@ -42,6 +42,7 @@ public:
   virtual ~GenericFace();
 
   Range<double> parBounds(int i) const;
+  using GFace::point;
   virtual GPoint point(double par1, double par2) const;
   virtual GPoint closestPoint(const SPoint3 & queryPoint,
                               const double initialGuess[2]) const;
diff --git a/Geo/discreteDiskFace.h b/Geo/discreteDiskFace.h
index 0f48619c20..676745680c 100644
--- a/Geo/discreteDiskFace.h
+++ b/Geo/discreteDiskFace.h
@@ -226,6 +226,7 @@ class discreteDiskFace : public GFace {
   virtual ~discreteDiskFace();
   void getTriangleUV(const double u,const double v,discreteDiskFaceTriangle **mt,
                      double &_u, double &_v) const;
+  using GFace::point;
   GPoint point(double par1, double par2) const;
   SPoint2 parFromVertex(MVertex *v) const;
   SVector3 normal(const SPoint2&) const;
diff --git a/Geo/discreteFace.h b/Geo/discreteFace.h
index 44f8727258..71a83fec6a 100644
--- a/Geo/discreteFace.h
+++ b/Geo/discreteFace.h
@@ -33,6 +33,7 @@ class discreteFace : public GFace {
   void addTriangle(triangulation*,MTriangle*);
   void complex_crossField();
   void crossField();
+  using GFace::point;
   GPoint point(double par1, double par2) const;
   SPoint2 parFromPoint(const SPoint3 &p, bool onSurface=true) const;
   SVector3 normal(const SPoint2 &param) const;
diff --git a/Geo/gmshFace.h b/Geo/gmshFace.h
index 86eae0a2e9..0b005bc83f 100644
--- a/Geo/gmshFace.h
+++ b/Geo/gmshFace.h
@@ -22,6 +22,7 @@ class gmshFace : public GFace {
   virtual ~gmshFace(){}
   Range<double> parBounds(int i) const;
   void setModelEdges(std::list<GEdge*> &);
+  using GFace::point;
   virtual GPoint point(double par1, double par2) const;
   virtual GPoint closestPoint(const SPoint3 &queryPoint,
                               const double initialGuess[2]) const;
diff --git a/Geo/gmshSurface.h b/Geo/gmshSurface.h
index 335a4016dc..05d44edaef 100644
--- a/Geo/gmshSurface.h
+++ b/Geo/gmshSurface.h
@@ -72,6 +72,7 @@ class gmshSphere : public gmshSurface
       return Range<double>(0., M_PI);
   }
   virtual gmshSurface::gmshSurfaceType geomType() const { return gmshSurface::Sphere; }
+  using gmshSurface::point;
   virtual SPoint3 point(double par1, double par2) const;
   virtual SVector3 normal(const SPoint2 &param) const
   {
@@ -100,6 +101,7 @@ class gmshPolarSphere : public gmshSurface
       return Range<double>(-M_PI, M_PI);
   }
   virtual gmshSurface::gmshSurfaceType geomType() const { return gmshSurface::PolarSphere; }
+  using gmshSurface::point;
   virtual SPoint3 point(double par1, double par2) const;
   virtual SVector3 normal(const SPoint2 &param) const
   {
@@ -130,6 +132,7 @@ class gmshParametricSurface : public gmshSurface
   { 
     return gmshSurface::ParametricSurface; 
   }
+  using gmshSurface::point;
   virtual SPoint3 point(double par1, double par2) const;
 };
 
diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp
index dda27c37f7..009aa25806 100644
--- a/Mesh/Field.cpp
+++ b/Mesh/Field.cpp
@@ -182,6 +182,7 @@ class StructuredField : public Field
   {
     if(data) delete[]data;
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     if(update_needed) {
@@ -370,6 +371,7 @@ class LonLatField : public Field
   {
     return "LonLat";
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     Field *field = GModel::current()->getFields()->get(iField);
@@ -423,6 +425,7 @@ class BoxField : public Field
   {
     return "Box";
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     return (x <= x_max && x >= x_min && y <= y_max && y >= y_min && z <= z_max
@@ -479,6 +482,7 @@ class CylinderField : public Field
   {
     return "Cylinder";
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     double dx = x-xc;
@@ -532,6 +536,7 @@ class BallField : public Field
   {
     return "Ball";
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     double dx = x-xc;
@@ -610,6 +615,7 @@ class FrustumField : public Field
   {
     return "Frustum";
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     double dx = x-x1;
@@ -680,6 +686,7 @@ class ThresholdField : public Field
       (stopAtDistMax, "True to not impose element size outside DistMax (i.e., "
        "F = a very big value if Field[IField] > DistMax)");
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     Field *field = GModel::current()->getFields()->get(iField);
@@ -729,6 +736,7 @@ class GradientField : public Field
     options["Delta"] = new FieldOptionDouble
       (delta, "Finite difference step");
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     Field *field = GModel::current()->getFields()->get(iField);
@@ -796,6 +804,7 @@ class CurvatureField : public Field
     g[1] /= n;
     g[2] /= n;
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     Field *field = GModel::current()->getFields()->get(iField);
@@ -836,6 +845,7 @@ class MaxEigenHessianField : public Field
     options["Delta"] = new FieldOptionDouble
       (delta, "Step used for the finite differences");
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     Field *field = GModel::current()->getFields()->get(iField);
@@ -888,6 +898,7 @@ class LaplacianField : public Field
     options["Delta"] = new FieldOptionDouble
       (delta, "Finite difference step");
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     Field *field = GModel::current()->getFields()->get(iField);
@@ -924,6 +935,7 @@ class MeanField : public Field
     options["Delta"] = new FieldOptionDouble
       (delta, "Distance used to compute the mean value");
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     Field *field = GModel::current()->getFields()->get(iField);
@@ -1089,6 +1101,7 @@ class MathEvalField : public Field
       (f, "Mathematical function to evaluate.", &update_needed);
     f = "F2 + Sin(z)";
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     if(update_needed) {
@@ -1320,6 +1333,7 @@ class ExternalProcessField : public Field
   ~ExternalProcessField() {
     closePipes();
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     double xyz[3] = {x, y, z};
@@ -1430,6 +1444,7 @@ class ParametricField : public Field
       "See the MathEval Field help to get a description of valid FX, FY "
       "and FZ expressions.";
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     if(update_needed) {
@@ -1705,6 +1720,7 @@ class MinField : public Field
   {
     return "Take the minimum value of a list of fields.";
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     double v = MAX_LC;
@@ -1744,6 +1760,7 @@ class MaxField : public Field
   {
     return "Take the maximum value of a list of fields.";
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     double v = -MAX_LC;
@@ -1789,6 +1806,7 @@ class RestrictField : public Field
     return "Restrict the application of a field to a given list of geometrical "
       "points, curves, surfaces or volumes.";
   }
+  using Field::operator();
   double operator() (double x, double y, double z, GEntity *ge=0)
   {
     Field *f = (GModel::current()->getFields()->get(iField));
@@ -2175,6 +2193,7 @@ public:
     }
   }
 
+  using Field::operator();
   virtual double operator() (double X, double Y, double Z, GEntity *ge=0)
   {
 #if defined(_OPENMP)
@@ -2363,6 +2382,7 @@ public:
     }
   }
   
+  using Field::operator();
   virtual double operator() (double X, double Y, double Z, GEntity *ge=0)
   {
     double query_pt[3] = {X,Y,Z};
@@ -2521,6 +2541,7 @@ class OctreeField : public Field {
       _root->init(bounds.min().x(), bounds.min().y(), bounds.min().z(), _l0, *_inField, 4);
     }
   }
+  using Field::operator();
   virtual double operator() (double X, double Y, double Z, GEntity *ge=0)
   {
     SPoint3 xmin = bounds.min();
diff --git a/Mesh/Field.h b/Mesh/Field.h
index b036950a34..584ac81219 100644
--- a/Mesh/Field.h
+++ b/Mesh/Field.h
@@ -100,9 +100,6 @@ class Field {
   virtual double operator() (double x, double y, double z, GEntity *ge=0) = 0;
   // anisotropic
   virtual void operator() (double x, double y, double z, SMetric3 &, GEntity *ge=0){}
-  // temporary
-  virtual void operator()(double x, double y, double z, SVector3& v1, SVector3& v2,
-                          SVector3& v3,GEntity* ge=0){}
   bool update_needed;
   virtual const char *getName() = 0;
 #if defined(HAVE_POST)
@@ -388,6 +385,7 @@ class GenericField : public Field{
 
     GenericField();
     ~GenericField();
+    using Field::operator();
     virtual double operator() (double x, double y, double z, GEntity *ge=0);
     virtual const char *getName(){return "GenericField";};
 
diff --git a/Mesh/yamakawa.h b/Mesh/yamakawa.h
index c1420bfe26..2693f99c64 100644
--- a/Mesh/yamakawa.h
+++ b/Mesh/yamakawa.h
@@ -784,6 +784,7 @@ protected:
   }
 
   // Throw an assertion
+  using Recombinator::merge;
   void merge(GRegion*);
 
   // ------- exports --------
@@ -802,6 +803,7 @@ protected:
 public:
   Recombinator_Graph(unsigned int max_nb_cliques, string filename=string());
   virtual ~Recombinator_Graph();
+  using Recombinator::execute;
   virtual void execute(GRegion*);
 
   virtual void buildGraphOnly(unsigned int max_nb_cliques, string filename=string());
-- 
GitLab