From 8d7207a3f6ee84aed9159a8c1bf5fbab50ab1235 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 11 Feb 2003 03:13:31 +0000
Subject: [PATCH] Make Triangle optional (license issues)

---
 Fltk/GUI.cpp    |  9 ++++++---
 Fltk/Makefile   |  4 ++--
 Mesh/Makefile   |  8 ++++----
 doc/FAQ         | 10 +++++-----
 tutorial/t7.geo |  2 +-
 5 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp
index e6955c5616..c3f528a2f0 100644
--- a/Fltk/GUI.cpp
+++ b/Fltk/GUI.cpp
@@ -1,4 +1,4 @@
-// $Id: GUI.cpp,v 1.225 2003-01-23 20:19:19 geuzaine Exp $
+// $Id: GUI.cpp,v 1.226 2003-02-11 03:13:30 geuzaine Exp $
 //
 // Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle
 //
@@ -1551,14 +1551,17 @@ void GUI::create_option_window(){
       Fl_Group* o = new Fl_Group(WB, WB+BH, width-2*WB, height-2*WB-BH, "2D");
       o->hide();
       
-      mesh_butt[0] = new Fl_Check_Button(2*WB, 2*WB+1*BH, BW, BH, "Old isotropic algorithm");
-      mesh_butt[1] = new Fl_Check_Button(2*WB, 2*WB+2*BH, BW, BH, "New isotropic algorithm");
+      mesh_butt[0] = new Fl_Check_Button(2*WB, 2*WB+1*BH, BW, BH, "Isotropic algorithm");
+      mesh_butt[1] = new Fl_Check_Button(2*WB, 2*WB+2*BH, BW, BH, "Isotropic algorithm (Triangle)");
       mesh_butt[2] = new Fl_Check_Button(2*WB, 2*WB+3*BH, BW, BH, "Anisotropic algorithm");
       for(i=0 ; i<3 ; i++){
 	mesh_butt[i]->type(FL_RADIO_BUTTON);
 	mesh_butt[i]->down_box(RADIO_BOX);
 	mesh_butt[i]->selection_color(RADIO_COLOR);
       }
+#if !defined(HAVE_TRIANGLE)
+      mesh_butt[1]->deactivate();
+#endif
       mesh_butt[4] = new Fl_Check_Button(2*WB, 2*WB+4*BH, BW, BH, "Interactive");
       mesh_butt[4]->type(FL_TOGGLE_BUTTON);
       mesh_butt[4]->down_box(TOGGLE_BOX);
diff --git a/Fltk/Makefile b/Fltk/Makefile
index 1c586ce124..9472d56391 100644
--- a/Fltk/Makefile
+++ b/Fltk/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.38 2002-11-03 16:49:55 geuzaine Exp $
+# $Id: Makefile,v 1.39 2003-02-11 03:13:31 geuzaine Exp $
 #
 # Makefile for "libGmshFltk.a"
 #
@@ -18,7 +18,7 @@ VERSION_FLAGS = -D_FLTK
 
 RMFLAGS = -f
 CFLAGS  = $(OPT_FLAGS) $(OS_FLAGS) $(VERSION_FLAGS) $(INCLUDE)\
-          $(GUI_INCLUDE) $(GL_INCLUDE)
+          $(GUI_INCLUDE) $(GL_INCLUDE) -DHAVE_TRIANGLE
 
 SRC = Main.cpp \
       Message.cpp \
diff --git a/Mesh/Makefile b/Mesh/Makefile
index 80ae13eb0a..4cca723778 100644
--- a/Mesh/Makefile
+++ b/Mesh/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.44 2002-05-18 21:35:10 geuzaine Exp $
+# $Id: Makefile,v 1.45 2003-02-11 03:13:31 geuzaine Exp $
 #
 # Makefile for "libGmshMesh.a"
 #
@@ -17,7 +17,7 @@ OS_FLAGS      = -D_LITTLE_ENDIAN
 VERSION_FLAGS = 
 
 RMFLAGS = -f
-CFLAGS  = $(OPT_FLAGS) $(OS_FLAGS) $(VERSION_FLAGS) $(INCLUDE)
+CFLAGS  = $(OPT_FLAGS) $(OS_FLAGS) $(VERSION_FLAGS) $(INCLUDE) -DHAVE_TRIANGLE
 
 SRC = 1D_Mesh.cpp \
       2D_Mesh.cpp \
@@ -35,7 +35,7 @@ SRC = 1D_Mesh.cpp \
         2D_Cylindrical.cpp \
         2D_Parametric.cpp \
         2D_Mesh_Aniso.cpp \
-        2D_Mesh_Shewchuk.cpp \
+        2D_Mesh_Triangle.cpp \
         3D_Mesh.cpp \
         3D_SMesh.cpp \
         3D_BGMesh.cpp \
@@ -169,7 +169,7 @@ depend:
   ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
   ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Mesh/Matrix.h \
   Mesh.h Interpolation.h Create.h ../Common/Context.h
-2D_Mesh_Shewchuk.o: 2D_Mesh_Shewchuk.cpp ../Common/Gmsh.h \
+2D_Mesh_Triangle.o: 2D_Mesh_Triangle.cpp ../Common/Gmsh.h \
   ../Common/Message.h ../DataStr/Malloc.h ../DataStr/List.h \
   ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h Mesh.h Vertex.h \
   Simplex.h Edge.h ../Geo/ExtrudeParams.h Metric.h Matrix.h \
diff --git a/doc/FAQ b/doc/FAQ
index c77fb53a39..5cf7062c91 100644
--- a/doc/FAQ
+++ b/doc/FAQ
@@ -1,4 +1,4 @@
-GMSH FREQUENTLY ASKED QUESTIONS ($Date: 2003-01-26 18:25:00 $)
+GMSH FREQUENTLY ASKED QUESTIONS ($Date: 2003-02-11 03:13:31 $)
 
 1. GENERAL
 ==========
@@ -90,15 +90,15 @@ problem:
 
 5.1) What should I do when the 2D unstructured algorithm fails?
 
-Try the new isotropic algorithm:
+Try the other 2D algorithms, e.g.:
 - on the command line: gmsh -algo tri
-- in the interface: Tools->Options->Mesh->2D->New isotropic algorithm
+- in the interface: Tools->Options->Mesh->2D->Isotropic algorithm (Triangle)
 - in input files: Mesh.Algorithm = 3
 The old 2D algorithm will disappear once all its features are
-integrated in the new one, so please don't send bug reports on the
+integrated in the new ones, so please don't send bug reports on the
 old algorithm anymore.
 
-5.2) The new 2D unstructured algorithm also fails! Then what?
+5.2) The new 2D unstructured algorithms also fail! Then what?
 
 Send us your geometry, and we will investigate. Please keep the
 following in mind though: 2D (surface) meshes are generated by
diff --git a/tutorial/t7.geo b/tutorial/t7.geo
index a4f0c9a911..359c868b9f 100644
--- a/tutorial/t7.geo
+++ b/tutorial/t7.geo
@@ -6,7 +6,7 @@
  *
  *********************************************************************/
 
-// The new anisotropic 2D mesh generator can be selected with:
+// The anisotropic 2D mesh generator can be selected with:
 
 Mesh.Algorithm = 2 ;
 
-- 
GitLab