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

Added controls for -clscale, -meshscale, -rand in GUI

parent 5d7acb85
Branches
Tags
No related merge requests found
// $Id: Callbacks.cpp,v 1.26 2001-02-03 18:33:45 geuzaine Exp $ // $Id: Callbacks.cpp,v 1.27 2001-02-07 13:25:39 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -480,6 +480,15 @@ void opt_mesh_algo_cb(CALLBACK_ARGS){ ...@@ -480,6 +480,15 @@ void opt_mesh_algo_cb(CALLBACK_ARGS){
void opt_mesh_smoothing_cb(CALLBACK_ARGS){ void opt_mesh_smoothing_cb(CALLBACK_ARGS){
CTX.mesh.nb_smoothing = (int)((Fl_Value_Input*)w)->value(); CTX.mesh.nb_smoothing = (int)((Fl_Value_Input*)w)->value();
} }
void opt_mesh_scaling_factor_cb(CALLBACK_ARGS){
CTX.mesh.scaling_factor = ((Fl_Value_Input*)w)->value();
}
void opt_mesh_lc_factor_cb(CALLBACK_ARGS){
CTX.mesh.lc_factor = ((Fl_Value_Input*)w)->value();
}
void opt_mesh_rand_factor_cb(CALLBACK_ARGS){
CTX.mesh.rand_factor = ((Fl_Value_Input*)w)->value();
}
void opt_mesh_interactive_cb(CALLBACK_ARGS){ void opt_mesh_interactive_cb(CALLBACK_ARGS){
CTX.mesh.interactive = !CTX.mesh.interactive; CTX.mesh.interactive = !CTX.mesh.interactive;
} }
......
...@@ -75,6 +75,9 @@ void opt_mesh_normals_cb(CALLBACK_ARGS) ; ...@@ -75,6 +75,9 @@ void opt_mesh_normals_cb(CALLBACK_ARGS) ;
void opt_mesh_degree_cb(CALLBACK_ARGS) ; void opt_mesh_degree_cb(CALLBACK_ARGS) ;
void opt_mesh_algo_cb(CALLBACK_ARGS) ; void opt_mesh_algo_cb(CALLBACK_ARGS) ;
void opt_mesh_smoothing_cb(CALLBACK_ARGS) ; void opt_mesh_smoothing_cb(CALLBACK_ARGS) ;
void opt_mesh_scaling_factor_cb(CALLBACK_ARGS) ;
void opt_mesh_lc_factor_cb(CALLBACK_ARGS) ;
void opt_mesh_rand_factor_cb(CALLBACK_ARGS) ;
void opt_mesh_interactive_cb(CALLBACK_ARGS) ; void opt_mesh_interactive_cb(CALLBACK_ARGS) ;
void opt_mesh_explode_cb(CALLBACK_ARGS) ; void opt_mesh_explode_cb(CALLBACK_ARGS) ;
void opt_mesh_aspect_cb(CALLBACK_ARGS) ; void opt_mesh_aspect_cb(CALLBACK_ARGS) ;
......
// $Id: GUI.cpp,v 1.40 2001-02-05 14:20:14 geuzaine Exp $ // $Id: GUI.cpp,v 1.41 2001-02-07 13:25:39 geuzaine Exp $
// To make the interface as visually consistent as possible, please: // To make the interface as visually consistent as possible, please:
// - use the BH, BW, WB, IW values for button heights/widths, window borders, etc. // - use the BH, BW, WB, IW values for button heights/widths, window borders, etc.
...@@ -1132,7 +1132,7 @@ void GUI::create_mesh_options_window(){ ...@@ -1132,7 +1132,7 @@ void GUI::create_mesh_options_window(){
if(!init_mesh_options_window){ if(!init_mesh_options_window){
init_mesh_options_window = 1 ; init_mesh_options_window = 1 ;
int width = 26*CTX.fontsize; int width = 29*CTX.fontsize;
int height = 5*WB+9*BH ; int height = 5*WB+9*BH ;
mesh_window = new Fl_Window(width,height); mesh_window = new Fl_Window(width,height);
...@@ -1159,16 +1159,36 @@ void GUI::create_mesh_options_window(){ ...@@ -1159,16 +1159,36 @@ void GUI::create_mesh_options_window(){
mesh_butt[i]->labelsize(CTX.fontsize); mesh_butt[i]->labelsize(CTX.fontsize);
mesh_butt[i]->selection_color(FL_YELLOW); mesh_butt[i]->selection_color(FL_YELLOW);
} }
mesh_value[0] = new Fl_Value_Input(2*WB, 2*WB+4*BH, IW, BH, mesh_value[0] = new Fl_Value_Input(2*WB, 2*WB+4*BH, IW, BH, "Number of smoothing steps");
"Number of smoothing steps");
mesh_value[0]->minimum(0); mesh_value[0]->minimum(0);
mesh_value[0]->maximum(100); mesh_value[0]->maximum(100);
mesh_value[0]->step(1); mesh_value[0]->step(1);
mesh_value[0]->callback(opt_mesh_smoothing_cb); mesh_value[0]->callback(opt_mesh_smoothing_cb);
mesh_value[0]->value(CTX.mesh.nb_smoothing); mesh_value[0]->value(CTX.mesh.nb_smoothing);
mesh_value[0]->labelsize(CTX.fontsize); mesh_value[1] = new Fl_Value_Input(2*WB, 2*WB+5*BH, IW, BH, "Mesh scaling factor");
mesh_value[0]->type(FL_HORIZONTAL); mesh_value[1]->minimum(0);
mesh_value[0]->align(FL_ALIGN_RIGHT); mesh_value[1]->maximum(100);
mesh_value[1]->step(0.001);
mesh_value[1]->callback(opt_mesh_scaling_factor_cb);
mesh_value[1]->value(CTX.mesh.scaling_factor);
mesh_value[2] = new Fl_Value_Input(2*WB, 2*WB+6*BH, IW, BH, "Characteristic length scaling factor");
mesh_value[2]->minimum(0);
mesh_value[2]->maximum(100);
mesh_value[2]->step(0.001);
mesh_value[2]->callback(opt_mesh_lc_factor_cb);
mesh_value[2]->value(CTX.mesh.lc_factor);
mesh_value[3] = new Fl_Value_Input(2*WB, 2*WB+7*BH, IW, BH, "Random perturbation factor");
mesh_value[3]->minimum(1.e-6);
mesh_value[3]->maximum(1.e-1);
mesh_value[3]->step(1.e-6);
mesh_value[3]->callback(opt_mesh_rand_factor_cb);
mesh_value[3]->value(CTX.mesh.rand_factor);
for(i = 0 ; i<4 ; i++){
mesh_value[i]->labelsize(CTX.fontsize);
mesh_value[i]->type(FL_HORIZONTAL);
mesh_value[i]->align(FL_ALIGN_RIGHT);
}
o->end(); o->end();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment