Skip to content
Snippets Groups Projects
Commit a08dd1e0 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fine tuning

parent 5fc69863
No related branches found
No related tags found
No related merge requests found
...@@ -195,10 +195,10 @@ static void update_edges_cb(Fl_Widget *w, void *data) ...@@ -195,10 +195,10 @@ static void update_edges_cb(Fl_Widget *w, void *data)
delete e->selected->lines[i]; delete e->selected->lines[i];
e->selected->lines.clear(); 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++){ for(unsigned int i = 0; i < e->edges_detected.size(); i++){
edge_angle ea = e->edges_detected[i]; edge_angle ea = e->edges_detected[i];
if(ea.angle <= e->inputs[CLASS_VALUE_ANGLE]->value() / 180 * M_PI) if(ea.angle <= threshold) break;
break;
e->selected->lines.push_back(new MLine(ea.v1, ea.v2)); 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) ...@@ -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.); static int old_se = (int)opt_mesh_surfaces_edges(0, GMSH_GET, 0.);
if(e->toggles[CLASS_TOGGLE_SHOW_ONLY_EDGES]->value()){ if(e->toggles[CLASS_TOGGLE_SHOW_ONLY_EDGES]->value()){
opt_mesh_lines(0, GMSH_SET | GMSH_GUI, 1.); 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_faces(0, GMSH_SET | GMSH_GUI, 0.);
opt_mesh_surfaces_edges(0, GMSH_SET | GMSH_GUI, 0.); opt_mesh_surfaces_edges(0, GMSH_SET | GMSH_GUI, 0.);
} }
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
#define _CLASSIFICATION_EDITOR_H_ #define _CLASSIFICATION_EDITOR_H_
#include <vector> #include <vector>
#include <set>
#include <FL/Fl_Window.H> #include <FL/Fl_Window.H>
#include <FL/Fl_Check_Button.H> #include <FL/Fl_Check_Button.H>
#include <FL/Fl_Value_Input.H> #include <FL/Fl_Value_Input.H>
#include "GModel.h" #include "GModel.h"
#include "MElement.h" #include "MElement.h"
#include "ColorTable.h"
#define CLASS_BUTTON_SELECT_ELEMENTS 0 #define CLASS_BUTTON_SELECT_ELEMENTS 0
#define CLASS_BUTTON_SELECT_ALL_ELEMENTS 1 #define CLASS_BUTTON_SELECT_ALL_ELEMENTS 1
...@@ -22,18 +22,18 @@ ...@@ -22,18 +22,18 @@
#define CLASS_BUTTON_SELECT_ALL_SURFACES 5 #define CLASS_BUTTON_SELECT_ALL_SURFACES 5
#define CLASS_BUTTON_CLASSIFY 6 #define CLASS_BUTTON_CLASSIFY 6
#define CLASS_TOGGLE_HIDE 0 #define CLASS_TOGGLE_HIDE 0
#define CLASS_TOGGLE_BOUNDARY 1 #define CLASS_TOGGLE_BOUNDARY 1
#define CLASS_TOGGLE_SHOW_ONLY_EDGES 2 #define CLASS_TOGGLE_SHOW_ONLY_EDGES 2
#define CLASS_VALUE_ANGLE 0 #define CLASS_VALUE_ANGLE 0
class edge_angle { class edge_angle {
public : public :
MVertex *v1, *v2; MVertex *v1, *v2;
double angle; double angle;
edge_angle ( MVertex *_v1, MVertex *_v2, MElement *t1, MElement *t2); edge_angle(MVertex *_v1, MVertex *_v2, MElement *t1, MElement *t2);
bool operator < (const edge_angle & other) const bool operator < (const edge_angle &other) const
{ {
return other.angle < angle; return other.angle < angle;
} }
...@@ -41,14 +41,13 @@ class edge_angle { ...@@ -41,14 +41,13 @@ class edge_angle {
class classificationEditor { class classificationEditor {
public: public:
double op[10];
std::vector<MTriangle*> elements; std::vector<MTriangle*> elements;
std::set<GFace*> faces; std::set<GFace*> faces;
Fl_Window *window; Fl_Window *window;
Fl_Button *buttons[10]; Fl_Button *buttons[10];
Fl_Check_Button *toggles[10]; Fl_Check_Button *toggles[10];
Fl_Value_Input *inputs[10]; Fl_Value_Input *inputs[10];
GEdge *selected, *saved; GEdge *selected;
std::vector<edge_angle> edges_detected, edges_lonly; std::vector<edge_angle> edges_detected, edges_lonly;
classificationEditor(); classificationEditor();
void show(){ window->show(); } void show(){ window->show(); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment