diff --git a/Common/Context.h b/Common/Context.h index a27431828cd863642073e41992637810ac38e0d0..c221ccba97db9ecfedc34af8141a9ef67a7aa89e 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -105,7 +105,8 @@ public : int db; // double buffer? int ortho; // orthogonal projection? - int fast; // inhibit mesh and postpro drawing when changing r,s,t + int draw_bbox; // always draw the bounding boxes? + int fast_redraw; // only draw the bbox when rotating/panning the model? int axes, small_axes; // draw axes? int small_axes_pos[2]; // small axes position int threads, threads_lock; // threads?, lock (should be a mutex...) @@ -149,7 +150,6 @@ public : int extrude_spline_points, old_newreg; double normals, tangents; double scaling_factor; - int color_scheme ; int auto_coherence; int stl_create_elementary, stl_create_physical; } geom; @@ -173,7 +173,7 @@ public : int point_insertion, speed_max, min_circ_points, constrained_bgmesh; int histogram, initial_only; double normals, tangents, explode; - int color_scheme, color_carousel ; + int color_carousel ; int use_cut_plane, cut_plane_as_surface; double cut_planea,cut_planeb,cut_planec,cut_planed; double evalCutPlane (double x, double y, double z){ diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 7439d96ff9c64af124f589ce4997e304fc4b4cfc..d4a2fa9b85b6e34b62099bed031ba0525459afb9 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -436,7 +436,6 @@ StringXNumber GeneralOptions_Number[] = { "Horizontal position (in pixels) of the upper left corner of the clipping planes window" }, { F|S, "ClipPositionY" , opt_general_clip_position1 , 150. , "Vertical position (in pixels) of the upper left corner of the clipping planes window" }, - { F|O, "ColorScheme", opt_general_color_scheme , 0. , "Default color scheme (0, 1 or 2)" }, { F|S, "ConfirmOverwrite" , opt_general_confirm_overwrite, 1. , @@ -448,11 +447,13 @@ StringXNumber GeneralOptions_Number[] = { { F|O, "DoubleBuffer" , opt_general_double_buffer , 1. , "Use a double buffered graphic window (on Unix, should be set to 0 when working on a remote host without GLX)" }, + { F|O, "DrawBoundingBoxes" , opt_general_draw_bounding_box, 0. , + "Draw bounding boxes" }, { F|O, "FakeTransparency" , opt_general_fake_transparency , 0. , "Use fake transparency (cheaper than the real thing, but incorrect)" }, - { F|O, "FastRedraw" , opt_general_fast_redraw , 1. , - "Fast redraw (no mesh or view display) when interacting with the model" }, + { F|O, "FastRedraw" , opt_general_fast_redraw, 1. , + "Draw simplified model while rotating, panning and zooming" }, { F|S, "FontSize" , opt_general_fontsize , 12. , "Size of the font in the user interface" }, @@ -640,8 +641,6 @@ StringXNumber GeometryOptions_Number[] = { { F|O, "CirclePoints" , opt_geometry_circle_points, 20. , "Number of points used to draw a circle/ellipse" }, - { F|O, "ColorScheme" , opt_geometry_color_scheme , 0. , - "Default geometry color scheme (0, 1 or 2)" }, { F|O, "CircleWarning" , opt_geometry_circle_warning, 1. , "Warn if circle arc is greater than Pi" }, @@ -716,8 +715,6 @@ StringXNumber MeshOptions_Number[] = { "Factor applied to all characteristic lengths (and background meshes)" }, { F|O, "ColorCarousel" , opt_mesh_color_carousel , 1. , "Mesh coloring (0=by element type, 1=by elementary entity, 2=by physical entity, 3=by partition)" }, - { F|O, "ColorScheme" , opt_mesh_color_scheme , 0. , - "Default mesh color scheme (0, 1 or 2)" }, { F|O, "ConstrainedBackgroundMesh" , opt_mesh_constrained_bgmesh, 0. , "Should the background mesh be constrained by the characteristic lengths associated with the geometry?" }, { F, "CpuTime" , opt_mesh_cpu_time , 0. , diff --git a/Common/Options.cpp b/Common/Options.cpp index 051aed8efb19439400acb94d719cafac5675f937..ae7a7100e370e7bac1671e6a36f869e928d1bd4d 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1,4 +1,4 @@ -// $Id: Options.cpp,v 1.172 2004-07-17 22:46:28 geuzaine Exp $ +// $Id: Options.cpp,v 1.173 2004-07-22 05:47:45 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -2256,12 +2256,23 @@ double opt_general_orthographic(OPT_ARGS_NUM) double opt_general_fast_redraw(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX.fast = (int)val; + CTX.fast_redraw = (int)val; #if defined(HAVE_FLTK) if(WID && (action & GMSH_GUI)) - WID->gen_butt[2]->value(CTX.fast); + WID->gen_butt[2]->value(CTX.fast_redraw); #endif - return CTX.fast; + return CTX.fast_redraw; +} + +double opt_general_draw_bounding_box(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX.draw_bbox = (int)val; +#if defined(HAVE_FLTK) + if(WID && (action & GMSH_GUI)) + WID->gen_butt[6]->value(CTX.draw_bbox); +#endif + return CTX.draw_bbox; } double opt_general_axes(OPT_ARGS_NUM) @@ -2416,11 +2427,15 @@ double opt_general_color_scheme(OPT_ARGS_NUM) if(CTX.color_scheme > 2) CTX.color_scheme = 0; Set_DefaultColorOptions(0, GeneralOptions_Color, CTX.color_scheme); + Set_DefaultColorOptions(0, GeometryOptions_Color, CTX.color_scheme); + Set_DefaultColorOptions(0, MeshOptions_Color, CTX.color_scheme); Set_ColorOptions_GUI(0, GeneralOptions_Color); + Set_ColorOptions_GUI(0, GeometryOptions_Color); + Set_ColorOptions_GUI(0, MeshOptions_Color); } #if defined(HAVE_FLTK) if(WID && (action & GMSH_GUI)) - WID->gen_value[0]->value(CTX.color_scheme); + WID->gen_choice[3]->value(CTX.color_scheme); #endif return CTX.color_scheme; } @@ -3211,22 +3226,6 @@ double opt_geometry_scaling_factor(OPT_ARGS_NUM) return CTX.geom.scaling_factor; } -double opt_geometry_color_scheme(OPT_ARGS_NUM) -{ - if(action & GMSH_SET) { - CTX.geom.color_scheme = (int)val; - if(CTX.geom.color_scheme > 2) - CTX.geom.color_scheme = 0; - Set_DefaultColorOptions(0, GeometryOptions_Color, CTX.geom.color_scheme); - Set_ColorOptions_GUI(0, GeometryOptions_Color); - } -#if defined(HAVE_FLTK) - if(WID && (action & GMSH_GUI)) - WID->geo_value[2]->value(CTX.geom.color_scheme); -#endif - return CTX.geom.color_scheme; -} - double opt_geometry_stl_create_elementary(OPT_ARGS_NUM) { if(action & GMSH_SET) @@ -3847,23 +3846,6 @@ double opt_mesh_save_all(OPT_ARGS_NUM) return CTX.mesh.save_all; } -double opt_mesh_color_scheme(OPT_ARGS_NUM) -{ - if(action & GMSH_SET) { - if(CTX.mesh.color_scheme != (int)val) CTX.mesh.changed = 1; - CTX.mesh.color_scheme = (int)val; - if(CTX.mesh.color_scheme > 2) - CTX.mesh.color_scheme = 0; - Set_DefaultColorOptions(0, MeshOptions_Color, CTX.mesh.color_scheme); - Set_ColorOptions_GUI(0, MeshOptions_Color); - } -#if defined(HAVE_FLTK) - if(WID && (action & GMSH_GUI)) - WID->mesh_value[12]->value(CTX.mesh.color_scheme); -#endif - return CTX.mesh.color_scheme; -} - double opt_mesh_color_carousel(OPT_ARGS_NUM) { if(action & GMSH_SET) { diff --git a/Common/Options.h b/Common/Options.h index f9f9cabf16db72a890915733fa7d933a193d907e..473bff696009f23c44d2fefaefa11a202bdf4ae9 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -241,6 +241,7 @@ double opt_general_terminal(OPT_ARGS_NUM); double opt_general_tooltips(OPT_ARGS_NUM); double opt_general_confirm_overwrite(OPT_ARGS_NUM); double opt_general_orthographic(OPT_ARGS_NUM); +double opt_general_draw_bounding_box(OPT_ARGS_NUM); double opt_general_fast_redraw(OPT_ARGS_NUM); double opt_general_axes(OPT_ARGS_NUM); double opt_general_small_axes(OPT_ARGS_NUM); @@ -335,7 +336,6 @@ double opt_geometry_circle_points(OPT_ARGS_NUM); double opt_geometry_circle_warning(OPT_ARGS_NUM); double opt_geometry_extrude_spline_points(OPT_ARGS_NUM); double opt_geometry_scaling_factor(OPT_ARGS_NUM); -double opt_geometry_color_scheme(OPT_ARGS_NUM); double opt_geometry_stl_create_elementary(OPT_ARGS_NUM); double opt_geometry_stl_create_physical(OPT_ARGS_NUM); double opt_mesh_optimize(OPT_ARGS_NUM); @@ -389,7 +389,6 @@ double opt_mesh_cut_planec(OPT_ARGS_NUM); double opt_mesh_cut_planed(OPT_ARGS_NUM); double opt_mesh_allow_degenerated_extrude(OPT_ARGS_NUM); double opt_mesh_save_all(OPT_ARGS_NUM); -double opt_mesh_color_scheme(OPT_ARGS_NUM); double opt_mesh_color_carousel(OPT_ARGS_NUM); double opt_mesh_nb_nodes(OPT_ARGS_NUM); double opt_mesh_nb_triangles(OPT_ARGS_NUM); @@ -424,7 +423,6 @@ double opt_post_smooth(OPT_ARGS_NUM); double opt_post_anim_delay(OPT_ARGS_NUM); double opt_post_anim_cycle(OPT_ARGS_NUM); double opt_post_nb_views(OPT_ARGS_NUM); -double opt_post_color_scheme(OPT_ARGS_NUM); double opt_view_nb_timestep(OPT_ARGS_NUM); double opt_view_timestep(OPT_ARGS_NUM); double opt_view_min(OPT_ARGS_NUM); diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 5dbc93fc0bcc3ff570f6fbd4d47545f587f4002f..96425c6a2a7c6ecbc4130b542c0ab7b4d7cd1aae 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.256 2004-07-18 16:42:22 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.257 2004-07-22 05:47:45 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -811,7 +811,7 @@ void general_options_cb(CALLBACK_ARGS) void general_options_color_scheme_cb(CALLBACK_ARGS) { - opt_general_color_scheme(0, GMSH_SET, WID->gen_value[0]->value()); + opt_general_color_scheme(0, GMSH_SET, WID->gen_choice[3]->value()); Draw(); } @@ -870,6 +870,7 @@ void general_options_ok_cb(CALLBACK_ARGS) opt_general_tooltips(0, GMSH_SET, WID->gen_butt[13]->value()); opt_general_confirm_overwrite(0, GMSH_SET, WID->gen_butt[14]->value()); opt_general_rotation_center_cg(0, GMSH_SET, WID->gen_butt[15]->value()); + opt_general_draw_bounding_box(0, GMSH_SET, WID->gen_butt[6]->value()); opt_general_shine(0, GMSH_SET, WID->gen_value[1]->value()); opt_general_light00(0, GMSH_SET, WID->gen_value[2]->value()); @@ -928,12 +929,6 @@ void geometry_options_cb(CALLBACK_ARGS) WID->create_geometry_options_window(); } -void geometry_options_color_scheme_cb(CALLBACK_ARGS) -{ - opt_geometry_color_scheme(0, GMSH_SET, WID->geo_value[2]->value()); - Draw(); -} - void geometry_options_ok_cb(CALLBACK_ARGS) { opt_geometry_points(0, GMSH_SET, WID->geo_butt[0]->value()); @@ -965,12 +960,6 @@ void mesh_options_cb(CALLBACK_ARGS) WID->create_mesh_options_window(); } -void mesh_options_color_scheme_cb(CALLBACK_ARGS) -{ - opt_mesh_color_scheme(0, GMSH_SET, WID->mesh_value[12]->value()); - Draw(); -} - void mesh_options_ok_cb(CALLBACK_ARGS) { opt_mesh_optimize(0, GMSH_SET, WID->mesh_butt[2]->value()); @@ -1390,7 +1379,7 @@ void help_short_cb(CALLBACK_ARGS) Msg(DIRECT, " Alt+a hide/show small axes"); Msg(DIRECT, " Shift+a raise (show) all open windows"); Msg(DIRECT, " Alt+Shift+a hide/show big moving axes"); - Msg(DIRECT, " Alt+b hide/show all post-processing scales"); + Msg(DIRECT, " Alt+b hide/show all bounding boxes"); Msg(DIRECT, " Alt+c loop through predefined color schemes"); Msg(DIRECT, " Alt+d change mesh display mode (solid/wireframe)"); Msg(DIRECT, " Shift+d decrease animation delay"); @@ -1399,6 +1388,7 @@ void help_short_cb(CALLBACK_ARGS) Msg(DIRECT, " g go to geometry module"); Msg(DIRECT, " Shift+g show geometry options"); Msg(DIRECT, " Alt+h hide/show all post-processing views"); + Msg(DIRECT, " Alt+i hide/show all post-processing scales"); Msg(DIRECT, " Shift+i show statistics window"); Msg(DIRECT, " Alt+l hide/show geometry lines"); Msg(DIRECT, " Alt+Shift+l hide/show surface mesh edges"); diff --git a/Fltk/Callbacks.h b/Fltk/Callbacks.h index 535dc38251c16ae8f46a891cf64835a4223d0b8d..d505eb064a08e9472a028cf4e6f445388dc56953 100644 --- a/Fltk/Callbacks.h +++ b/Fltk/Callbacks.h @@ -86,11 +86,9 @@ void general_options_rotation_center_select_cb(CALLBACK_ARGS) ; void general_options_ok_cb(CALLBACK_ARGS) ; void geometry_options_cb(CALLBACK_ARGS) ; -void geometry_options_color_scheme_cb(CALLBACK_ARGS) ; void geometry_options_ok_cb(CALLBACK_ARGS) ; void mesh_options_cb(CALLBACK_ARGS) ; -void mesh_options_color_scheme_cb(CALLBACK_ARGS) ; void mesh_options_ok_cb(CALLBACK_ARGS) ; void solver_options_cb(CALLBACK_ARGS) ; diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 4868d742717961560b5ab502286511752e6caf6f..71a01f13c3fd5101e401a265ac0cef1fc8dffcee 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.325 2004-07-18 16:42:22 geuzaine Exp $ +// $Id: GUI.cpp,v 1.326 2004-07-22 05:47:46 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -490,11 +490,17 @@ int GUI::global_shortcuts(int event) } else if(Fl::test_shortcut(FL_ALT + 'f')) { opt_general_fast_redraw(0, GMSH_SET | GMSH_GUI, - !opt_general_fast_redraw(0, GMSH_GET, 0)); + !opt_general_fast_redraw(0, GMSH_GET, 0)); redraw_opengl(); return 1; } else if(Fl::test_shortcut(FL_ALT + 'b')) { + opt_general_draw_bounding_box(0, GMSH_SET | GMSH_GUI, + !opt_general_draw_bounding_box(0, GMSH_GET, 0)); + redraw_opengl(); + return 1; + } + else if(Fl::test_shortcut(FL_ALT + 'i')) { opt_post_scales(0, GMSH_SET | GMSH_GUI, !opt_post_scales(0, GMSH_GET, 0)); redraw_opengl(); return 1; @@ -508,10 +514,6 @@ int GUI::global_shortcuts(int event) else if(Fl::test_shortcut(FL_ALT + 'c')) { opt_general_color_scheme(0, GMSH_SET | GMSH_GUI, opt_general_color_scheme(0, GMSH_GET, 0) + 1); - opt_geometry_color_scheme(0, GMSH_SET | GMSH_GUI, - opt_geometry_color_scheme(0, GMSH_GET, 0) + 1); - opt_mesh_color_scheme(0, GMSH_SET | GMSH_GUI, - opt_mesh_color_scheme(0, GMSH_GET, 0) + 1); redraw_opengl(); return 1; } @@ -870,7 +872,7 @@ void GUI::create_menu_window(int argc, char **argv) m_navig_butt[0]->box(FL_FLAT_BOX); m_navig_butt[0]->selection_color(FL_WHITE); m_navig_butt[0]->callback(mod_back_cb); - m_navig_butt[0]->tooltip("Go back one in the menu history"); + m_navig_butt[0]->tooltip("Go back one in the menu history (<)"); m_navig_butt[1] = new Fl_Button(1, y + BH / 2, 18, BH / 2, "@#>"); m_navig_butt[1]->labeltype(FL_SYMBOL_LABEL); @@ -878,7 +880,7 @@ void GUI::create_menu_window(int argc, char **argv) m_navig_butt[1]->box(FL_FLAT_BOX); m_navig_butt[1]->selection_color(FL_WHITE); m_navig_butt[1]->callback(mod_forward_cb); - m_navig_butt[1]->tooltip("Go forward one in the menu history"); + m_navig_butt[1]->tooltip("Go forward one in the menu history (>)"); m_module_butt = new Fl_Choice(19, y, width - 24, BH); m_module_butt->menu(m_module_table); @@ -904,7 +906,7 @@ void GUI::create_menu_window(int argc, char **argv) m_toggle2_butt[i]->labelsize(11); m_toggle2_butt[i]->align(FL_ALIGN_CENTER); m_toggle2_butt[i]->hide(); - m_toggle2_butt[i]->tooltip("Show view option menu"); + m_toggle2_butt[i]->tooltip("Show view option menu (Shift+w)"); m_popup_butt[i] = new Fl_Menu_Button(width - (fontsize + 4), y + i * BH, (fontsize + 4), BH); m_popup_butt[i]->type(Fl_Menu_Button::POPUP123); @@ -1127,17 +1129,17 @@ void GUI::create_graphic_window(int argc, char **argv) g_status_butt[0] = new Fl_Button(x, glheight + 2, sw, sh - 4, "X"); x += sw; g_status_butt[0]->callback(status_xyz1p_cb, (void *)0); - g_status_butt[0]->tooltip("Set X view (Y=Z=0)"); + g_status_butt[0]->tooltip("Set X view (Alt+x)"); g_status_butt[1] = new Fl_Button(x, glheight + 2, sw, sh - 4, "Y"); x += sw; g_status_butt[1]->callback(status_xyz1p_cb, (void *)1); - g_status_butt[1]->tooltip("Set Y view (X=Z=0)"); + g_status_butt[1]->tooltip("Set Y view (Alt+y)"); g_status_butt[2] = new Fl_Button(x, glheight + 2, sw, sh - 4, "Z"); x += sw; g_status_butt[2]->callback(status_xyz1p_cb, (void *)2); - g_status_butt[2]->tooltip("Set Z view (X=Y=0)"); + g_status_butt[2]->tooltip("Set Z view (Alt+z)"); g_status_butt[3] = new Fl_Button(x, glheight + 2, 2 * fontsize, sh - 4, "1:1"); x += 2 * fontsize; @@ -1464,29 +1466,34 @@ void GUI::create_option_window() gen_butt[13]->selection_color(TOGGLE_COLOR); gen_butt[0] = new Fl_Check_Button(2 * WB, 2 * WB + 2 * BH, BW, BH, "Show moving axes"); + gen_butt[0]->tooltip("(Alt+Shift+a)"); gen_butt[1] = new Fl_Check_Button(2 * WB, 2 * WB + 3 * BH, BW, BH, "Show small axes"); - gen_butt[2] = new Fl_Check_Button(2 * WB, 2 * WB + 4 * BH, BW, BH, "Draw simplified model while rotating, panning and zooming"); - gen_butt[3] = new Fl_Check_Button(2 * WB, 2 * WB + 5 * BH, BW, BH, "Enable double buffering"); - gen_butt[4] = new Fl_Check_Button(2 * WB, 2 * WB + 6 * BH, BW, BH, "Use fake transparency mode"); - gen_butt[5] = new Fl_Check_Button(2 * WB, 2 * WB + 7 * BH, BW, BH, "Use trackball rotation mode instead of Euler angles"); - for(i = 0; i < 6; i++) { + gen_butt[1]->tooltip("(Alt+a)"); + gen_butt[6] = new Fl_Check_Button(2 * WB, 2 * WB + 4 * BH, BW, BH, "Show bounding boxes"); + gen_butt[6]->tooltip("(Alt+b)"); + gen_butt[2] = new Fl_Check_Button(2 * WB, 2 * WB + 5 * BH, BW, BH, "Draw simplified model while rotating, panning and zooming"); + gen_butt[2]->tooltip("(Alt+f)"); + gen_butt[3] = new Fl_Check_Button(2 * WB, 2 * WB + 6 * BH, BW, BH, "Enable double buffering"); + gen_butt[4] = new Fl_Check_Button(2 * WB, 2 * WB + 7 * BH, BW, BH, "Use fake transparency mode"); + gen_butt[5] = new Fl_Check_Button(2 * WB, 2 * WB + 8 * BH, BW, BH, "Use trackball rotation mode instead of Euler angles"); + for(i = 0; i <= 6; i++) { gen_butt[i]->type(FL_TOGGLE_BUTTON); gen_butt[i]->down_box(TOGGLE_BOX); gen_butt[i]->selection_color(TOGGLE_COLOR); } - gen_butt[15] = new Fl_Check_Button(2 * WB, 2 * WB + 8 * BH, BW, BH, "Rotate around pseudo center of gravity"); + gen_butt[15] = new Fl_Check_Button(2 * WB, 2 * WB + 9 * BH, BW, BH, "Rotate around pseudo center of gravity"); gen_butt[15]->type(FL_TOGGLE_BUTTON); gen_butt[15]->down_box(TOGGLE_BOX); 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 + 9 * BH, BB, BH, "Select"); + 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 + 9 * BH, IW / 3, BH); - gen_value[9] = new Fl_Value_Input(2 * WB + IW / 3, 2 * WB + 9 * BH, IW / 3, BH); - gen_value[10] = new Fl_Value_Input(2 * WB + 2 * IW / 3, 2 * WB + 9 * BH, IW / 3, BH, "Rotation center"); + 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(); @@ -1541,6 +1548,7 @@ void GUI::create_option_window() gen_choice[2] = new Fl_Choice(2 * WB, 2 * WB + 1 * BH, IW, BH, "Projection mode"); gen_choice[2]->menu(menu_projection); gen_choice[2]->align(FL_ALIGN_RIGHT); + gen_choice[2]->tooltip("(Alt+o)"); gen_value[2] = new Fl_Value_Input(2 * WB, 2 * WB + 2 * BH, IW/3, BH); gen_value[2]->minimum(-1); @@ -1609,12 +1617,19 @@ void GUI::create_option_window() { Fl_Group *o = new Fl_Group(WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Colors"); o->hide(); - gen_value[0] = new Fl_Value_Input(2 * WB, 2 * WB + 1 * BH, IW, BH, "Predefined color scheme"); - gen_value[0]->minimum(0); - gen_value[0]->maximum(2); - gen_value[0]->step(1); - gen_value[0]->align(FL_ALIGN_RIGHT); - gen_value[0]->callback(general_options_color_scheme_cb); + + static Fl_Menu_Item menu_color_scheme[] = { + {"Dark", 0, 0, 0}, + {"Light", 0, 0, 0}, + {"Grayscale", 0, 0, 0}, + {0} + }; + + gen_choice[3] = new Fl_Choice(2 * WB, 2 * WB + 1 * BH, IW, BH, "Predefined color scheme"); + gen_choice[3]->menu(menu_color_scheme); + gen_choice[3]->callback(general_options_color_scheme_cb); + gen_choice[3]->align(FL_ALIGN_RIGHT); + gen_choice[3]->tooltip("(Alt+c)"); Fl_Scroll *s = new Fl_Scroll(2 * WB, 3 * WB + 2 * BH, IW + 20, height - 5 * WB - 2 * BH); i = 0; @@ -1648,9 +1663,13 @@ void GUI::create_option_window() { Fl_Group *o = new Fl_Group(WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Visibility"); geo_butt[0] = new Fl_Check_Button(2 * WB, 2 * WB + 1 * BH, BW / 2 - WB, BH, "Points"); + geo_butt[0]->tooltip("(Alt+p)"); geo_butt[1] = new Fl_Check_Button(2 * WB, 2 * WB + 2 * BH, BW / 2 - WB, BH, "Lines"); + geo_butt[1]->tooltip("(Alt+l)"); geo_butt[2] = new Fl_Check_Button(2 * WB, 2 * WB + 3 * BH, BW / 2 - WB, BH, "Surfaces"); + geo_butt[2]->tooltip("(Alt+s)"); geo_butt[3] = new Fl_Check_Button(2 * WB, 2 * WB + 4 * BH, BW / 2 - WB, BH, "Volumes"); + geo_butt[3]->tooltip("(Alt+v)"); geo_butt[4] = new Fl_Check_Button(width / 2, 2 * WB + 1 * BH, BW / 2 - WB, BH, "Point numbers"); geo_butt[5] = new Fl_Check_Button(width / 2, 2 * WB + 2 * BH, BW / 2 - WB, BH, "Line numbers"); geo_butt[6] = new Fl_Check_Button(width / 2, 2 * WB + 3 * BH, BW / 2 - WB, BH, "Surface numbers"); @@ -1679,6 +1698,7 @@ void GUI::create_option_window() geo_butt[9]->type(FL_TOGGLE_BUTTON); geo_butt[9]->down_box(TOGGLE_BOX); geo_butt[9]->selection_color(TOGGLE_COLOR); + geo_butt[9]->tooltip("(Alt+w)"); geo_choice[0] = new Fl_Choice(2 * WB, 2 * WB + 2 * BH, IW, BH, "Point display"); geo_choice[0]->menu(menu_point_display); @@ -1716,17 +1736,11 @@ void GUI::create_option_window() { Fl_Group *o = new Fl_Group(WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Colors"); o->hide(); - geo_value[2] = new Fl_Value_Input(2 * WB, 2 * WB + 1 * BH, IW, BH, "Predefined color scheme"); - geo_value[2]->minimum(0); - geo_value[2]->maximum(2); - geo_value[2]->step(1); - geo_value[2]->align(FL_ALIGN_RIGHT); - geo_value[2]->callback(geometry_options_color_scheme_cb); - Fl_Scroll *s = new Fl_Scroll(2 * WB, 3 * WB + 2 * BH, IW + 20, height - 5 * WB - 2 * BH); + Fl_Scroll *s = new Fl_Scroll(2 * WB, 2 * WB + 1 * BH, IW + 20, height - 4 * WB - 1 * BH); i = 0; while(GeometryOptions_Color[i].str) { - geo_col[i] = new Fl_Button(2 * WB, 3 * WB + (2 + i) * BH, IW, BH, GeometryOptions_Color[i].str); + geo_col[i] = new Fl_Button(2 * WB, 2 * WB + (1 + i) * BH, IW, BH, GeometryOptions_Color[i].str); geo_col[i]->callback(color_cb, (void *)GeometryOptions_Color[i].function); i++; } @@ -1815,11 +1829,17 @@ void GUI::create_option_window() { Fl_Group *o = new Fl_Group(WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Visibility"); mesh_butt[6] = new Fl_Check_Button(2 * WB, 2 * WB + 1 * BH, BW / 2 - WB, BH, "Nodes"); + mesh_butt[6]->tooltip("(Alt+Shift+p)"); mesh_butt[7] = new Fl_Check_Button(2 * WB, 2 * WB + 2 * BH, BW / 2 - WB, BH, "Line elements"); + mesh_butt[7]->tooltip("(Alt+Shift+l)"); mesh_butt[8] = new Fl_Check_Button(2 * WB, 2 * WB + 3 * BH, BW / 2 - WB, BH, "Surface element edges"); + mesh_butt[8]->tooltip("(Alt+Shift+s)"); mesh_butt[9] = new Fl_Check_Button(2 * WB, 2 * WB + 4 * BH, BW / 2 - WB, BH, "Surface element faces"); + mesh_butt[9]->tooltip("(Alt+Shift+s, Alt+Shift+d)"); mesh_butt[10] = new Fl_Check_Button(2 * WB, 2 * WB + 5 * BH, BW / 2 - WB, BH, "Volume element edges"); + mesh_butt[10]->tooltip("(Alt+Shift+v)"); mesh_butt[11] = new Fl_Check_Button(2 * WB, 2 * WB + 6 * BH, BW / 2 - WB, BH, "Volume element faces"); + mesh_butt[11]->tooltip("(Alt+Shift+v)"); mesh_butt[12] = new Fl_Check_Button(width / 2, 2 * WB + 1 * BH, BW / 2 - WB, BH, "Node numbers"); mesh_butt[13] = new Fl_Check_Button(width / 2, 2 * WB + 2 * BH, BW / 2 - WB, BH, "Line element numbers"); mesh_butt[14] = new Fl_Check_Button(width / 2, 2 * WB + 3 * BH, BW / 2 - WB, BH, "Surface element numbers"); @@ -1882,6 +1902,7 @@ void GUI::create_option_window() Fl_Group *o = new Fl_Group(WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Aspect"); o->hide(); mesh_butt[17] = new Fl_Check_Button(2 * WB, 2 * WB + 1 * BH, BW, BH, "Enable lighting"); + mesh_butt[17]->tooltip("(Alt+w)"); mesh_butt[18] = new Fl_Check_Button(2 * WB, 2 * WB + 2 * BH, BW, BH, "Use two-side lighting"); mesh_butt[19] = new Fl_Check_Button(2 * WB, 2 * WB + 3 * BH, BW, BH, "Smooth normals"); for(i = 17; i <= 19; i++) { @@ -1938,17 +1959,10 @@ void GUI::create_option_window() mesh_choice[4]->menu(menu_mesh_color); mesh_choice[4]->align(FL_ALIGN_RIGHT); - mesh_value[12] = new Fl_Value_Input(2 * WB, 2 * WB + 2 * BH, IW, BH, "Predefined color scheme"); - mesh_value[12]->minimum(0); - mesh_value[12]->maximum(2); - mesh_value[12]->step(1); - mesh_value[12]->align(FL_ALIGN_RIGHT); - mesh_value[12]->callback(mesh_options_color_scheme_cb); - - Fl_Scroll *s = new Fl_Scroll(2 * WB, 3 * WB + 3 * BH, IW + 20, height - 5 * WB - 3 * BH); + Fl_Scroll *s = new Fl_Scroll(2 * WB, 3 * WB + 2 * BH, IW + 20, height - 5 * WB - 2 * BH); i = 0; while(MeshOptions_Color[i].str) { - mesh_col[i] = new Fl_Button(2 * WB, 3 * WB + (3 + i) * BH, IW, BH, MeshOptions_Color[i].str); + mesh_col[i] = new Fl_Button(2 * WB, 3 * WB + (2 + i) * BH, IW, BH, MeshOptions_Color[i].str); mesh_col[i]->callback(color_cb, (void *)MeshOptions_Color[i].function); i++; } @@ -2082,7 +2096,9 @@ void GUI::create_option_window() view_butt[8] = new Fl_Check_Button(width / 2, 2 * WB + 1 * BH, BW / 2 - WB, BH, "Show time"); view_butt[5] = new Fl_Check_Button(width / 2, 2 * WB + 2 * BH, BW / 2 - WB, BH, "Show annotations"); + view_butt[5]->tooltip("(Alt+n)"); view_butt[4] = new Fl_Check_Button(width / 2, 2 * WB + 3 * BH, BW / 2 - WB, BH, "Show scale"); + view_butt[4]->tooltip("(Alt+i)"); view_butt[6] = new Fl_Check_Button(width / 2, 2 * WB + 4 * BH, BW / 2 - WB, BH, "Transparent scale"); view_butt[7] = new Fl_Check_Button(width / 2, 2 * WB + 5 * BH, BW / 2 - WB, BH, "Auto position"); for(i = 4; i <= 8; i++) { @@ -2101,6 +2117,7 @@ void GUI::create_option_window() view_butt[10] = new Fl_Check_Button(width / 2, 2 * WB + 1 * BH, BW / 2 - WB, BH, "Show elements"); view_butt[11] = new Fl_Check_Button(width / 2, 2 * WB + 2 * BH, BW / 2 - WB, BH, "Enable lighting"); + view_butt[11]->tooltip("(Alt+w)"); view_butt[9] = new Fl_Check_Button(width / 2, 2 * WB + 3 * BH, BW / 2 - WB, BH, "Use two-side lighting"); view_butt[12] = new Fl_Check_Button(width / 2, 2 * WB + 4 * BH, BW / 2 - WB, BH, "Smooth normals"); for(i = 9; i <= 12; i++) { @@ -2197,6 +2214,7 @@ void GUI::create_option_window() view_choice[0]->menu(menu_iso); view_choice[0]->align(FL_ALIGN_RIGHT); view_choice[0]->callback(set_changed_cb, 0); + view_choice[0]->tooltip("(Alt+t)"); static Fl_Menu_Item menu_range[] = { {"Default", 0, (Fl_Callback *)view_options_custom_cb, (void*)0}, diff --git a/Fltk/Opengl_Window.cpp b/Fltk/Opengl_Window.cpp index 3c04357e90fc98e90836f87cdc3d0eef91f36734..8c6ef6157270ccb227cba2164d8beac162dc0914 100644 --- a/Fltk/Opengl_Window.cpp +++ b/Fltk/Opengl_Window.cpp @@ -1,4 +1,4 @@ -// $Id: Opengl_Window.cpp,v 1.36 2004-07-05 15:20:06 geuzaine Exp $ +// $Id: Opengl_Window.cpp,v 1.37 2004-07-22 05:47:46 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -296,7 +296,7 @@ int Opengl_Window::handle(int event) set_t(2, 0.); } - if(CTX.fast) { + if(CTX.fast_redraw) { CTX.mesh.draw = 0; CTX.post.draw = 0; } diff --git a/Graphics/Mesh.cpp b/Graphics/Mesh.cpp index 842747dfea3ad37baa628dc8980878320af4dca5..096277e60e9685d7d8429cab30959529aefe5b91 100644 --- a/Graphics/Mesh.cpp +++ b/Graphics/Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Mesh.cpp,v 1.103 2004-07-18 16:42:22 geuzaine Exp $ +// $Id: Mesh.cpp,v 1.104 2004-07-22 05:47:46 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -135,7 +135,8 @@ void Draw_Mesh(Mesh * M) // draw the bounding box of the mesh if we are in fast redraw mode // and there is no geometry - if(!CTX.mesh.draw && Tree_Nbr(M->Vertices) && !Tree_Nbr(M->Points)) { + if((CTX.draw_bbox && (Tree_Nbr(M->Vertices) || Tree_Nbr(M->Points))) || + (!CTX.mesh.draw && Tree_Nbr(M->Vertices) && !Tree_Nbr(M->Points))) { glColor4ubv((GLubyte *) & CTX.color.fg); glLineWidth(CTX.line_width); glBegin(GL_LINE_LOOP); diff --git a/Graphics/Post.cpp b/Graphics/Post.cpp index 38fd00a25bd07f0dc6fedb4ea5d4db6aef748661..ee2b88882e884a7132dedb5e2b44e6e9c4a8c42a 100644 --- a/Graphics/Post.cpp +++ b/Graphics/Post.cpp @@ -1,4 +1,4 @@ -// $Id: Post.cpp,v 1.73 2004-07-18 16:42:23 geuzaine Exp $ +// $Id: Post.cpp,v 1.74 2004-07-22 05:47:47 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -315,7 +315,7 @@ void Draw_Post(void) if(!CTX.post.list) return; - if(!CTX.post.draw) { // draw only the bbox of the visible views + if(CTX.draw_bbox || !CTX.post.draw) { // draw only the bbox of the visible views for(int iView = 0; iView < List_Nbr(CTX.post.list); iView++) { v = (Post_View *) List_Pointer(CTX.post.list, iView); if(v->Visible && v->Type == DRAW_POST_3D) { @@ -357,9 +357,11 @@ void Draw_Post(void) Draw_String(label); } } - return; } + if(!CTX.post.draw) + return; + for(int iView = 0; iView < List_Nbr(CTX.post.list); iView++) { v = (Post_View *) List_Pointer(CTX.post.list, iView); diff --git a/doc/texinfo/opt_general.texi b/doc/texinfo/opt_general.texi index e9b59a60c69bdbb732b9748e40c0d081ef751b6f..d5341bfb228fd0ff9db8364a20d846a3dd79d70b 100644 --- a/doc/texinfo/opt_general.texi +++ b/doc/texinfo/opt_general.texi @@ -259,13 +259,18 @@ Use a double buffered graphic window (on Unix, should be set to 0 when working o Default value: @code{1}@* Saved in: @code{General.OptionsFileName} +@item General.DrawBoundingBoxes +Draw bounding boxes@* +Default value: @code{0}@* +Saved in: @code{General.OptionsFileName} + @item General.FakeTransparency Use fake transparency (cheaper than the real thing, but incorrect)@* Default value: @code{0}@* Saved in: @code{General.OptionsFileName} @item General.FastRedraw -Fast redraw (no mesh or view display) when interacting with the model@* +Draw simplified model while rotating, panning and zooming@* Default value: @code{1}@* Saved in: @code{General.OptionsFileName} diff --git a/doc/texinfo/opt_geometry.texi b/doc/texinfo/opt_geometry.texi index 984a58300a51c2b939cbe0e7bf97b9f9642feae8..84b2541fd55d3c65463f37d693afc79d0b09f680 100644 --- a/doc/texinfo/opt_geometry.texi +++ b/doc/texinfo/opt_geometry.texi @@ -9,11 +9,6 @@ Number of points used to draw a circle/ellipse@* Default value: @code{20}@* Saved in: @code{General.OptionsFileName} -@item Geometry.ColorScheme -Default geometry color scheme (0, 1 or 2)@* -Default value: @code{0}@* -Saved in: @code{General.OptionsFileName} - @item Geometry.CircleWarning Warn if circle arc is greater than Pi@* Default value: @code{1}@* diff --git a/doc/texinfo/opt_mesh.texi b/doc/texinfo/opt_mesh.texi index 070e9eb7a7abae9b9b1e8a8f0f0a1b9578668269..76b97bb17591f15db1ed935f80e9b1c0ab2ce5cb 100644 --- a/doc/texinfo/opt_mesh.texi +++ b/doc/texinfo/opt_mesh.texi @@ -34,11 +34,6 @@ Mesh coloring (0=by element type, 1=by elementary entity, 2=by physical entity, Default value: @code{1}@* Saved in: @code{General.OptionsFileName} -@item Mesh.ColorScheme -Default mesh color scheme (0, 1 or 2)@* -Default value: @code{0}@* -Saved in: @code{General.OptionsFileName} - @item Mesh.ConstrainedBackgroundMesh Should the background mesh be constrained by the characteristic lengths associated with the geometry?@* Default value: @code{0}@* diff --git a/doc/texinfo/shortcuts.texi b/doc/texinfo/shortcuts.texi index 5333610bd04d1b4f940862e083616e76384c4db0..d458347a79c04ae1d0ac0f23f52c8363084bf349 100644 --- a/doc/texinfo/shortcuts.texi +++ b/doc/texinfo/shortcuts.texi @@ -45,7 +45,7 @@ raise (show) all open windows hide/show big moving axes @item Alt+b -hide/show all post-processing scales +hide/show all bounding boxes @item Alt+c loop through predefined color schemes @@ -71,6 +71,9 @@ show geometry options @item Alt+h hide/show all post-processing views +@item Alt+i +hide/show all post-processing scales + @item Shift+i show statistics window