diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 388be5cff33c7c76c8ce5e5f7e7a162c220e1493..c474bd6572b3b44a45cb28359e844fc68c06f467 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.170 2003-03-26 21:43:10 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.171 2003-04-01 17:05:31 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -802,6 +802,30 @@ void general_options_rotation_center_cb(CALLBACK_ARGS) WID->check_rotation_center_button(); } +void general_options_rotation_center_select_cb(CALLBACK_ARGS) +{ + Vertex *v; + Curve *c; + Surface *s; + int ib; + + if(!opt_geometry_points(0, GMSH_GET, 0)) { + opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1); + Draw(); + } + + Msg(STATUS3N, "Select Point ('q'=quit)"); + ib = SelectEntity(ENT_POINT, &v, &c, &s); + if(ib == 1) { + opt_general_rotation_center0(0, GMSH_SET|GMSH_GUI, v->Pos.X); + opt_general_rotation_center1(0, GMSH_SET|GMSH_GUI, v->Pos.Y); + opt_general_rotation_center2(0, GMSH_SET|GMSH_GUI, v->Pos.Z); + } + ZeroHighlight(THEM); + Draw(); + Msg(STATUS3N, "Ready"); +} + void general_options_ok_cb(CALLBACK_ARGS) { opt_general_axes(0, GMSH_SET, WID->gen_butt[0]->value()); diff --git a/Fltk/Callbacks.h b/Fltk/Callbacks.h index 65063bf559350caafd7fc38f8a0936c4b9566556..4177df119ab7bf754d90471e88c265696a968fa0 100644 --- a/Fltk/Callbacks.h +++ b/Fltk/Callbacks.h @@ -79,6 +79,7 @@ void options_ok_cb(CALLBACK_ARGS) ; void general_options_cb(CALLBACK_ARGS) ; void general_options_color_scheme_cb(CALLBACK_ARGS) ; void general_options_rotation_center_cb(CALLBACK_ARGS) ; +void general_options_rotation_center_select_cb(CALLBACK_ARGS) ; void general_options_ok_cb(CALLBACK_ARGS) ; void geometry_options_cb(CALLBACK_ARGS) ; diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index e6a7f0cf3a17b536b1b52b29653dae39f08fe316..f8347dc299a9fcee29e71d5eaffaf948972a1218 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.234 2003-03-26 21:43:10 geuzaine Exp $ +// $Id: GUI.cpp,v 1.235 2003-04-01 17:05:31 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -1288,11 +1288,13 @@ void GUI::reset_option_browser() void GUI::check_rotation_center_button() { if(gen_butt[15]->value()) { + gen_push_butt[0]->deactivate(); gen_value[8]->deactivate(); gen_value[9]->deactivate(); gen_value[10]->deactivate(); } else { + gen_push_butt[0]->activate(); gen_value[8]->activate(); gen_value[9]->activate(); gen_value[10]->activate(); @@ -1373,11 +1375,15 @@ void GUI::create_option_window() gen_butt[15]->selection_color(TOGGLE_COLOR); gen_butt[15]->callback(general_options_rotation_center_cb); + gen_push_butt[0] = new Fl_Button(2 * IW - 2 * WB, 2 * WB + 10 * BH, BB, BH, "Select"); + gen_push_butt[0]->callback(general_options_rotation_center_select_cb); + gen_value[8] = new Fl_Value_Input(2 * WB, 2 * WB + 10 * BH, IW / 3, BH); gen_value[9] = new Fl_Value_Input(2 * WB + IW / 3, 2 * WB + 10 * BH, IW / 3, BH); gen_value[10] = new Fl_Value_Input(2 * WB + 2 * IW / 3, 2 * WB + 10 * BH, IW / 3, BH, "Rotation center"); gen_value[10]->align(FL_ALIGN_RIGHT); + o->end(); } { diff --git a/Fltk/GUI.h b/Fltk/GUI.h index 0ffe0bfcd0938170e91bae9eed37de1334bfb07f..d486daa1f6caa0afcbbd5ab215a80dbc49d00fc6 100644 --- a/Fltk/GUI.h +++ b/Fltk/GUI.h @@ -160,6 +160,7 @@ public: // general options Fl_Window *gen_window ; Fl_Check_Button *gen_butt[20] ; + Fl_Button *gen_push_butt[20] ; Fl_Value_Input *gen_value[20] ; Fl_Button *gen_col[50] ; Fl_Input *gen_input[20] ;