From 3b568effc001cd008a13b0d9915ca9f0c0140a7f Mon Sep 17 00:00:00 2001
From: Emilie Marchandise <emilie.marchandise@uclouvain.be>
Date: Thu, 17 Jan 2013 14:27:57 +0000
Subject: [PATCH] hex gui stuff

---
 Common/Options.cpp                            | 13 ++++++++++++-
 Fltk/optionWindow.cpp                         |  3 ++-
 benchmarks/centerlines/bypass_centerlines.geo |  2 +-
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/Common/Options.cpp b/Common/Options.cpp
index 99abb39b5d..0d002a987f 100644
--- a/Common/Options.cpp
+++ b/Common/Options.cpp
@@ -5166,11 +5166,22 @@ double opt_mesh_recombine3d_all(OPT_ARGS_NUM)
 {
   if(action & GMSH_SET){
     CTX::instance()->mesh.recombine3DAll = (int)val;
+     //if recombine3D, then we should have 2D and 3D R-tree algo
+     if(CTX::instance()->mesh.recombine3DAll){
+       FlGui::instance()->options->mesh.choice[2]->value(4);
+       FlGui::instance()->options->mesh.choice[3]->value(5);
+     }  
   }
 #if defined(HAVE_FLTK)
-  if(FlGui::available() && (action & GMSH_GUI))
+  if(FlGui::available() && (action & GMSH_GUI)){
     FlGui::instance()->options->mesh.butt[22]->value
       (CTX::instance()->mesh.recombine3DAll);
+    //if recombine3D, then we should have 2D and 3D R-tree algo
+    if(CTX::instance()->mesh.recombine3DAll){
+      FlGui::instance()->options->mesh.choice[2]->value(4);
+      FlGui::instance()->options->mesh.choice[3]->value(5);
+    } 
+  }
 #endif
   return CTX::instance()->mesh.recombine3DAll;
 }
diff --git a/Fltk/optionWindow.cpp b/Fltk/optionWindow.cpp
index 23db787051..d694b7051c 100644
--- a/Fltk/optionWindow.cpp
+++ b/Fltk/optionWindow.cpp
@@ -493,6 +493,7 @@ static void mesh_options_ok_cb(Fl_Widget *w, void *data)
   opt_mesh_angle_smooth_normals(0, GMSH_SET, o->mesh.value[18]->value());
 
   opt_mesh_point_type(0, GMSH_SET, o->mesh.choice[0]->value());
+  opt_mesh_recombine3d_all(0, GMSH_SET, o->mesh.butt[22]->value());
   opt_mesh_algo2d(0, GMSH_SET,
                   (o->mesh.choice[2]->value() == 1) ? ALGO_2D_MESHADAPT :
                   (o->mesh.choice[2]->value() == 2) ? ALGO_2D_DELAUNAY :
@@ -509,7 +510,7 @@ static void mesh_options_ok_cb(Fl_Widget *w, void *data)
                   ALGO_3D_FRONTAL);
   opt_mesh_algo_recombine(0, GMSH_SET, o->mesh.choice[1]->value());
   opt_mesh_recombine_all(0, GMSH_SET, o->mesh.butt[21]->value());
-  opt_mesh_recombine3d_all(0, GMSH_SET, o->mesh.butt[22]->value());
+
   opt_mesh_algo_subdivide(0, GMSH_SET, o->mesh.choice[5]->value());
   opt_mesh_remesh_algo(0, GMSH_SET, o->mesh.choice[8]->value());
   opt_mesh_remesh_param(0, GMSH_SET, o->mesh.choice[9]->value());
diff --git a/benchmarks/centerlines/bypass_centerlines.geo b/benchmarks/centerlines/bypass_centerlines.geo
index b4f20ea35c..fd30c04cb8 100644
--- a/benchmarks/centerlines/bypass_centerlines.geo
+++ b/benchmarks/centerlines/bypass_centerlines.geo
@@ -1,4 +1,4 @@
-Mesh.Algorithm = 1; //(1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=bamg, 8=delquad)
+Mesh.Algorithm = 7; //(1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=bamg, 8=delquad)
 Mesh.Algorithm3D = 7; //(1=tetgen, 4=netgen, 7=mmg3D
 
 Mesh.LcIntegrationPrecision = 1.e-2;
-- 
GitLab