From b1f5579c4307073d5f64f2946ee04417fe0fd186 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Mon, 21 Jan 2008 23:28:53 +0000
Subject: [PATCH] API cleanup: new discreteVertex, discreteEdge, ... entities
 (replacing the old hacks in gmshVertex, gmshEdge, ...), the future basis of
 the indepedent "null" model (cf. HAVE_NO_GEO define)

---
 Fltk/GUI_Classifier.cpp | 22 +++++++++++-----------
 Fltk/Makefile           |  7 +++----
 Geo/GModelIO_Mesh.cpp   | 23 ++++++++++++-----------
 Geo/Makefile            | 23 +++++++++++------------
 Geo/discreteEdge.h      | 29 +++++++++++++++++++++++++++++
 Geo/discreteFace.h      | 31 +++++++++++++++++++++++++++++++
 Geo/discreteRegion.h    | 23 +++++++++++++++++++++++
 Geo/discreteVertex.h    | 25 +++++++++++++++++++++++++
 Geo/gmshEdge.cpp        | 12 ++----------
 Geo/gmshEdge.h          |  3 ---
 Geo/gmshFace.cpp        | 25 +++++++------------------
 Geo/gmshFace.h          |  3 ---
 Geo/gmshRegion.cpp      | 12 ++----------
 Geo/gmshRegion.h        |  1 -
 Geo/gmshVertex.h        |  3 ---
 Plugin/Makefile         |  5 ++---
 Plugin/Triangulate.cpp  |  4 ++--
 17 files changed, 160 insertions(+), 91 deletions(-)
 create mode 100644 Geo/discreteEdge.h
 create mode 100644 Geo/discreteFace.h
 create mode 100644 Geo/discreteRegion.h
 create mode 100644 Geo/discreteVertex.h

diff --git a/Fltk/GUI_Classifier.cpp b/Fltk/GUI_Classifier.cpp
index 91a891f266..6bce0784e3 100644
--- a/Fltk/GUI_Classifier.cpp
+++ b/Fltk/GUI_Classifier.cpp
@@ -1,4 +1,4 @@
-// $Id: GUI_Classifier.cpp,v 1.7 2008-01-19 22:06:00 geuzaine Exp $
+// $Id: GUI_Classifier.cpp,v 1.8 2008-01-21 23:28:52 geuzaine Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -29,8 +29,8 @@
 #include "Message.h"
 #include "meshGFaceDelaunayInsertion.h"
 #include "meshGFaceOptimize.h"
-#include "gmshEdge.h"
-#include "gmshFace.h"
+#include "discreteEdge.h"
+#include "discreteFace.h"
 
 extern Context_T CTX;
 
@@ -143,7 +143,7 @@ GEdge * getNewModelEdge (GFace *gf1, GFace *gf2, std::map< std::pair <int, int>
   std::map< std::pair <int, int> , GEdge* >::iterator it = newEdges.find(std::make_pair<int,int>(i1,i2));
   if (it == newEdges.end())
     {
-      gmshEdge *temporary = new gmshEdge ( GModel::current(), maxEdgeNum() + 1);
+      discreteEdge *temporary = new discreteEdge(GModel::current(), maxEdgeNum() + 1);
       GModel::current()->add (temporary);
       newEdges[std::make_pair<int,int>(i1,i2)] = temporary;
       
@@ -233,9 +233,9 @@ void class_color_cb(Fl_Widget* w, void* data)
       {
 	if (!(*it)->isDeleted())
 	  {
-	    gmshFace *temporary = new gmshFace ( GModel::current(), maxFaceNum() + 1);
-	    recurClassify ( *it , temporary,lines, reverse); 
-	    GModel::current()->add (temporary);
+	    discreteFace *temporary = new discreteFace(GModel::current(), maxFaceNum() + 1);
+	    recurClassify(*it, temporary, lines, reverse);
+	    GModel::current()->add(temporary);
 	  }
 	++it;
       }
@@ -451,10 +451,10 @@ classificationEditor::classificationEditor()
   // saved for the ones that have been saved by the user
   // and that will be used for next step
 
-  temporary = new gmshEdge ( GModel::current(), maxEdgeNum() + 1 );
-  GModel::current()->add (temporary);
-  saved = new gmshEdge ( GModel::current(), maxEdgeNum() + 1 );
-  GModel::current()->add (saved);
+  temporary = new discreteEdge(GModel::current(), maxEdgeNum() + 1);
+  GModel::current()->add(temporary);
+  saved = new discreteEdge(GModel::current(), maxEdgeNum() + 1);
+  GModel::current()->add(saved);
   
   _window->end();
   _window->hotspot(_window);
diff --git a/Fltk/Makefile b/Fltk/Makefile
index d921884846..7af278d302 100644
--- a/Fltk/Makefile
+++ b/Fltk/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.163 2008-01-21 20:34:54 geuzaine Exp $
+# $Id: Makefile,v 1.164 2008-01-21 23:28:52 geuzaine Exp $
 #
 # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 #
@@ -153,9 +153,8 @@ GUI_Classifier.o: GUI_Classifier.cpp GUI_Classifier.h ../Common/GmshUI.h \
   ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \
   ../Geo/SBoundingBox3d.h ../Numeric/Numeric.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \
-  ../Common/SmoothData.h ../Geo/GEdge.h ../Geo/gmshVertex.h ../Geo/Geo.h \
-  ../Geo/GVertex.h ../Geo/MVertex.h ../Geo/Range.h ../Geo/gmshFace.h \
-  ../Geo/Geo.h ../Geo/GFace.h ../Geo/gmshVertex.h ../Geo/Range.h
+  ../Common/SmoothData.h ../Geo/GEdge.h ../Geo/gmshFace.h ../Geo/Geo.h \
+  ../Geo/GFace.h
 Callbacks.o: Callbacks.cpp ../Common/GmshUI.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/Tools.h ../DataStr/List.h \
   ../DataStr/Tree.h ../DataStr/avl.h ../Geo/GModel.h ../Geo/GVertex.h \
diff --git a/Geo/GModelIO_Mesh.cpp b/Geo/GModelIO_Mesh.cpp
index 691813dfee..416e16b3e9 100644
--- a/Geo/GModelIO_Mesh.cpp
+++ b/Geo/GModelIO_Mesh.cpp
@@ -1,4 +1,4 @@
-// $Id: GModelIO_Mesh.cpp,v 1.26 2008-01-20 10:10:41 geuzaine Exp $
+// $Id: GModelIO_Mesh.cpp,v 1.27 2008-01-21 23:28:52 geuzaine Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -26,9 +26,10 @@
 #include "Message.h"
 #include "GmshDefines.h"
 #include "GModel.h"
-#include "gmshRegion.h"
-#include "gmshFace.h"
-#include "gmshEdge.h"
+#include "discreteRegion.h"
+#include "discreteFace.h"
+#include "discreteEdge.h"
+#include "discreteVertex.h"
 #include "MElement.h"
 #include "SBoundingBox3d.h"
 
@@ -62,7 +63,7 @@ static void storeElementsInEntities(GModel *m,
       {
 	GEdge *e = m->edgeByTag(it->first);
 	if(!e){
-	  e = new gmshEdge(m, it->first);
+	  e = new discreteEdge(m, it->first);
 	  m->add(e);
 	}
 	addElements(e->lines, it->second);
@@ -72,7 +73,7 @@ static void storeElementsInEntities(GModel *m,
       {
 	GFace *f = m->faceByTag(it->first);
 	if(!f){
-	  f = new gmshFace(m, it->first);
+	  f = new discreteFace(m, it->first);
 	  m->add(f);
 	}
 	if(numEdges == 3) addElements(f->triangles, it->second);
@@ -83,7 +84,7 @@ static void storeElementsInEntities(GModel *m,
       {
 	GRegion *r = m->regionByTag(it->first);
 	if(!r){
-	  r = new gmshRegion(m, it->first);
+	  r = new discreteRegion(m, it->first);
 	  m->add(r);
 	}
 	if(numEdges == 6) addElements(r->tetrahedra, it->second);
@@ -525,7 +526,7 @@ int GModel::readMSH(const std::string &name)
       it != points.end(); ++it){
     GVertex *v = vertexByTag(it->first);
     if(!v){
-      v = new gmshVertex(this, it->first);
+      v = new discreteVertex(this, it->first);
       add(v);
     }
     for(unsigned int i = 0; i < it->second.size(); i++) 
@@ -936,7 +937,7 @@ int GModel::readSTL(const std::string &name, double tolerance)
   Msg(INFO, "%d facets", points.size() / 3);
 
   // create face
-  GFace *face = new gmshFace(this, numFace() + 1);
+  GFace *face = new discreteFace(this, numFace() + 1);
   add(face);
 
   // create (unique) vertices and triangles
@@ -2025,7 +2026,7 @@ int GModel::readP3D(const std::string &name)
 
   for(int n = 0; n < numBlocks; n++){
     if(Nk[n] == 1){
-      GFace *gf = new gmshFace(this, numFace() + 1);
+      GFace *gf = new discreteFace(this, numFace() + 1);
       add(gf);
       gf->transfinite_vertices.resize(Ni[n]);
       for(int i = 0; i < Ni[n]; i++)
@@ -2058,7 +2059,7 @@ int GModel::readP3D(const std::string &name)
 			     gf->transfinite_vertices[i    ][j + 1]));
     }
     else{
-      GRegion *gr = new gmshRegion(this, numRegion() + 1);
+      GRegion *gr = new discreteRegion(this, numRegion() + 1);
       add(gr);
       gr->transfinite_vertices.resize(Ni[n]);
       for(int i = 0; i < Ni[n]; i++){
diff --git a/Geo/Makefile b/Geo/Makefile
index fe139b89b3..5ae914aa26 100644
--- a/Geo/Makefile
+++ b/Geo/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.177 2008-01-21 20:34:54 geuzaine Exp $
+# $Id: Makefile,v 1.178 2008-01-21 23:28:53 geuzaine Exp $
 #
 # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 #
@@ -103,21 +103,20 @@ gmshEdge.o: gmshEdge.cpp GModel.h GVertex.h GEntity.h Range.h SPoint3.h \
   SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h SVector3.h GFace.h \
   GEdgeLoop.h Pair.h GRegion.h gmshEdge.h Geo.h ../Common/GmshDefines.h \
   gmshSurface.h ../Numeric/Numeric.h ../DataStr/List.h ../DataStr/Tree.h \
-  ../DataStr/avl.h ExtrudeParams.h ../Common/SmoothData.h gmshVertex.h \
-  MVertex.h GeoInterpolation.h ../Common/Message.h ../Common/Context.h
+  ../DataStr/avl.h ExtrudeParams.h ../Common/SmoothData.h \
+  GeoInterpolation.h ../Common/Message.h ../Common/Context.h
 gmshFace.o: gmshFace.cpp GModel.h GVertex.h GEntity.h Range.h SPoint3.h \
   SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h SVector3.h GFace.h \
-  GEdgeLoop.h Pair.h GRegion.h gmshVertex.h Geo.h ../Common/GmshDefines.h \
+  GEdgeLoop.h Pair.h GRegion.h gmshFace.h Geo.h ../Common/GmshDefines.h \
   gmshSurface.h ../Numeric/Numeric.h ../DataStr/List.h ../DataStr/Tree.h \
-  ../DataStr/avl.h ExtrudeParams.h ../Common/SmoothData.h MVertex.h \
-  gmshEdge.h gmshFace.h GeoInterpolation.h ../Common/Message.h
+  ../DataStr/avl.h ExtrudeParams.h ../Common/SmoothData.h \
+  GeoInterpolation.h ../Common/Message.h
 gmshRegion.o: gmshRegion.cpp GModel.h GVertex.h GEntity.h Range.h \
   SPoint3.h SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h SVector3.h \
-  GFace.h GEdgeLoop.h Pair.h GRegion.h gmshFace.h Geo.h \
+  GFace.h GEdgeLoop.h Pair.h GRegion.h gmshRegion.h Geo.h \
   ../Common/GmshDefines.h gmshSurface.h ../Numeric/Numeric.h \
   ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ExtrudeParams.h \
-  ../Common/SmoothData.h gmshVertex.h MVertex.h gmshRegion.h \
-  ../Common/Message.h
+  ../Common/SmoothData.h ../Common/Message.h
 gmshSurface.o: gmshSurface.cpp gmshSurface.h Pair.h Range.h SPoint2.h \
   SPoint3.h SVector3.h SBoundingBox3d.h ../Numeric/Numeric.h \
   ../Common/Message.h
@@ -171,10 +170,10 @@ GModelIO_Geo.o: GModelIO_Geo.cpp GModel.h GVertex.h GEntity.h Range.h \
 GModelIO_Mesh.o: GModelIO_Mesh.cpp ../Common/Message.h \
   ../Common/GmshDefines.h GModel.h GVertex.h GEntity.h Range.h SPoint3.h \
   SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h SVector3.h GFace.h \
-  GEdgeLoop.h Pair.h GRegion.h gmshRegion.h Geo.h gmshSurface.h \
+  GEdgeLoop.h Pair.h GRegion.h discreteRegion.h Geo.h gmshSurface.h \
   ../Numeric/Numeric.h ../DataStr/List.h ../DataStr/Tree.h \
-  ../DataStr/avl.h ExtrudeParams.h ../Common/SmoothData.h gmshFace.h \
-  gmshVertex.h MVertex.h gmshEdge.h MElement.h MEdge.h MFace.h
+  ../DataStr/avl.h ExtrudeParams.h ../Common/SmoothData.h discreteFace.h \
+  discreteEdge.h discreteVertex.h MVertex.h MElement.h MEdge.h MFace.h
 GModelIO_OCC.o: GModelIO_OCC.cpp GModelIO_OCC.h GModel.h GVertex.h \
   GEntity.h Range.h SPoint3.h SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h \
   SVector3.h GFace.h GEdgeLoop.h Pair.h GRegion.h OCCIncludes.h \
diff --git a/Geo/discreteEdge.h b/Geo/discreteEdge.h
new file mode 100644
index 0000000000..64d9fcb8d3
--- /dev/null
+++ b/Geo/discreteEdge.h
@@ -0,0 +1,29 @@
+#ifndef _DISCRETE_EDGE_H_
+#define _DISCRETE_EDGE_H_
+
+#include "GModel.h"
+#include "GEdge.h"
+
+#if !defined(HAVE_NO_GEO)
+#include "Geo.h"
+#endif
+
+class discreteEdge : public GEdge {
+ public:
+  discreteEdge(GModel *model, int num) : GEdge(model, num, 0, 0) 
+  {
+#if !defined(HAVE_NO_GEO)
+    Curve *c = Create_Curve(num, MSH_SEGM_DISCRETE, 0, 0, 0, -1, -1, 0., 1.);
+    Tree_Add(model->getGEOInternals()->Curves, &c);
+    CreateReversedCurve(c);
+#endif
+  }
+  virtual ~discreteEdge() {}
+  virtual GeomType geomType() const { return DiscreteCurve; }
+  virtual GPoint point(double p) const { throw; }
+  virtual int containsParam(double pt) const { throw; }
+  virtual SVector3 firstDer(double par) const { throw; }
+  virtual double parFromPoint(const SPoint3 &pt) const { throw; }
+};
+
+#endif
diff --git a/Geo/discreteFace.h b/Geo/discreteFace.h
new file mode 100644
index 0000000000..cca31e4c63
--- /dev/null
+++ b/Geo/discreteFace.h
@@ -0,0 +1,31 @@
+#ifndef _DISCRETE_FACE_H_
+#define _DISCRETE_FACE_H_
+
+#include "GModel.h"
+#include "GFace.h"
+
+#if !defined(HAVE_NO_GEO)
+#include "Geo.h"
+#endif
+
+class discreteFace : public GFace {
+ public:
+  discreteFace(GModel *model, int num) : GFace(model, num)
+  {
+#if !defined(HAVE_NO_GEO)
+    Surface *s = Create_Surface(num, MSH_SURF_DISCRETE);
+    Tree_Add(model->getGEOInternals()->Surfaces, &s);
+#endif
+    meshStatistics.status = GFace::DONE;    
+  }
+  virtual ~discreteFace() {}
+  virtual GPoint point(double par1, double par2) const { throw; }
+  virtual SPoint2 parFromPoint(const SPoint3 &p) const { throw; }
+  virtual int containsParam(const SPoint2 &pt) const { throw; }
+  virtual SVector3 normal(const SPoint2 &param) const { throw; }
+  virtual GEntity::GeomType geomType() const { return DiscreteSurface; }
+  virtual Pair<SVector3,SVector3> firstDer(const SPoint2 &param) const { throw; }
+};
+
+#endif
+
diff --git a/Geo/discreteRegion.h b/Geo/discreteRegion.h
new file mode 100644
index 0000000000..71120f6f72
--- /dev/null
+++ b/Geo/discreteRegion.h
@@ -0,0 +1,23 @@
+#ifndef _DISCRETE_REGION_H_
+#define _DISCRETE_REGION_H_
+
+#include "GRegion.h"
+
+#if !defined(HAVE_NO_GEO)
+#include "Geo.h"
+#endif
+
+class discreteRegion : public GRegion {
+ public:
+  discreteRegion(GModel *model, int num) : GRegion(model, num)
+  {
+#if !defined(HAVE_NO_GEO)
+    ::Volume *v = Create_Volume(num, MSH_VOLUME_DISCRETE);
+    Tree_Add(model->getGEOInternals()->Volumes, &v);
+#endif
+  }
+  virtual ~discreteRegion() {}
+  virtual GeomType geomType() const { return DiscreteVolume; }
+};
+
+#endif
diff --git a/Geo/discreteVertex.h b/Geo/discreteVertex.h
new file mode 100644
index 0000000000..4eed5cba62
--- /dev/null
+++ b/Geo/discreteVertex.h
@@ -0,0 +1,25 @@
+#ifndef _DISCRETE_VERTEX_H_
+#define _DISCRETE_VERTEX_H_
+
+#include "GModel.h"
+#include "GVertex.h"
+#include "MVertex.h"
+
+class discreteVertex : public GVertex {
+ private:
+  double _x, _y, _z;
+ public:
+  discreteVertex(GModel *m, int num, double x, double y, double z)
+    : GVertex(m, num), _x(x), _y(y), _z(z)
+  {
+    mesh_vertices.push_back(new MVertex(x, y, z, this));
+  }
+  discreteVertex(GModel *m, int num) : GVertex(m, num) {}
+  virtual ~discreteVertex() {}
+  virtual GPoint point() const { return GPoint(_x, _y, _z); }
+  virtual double x() const { return _x; }
+  virtual double y() const { return _y; }
+  virtual double z() const { return _z; }
+};
+
+#endif
diff --git a/Geo/gmshEdge.cpp b/Geo/gmshEdge.cpp
index e27bc10207..2598a910af 100644
--- a/Geo/gmshEdge.cpp
+++ b/Geo/gmshEdge.cpp
@@ -1,4 +1,4 @@
-// $Id: gmshEdge.cpp,v 1.42 2008-01-21 19:22:50 geuzaine Exp $
+// $Id: gmshEdge.cpp,v 1.43 2008-01-21 23:28:53 geuzaine Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -35,14 +35,6 @@ gmshEdge::gmshEdge(GModel *m, Curve *edge, GVertex *v1, GVertex *v2)
   resetMeshAttributes();
 }
 
-gmshEdge::gmshEdge(GModel *m, int num)
-  : GEdge(m, num, 0, 0)
-{
-  c = Create_Curve(num, MSH_SEGM_DISCRETE, 0, NULL, NULL, -1, -1, 0., 1.);
-  Tree_Add(m->getGEOInternals()->Curves, &c);
-  CreateReversedCurve(c);
-}
-
 void gmshEdge::resetMeshAttributes()
 {
   meshAttributes.Method = c->Method;
@@ -60,7 +52,7 @@ Range<double> gmshEdge::parBounds(int i) const
 GPoint gmshEdge::point(double par) const
 {
   Vertex a = InterpolateCurve(c, par, 0);
-  return GPoint(a.Pos.X,a.Pos.Y,a.Pos.Z,this,par);
+  return GPoint(a.Pos.X, a.Pos.Y, a.Pos.Z, this, par);
 }
 
 GPoint gmshEdge::closestPoint(const SPoint3 &qp) const
diff --git a/Geo/gmshEdge.h b/Geo/gmshEdge.h
index 146383fcd7..6ed9edeede 100644
--- a/Geo/gmshEdge.h
+++ b/Geo/gmshEdge.h
@@ -22,8 +22,6 @@
 
 #include "Geo.h"
 #include "GEdge.h"
-#include "gmshVertex.h"
-#include "Range.h"
 
 class gmshEdge : public GEdge {
  protected:
@@ -31,7 +29,6 @@ class gmshEdge : public GEdge {
 
  public:
   gmshEdge(GModel *model, Curve *edge, GVertex *v1, GVertex *v2);
-  gmshEdge(GModel *model, int num);
   virtual ~gmshEdge() {}
   virtual Range<double> parBounds(int i) const;
   virtual GeomType geomType() const;
diff --git a/Geo/gmshFace.cpp b/Geo/gmshFace.cpp
index d5ed8a8a08..cf177de2dc 100644
--- a/Geo/gmshFace.cpp
+++ b/Geo/gmshFace.cpp
@@ -1,4 +1,4 @@
-// $Id: gmshFace.cpp,v 1.44 2008-01-21 19:22:50 geuzaine Exp $
+// $Id: gmshFace.cpp,v 1.45 2008-01-21 23:28:53 geuzaine Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -20,8 +20,6 @@
 // Please report all bugs and problems to <gmsh@geuz.org>.
 
 #include "GModel.h"
-#include "gmshVertex.h"
-#include "gmshEdge.h"
 #include "gmshFace.h"
 #include "Geo.h"
 #include "GeoInterpolation.h"
@@ -84,27 +82,18 @@ gmshFace::gmshFace(GModel *m, Surface *face)
   resetMeshAttributes();
 }
 
-
-double gmshFace::getMetricEigenvalue ( const SPoint2 &pt) 
-{
-  if(!s->geometry)return 1;
-  return s->geometry->getMetricEigenvalue (pt) ;
-}
-
-gmshFace::gmshFace(GModel *m, int num)
-  : GFace(m, num)
+double gmshFace::getMetricEigenvalue(const SPoint2 &pt)
 {
-  s = Create_Surface(num, MSH_SURF_DISCRETE);
-  Tree_Add(m->getGEOInternals()->Surfaces, &s);
-  meshStatistics.status = GFace::DONE;
+  if(!s->geometry) return 1;
+  return s->geometry->getMetricEigenvalue(pt);
 }
 
-void gmshFace::setModelEdges(std::list<GEdge*>&ed)
+void gmshFace::setModelEdges(std::list<GEdge*> &ed)
 {
-  for (std::list<GEdge*>::iterator it = ed.begin(); it!=ed.end() ; ++it){
+  for (std::list<GEdge*>::iterator it = ed.begin(); it != ed.end() ; ++it){
     l_edges.push_back(*it);
     (*it)->addFace(this);
-    l_dirs.push_back( 1 );
+    l_dirs.push_back(1);
   }
 }
 
diff --git a/Geo/gmshFace.h b/Geo/gmshFace.h
index 5ea6ff8d83..5163e2b1f8 100644
--- a/Geo/gmshFace.h
+++ b/Geo/gmshFace.h
@@ -22,8 +22,6 @@
 
 #include "Geo.h"
 #include "GFace.h"
-#include "gmshVertex.h"
-#include "Range.h"
 
 class gmshFace : public GFace {
  protected:
@@ -31,7 +29,6 @@ class gmshFace : public GFace {
 
  public:
   gmshFace(GModel *m, Surface *face);
-  gmshFace(GModel *m, int num);
   virtual ~gmshFace(){}
   Range<double> parBounds(int i) const; 
   void setModelEdges(std::list<GEdge*>&);
diff --git a/Geo/gmshRegion.cpp b/Geo/gmshRegion.cpp
index 1b1b931be8..28b327e2b2 100644
--- a/Geo/gmshRegion.cpp
+++ b/Geo/gmshRegion.cpp
@@ -1,4 +1,4 @@
-// $Id: gmshRegion.cpp,v 1.16 2007-09-26 20:51:58 geuzaine Exp $
+// $Id: gmshRegion.cpp,v 1.17 2008-01-21 23:28:53 geuzaine Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -20,12 +20,11 @@
 // Please report all bugs and problems to <gmsh@geuz.org>.
 
 #include "GModel.h"
-#include "gmshFace.h"
 #include "gmshRegion.h"
 #include "Geo.h"
 #include "Message.h"
 
-gmshRegion::gmshRegion(GModel *m, ::Volume * volume)
+gmshRegion::gmshRegion(GModel *m, ::Volume *volume)
   : GRegion(m, volume->Num), v(volume)
 {
   for(int i = 0; i < List_Nbr(v->Surfaces); i++){
@@ -56,13 +55,6 @@ gmshRegion::gmshRegion(GModel *m, ::Volume * volume)
   resetMeshAttributes();
 }
 
-gmshRegion::gmshRegion(GModel *m, int num)
-  : GRegion(m, num)
-{
-  v = Create_Volume(num, MSH_VOLUME_DISCRETE);
-  Tree_Add(m->getGEOInternals()->Volumes, &v);
-}
-
 void gmshRegion::resetMeshAttributes()
 {
   meshAttributes.Method = v->Method;
diff --git a/Geo/gmshRegion.h b/Geo/gmshRegion.h
index 49ca96a304..37a2f8ce7b 100644
--- a/Geo/gmshRegion.h
+++ b/Geo/gmshRegion.h
@@ -28,7 +28,6 @@ class gmshRegion : public GRegion {
   ::Volume *v;
  public:
   gmshRegion(GModel *m, ::Volume *_v);
-  gmshRegion(GModel *m, int num);
   virtual ~gmshRegion() {}
   virtual GeomType geomType() const;
   ModelType getNativeType() const { return GmshModel; }
diff --git a/Geo/gmshVertex.h b/Geo/gmshVertex.h
index 1869f013cd..e066dcf86b 100644
--- a/Geo/gmshVertex.h
+++ b/Geo/gmshVertex.h
@@ -33,9 +33,6 @@ class gmshVertex : public GVertex {
   {
     mesh_vertices.push_back(new MVertex(x(), y(), z(), this));
   }
-  gmshVertex(GModel *m, int num) : GVertex(m, num), v(0)
-  {
-  }
   virtual ~gmshVertex() {}
   virtual GPoint point() const 
   {
diff --git a/Plugin/Makefile b/Plugin/Makefile
index 0b7d7228d4..9356a190f6 100644
--- a/Plugin/Makefile
+++ b/Plugin/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.141 2008-01-20 12:21:30 geuzaine Exp $
+# $Id: Makefile,v 1.142 2008-01-21 23:28:53 geuzaine Exp $
 #
 # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 #
@@ -188,8 +188,7 @@ Triangulate.o: Triangulate.cpp ../Common/Message.h ../Geo/gmshFace.h \
   ../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h \
   ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/SVector3.h \
   ../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/SPoint2.h ../Geo/SVector3.h \
-  ../Geo/Pair.h ../Geo/gmshVertex.h ../Geo/Geo.h ../Geo/GVertex.h \
-  ../Geo/MVertex.h ../Geo/SPoint3.h ../Geo/Range.h Triangulate.h Plugin.h \
+  ../Geo/Pair.h ../Geo/MVertex.h ../Geo/SPoint3.h Triangulate.h Plugin.h \
   ../Common/Options.h ../Post/ColorTable.h ../Post/PView.h \
   ../Post/PViewData.h ../Post/PViewOptions.h ../Post/ColorTable.h \
   ../Post/PViewDataList.h ../Post/PViewData.h ../Post/AdaptiveViews.h \
diff --git a/Plugin/Triangulate.cpp b/Plugin/Triangulate.cpp
index 681e612527..2f97a2ee2e 100644
--- a/Plugin/Triangulate.cpp
+++ b/Plugin/Triangulate.cpp
@@ -1,4 +1,4 @@
-// $Id: Triangulate.cpp,v 1.38 2008-01-19 22:06:08 geuzaine Exp $
+// $Id: Triangulate.cpp,v 1.39 2008-01-21 23:28:53 geuzaine Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -126,7 +126,7 @@ static void Triangulate(int nbIn, List_T *inList, int *nbOut, List_T *outList,
 				 *(double *)List_Pointer_Fast(inList, i + 2),
 				 0, j++));
 
-  gmshFace *s = new gmshFace(0, 1);
+  gmshFace *s = new gmshFace(0, 0);
   s->computeMeanPlane(points);
   double plan[3][3];
   s->getMeanPlaneData(plan);
-- 
GitLab