From a08dd1e0b38e7438575a435687b72e5dd3c2e28a Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Wed, 3 Mar 2010 10:08:42 +0000
Subject: [PATCH] fine tuning

---
 Fltk/classificationEditor.cpp |  8 +++++---
 Fltk/classificationEditor.h   | 17 ++++++++---------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/Fltk/classificationEditor.cpp b/Fltk/classificationEditor.cpp
index 71b01db037..edaeb67822 100644
--- a/Fltk/classificationEditor.cpp
+++ b/Fltk/classificationEditor.cpp
@@ -195,10 +195,10 @@ static void update_edges_cb(Fl_Widget *w, void *data)
     delete e->selected->lines[i];
   e->selected->lines.clear();
 
+  double threshold = e->inputs[CLASS_VALUE_ANGLE]->value() / 180. * M_PI;
   for(unsigned int i = 0; i < e->edges_detected.size(); i++){
-    edge_angle ea =  e->edges_detected[i];
-    if(ea.angle <= e->inputs[CLASS_VALUE_ANGLE]->value() / 180 * M_PI)
-      break;
+    edge_angle ea = e->edges_detected[i];
+    if(ea.angle <= threshold) break;
     e->selected->lines.push_back(new MLine(ea.v1, ea.v2));
   } 
 
@@ -315,6 +315,8 @@ static void show_only_edges_cb(Fl_Widget *w, void *data)
   static int old_se = (int)opt_mesh_surfaces_edges(0, GMSH_GET, 0.);
   if(e->toggles[CLASS_TOGGLE_SHOW_ONLY_EDGES]->value()){
     opt_mesh_lines(0, GMSH_SET | GMSH_GUI, 1.);
+    old_sf = (int)opt_mesh_surfaces_faces(0, GMSH_GET, 0.);
+    old_se = (int)opt_mesh_surfaces_edges(0, GMSH_GET, 0.);
     opt_mesh_surfaces_faces(0, GMSH_SET | GMSH_GUI, 0.);
     opt_mesh_surfaces_edges(0, GMSH_SET | GMSH_GUI, 0.);
   }
diff --git a/Fltk/classificationEditor.h b/Fltk/classificationEditor.h
index 4bd2b2711b..b7153dded1 100644
--- a/Fltk/classificationEditor.h
+++ b/Fltk/classificationEditor.h
@@ -7,12 +7,12 @@
 #define _CLASSIFICATION_EDITOR_H_
 
 #include <vector>
+#include <set>
 #include <FL/Fl_Window.H>
 #include <FL/Fl_Check_Button.H>
 #include <FL/Fl_Value_Input.H>
 #include "GModel.h"
 #include "MElement.h"
-#include "ColorTable.h"
 
 #define CLASS_BUTTON_SELECT_ELEMENTS       0
 #define CLASS_BUTTON_SELECT_ALL_ELEMENTS   1
@@ -22,18 +22,18 @@
 #define CLASS_BUTTON_SELECT_ALL_SURFACES   5
 #define CLASS_BUTTON_CLASSIFY              6
 
-#define CLASS_TOGGLE_HIDE             0
-#define CLASS_TOGGLE_BOUNDARY         1
-#define CLASS_TOGGLE_SHOW_ONLY_EDGES  2
+#define CLASS_TOGGLE_HIDE                  0
+#define CLASS_TOGGLE_BOUNDARY              1
+#define CLASS_TOGGLE_SHOW_ONLY_EDGES       2
 
-#define CLASS_VALUE_ANGLE             0
+#define CLASS_VALUE_ANGLE                  0
 
 class edge_angle {
  public :
   MVertex *v1, *v2;
   double angle;
-  edge_angle ( MVertex *_v1, MVertex *_v2, MElement *t1, MElement *t2);
-  bool operator < (const edge_angle & other) const
+  edge_angle(MVertex *_v1, MVertex *_v2, MElement *t1, MElement *t2);
+  bool operator < (const edge_angle &other) const
   {
     return other.angle < angle;
   }  
@@ -41,14 +41,13 @@ class edge_angle {
 
 class classificationEditor {
  public:
-  double op[10];
   std::vector<MTriangle*> elements;
   std::set<GFace*> faces;
   Fl_Window *window;
   Fl_Button *buttons[10];
   Fl_Check_Button *toggles[10];
   Fl_Value_Input *inputs[10];
-  GEdge *selected, *saved;
+  GEdge *selected;
   std::vector<edge_angle> edges_detected, edges_lonly;
   classificationEditor();
   void show(){ window->show(); }
-- 
GitLab