From c1bfcdb028a3120bdec9e99e2b9756794b7c1cff Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Thu, 15 Jan 2009 00:45:11 +0000 Subject: [PATCH] move per-window transform from general into geometry options: there's no easy way to apply this to mesh/views unless we duplicate vertex arrays anyway --- Common/Context.h | 5 +- Common/DefaultOptions.h | 56 ++++++------- Common/Options.cpp | 84 +++++++++---------- Common/Options.h | 26 +++--- Fltk/aboutWindow.cpp | 3 +- Fltk/classificationEditor.cpp | 3 +- Fltk/clippingWindow.cpp | 3 +- Fltk/contextWindow.cpp | 4 +- Fltk/extraDialogs.cpp | 2 +- Fltk/fieldWindow.cpp | 3 +- Fltk/mainWindow.h | 4 +- Fltk/manipWindow.cpp | 3 +- Fltk/menuWindow.cpp | 3 +- Fltk/messageWindow.cpp | 2 +- Fltk/optionWindow.cpp | 153 +++++++++++++++++----------------- Fltk/paletteWindow.h | 4 +- Fltk/partitionDialog.cpp | 2 +- Fltk/pluginWindow.cpp | 3 +- Fltk/projectionEditor.cpp | 3 +- Fltk/solverWindow.cpp | 2 +- Fltk/statisticsWindow.cpp | 3 +- Fltk/visibilityWindow.cpp | 2 +- Graphics/drawPost.cpp | 8 +- doc/VERSIONS.txt | 11 ++- doc/texinfo/gmsh.texi | 4 +- doc/texinfo/opt_general.texi | 65 --------------- doc/texinfo/opt_geometry.texi | 65 +++++++++++++++ 27 files changed, 267 insertions(+), 259 deletions(-) diff --git a/Common/Context.h b/Common/Context.h index 09b62c8314..9ab1a0ae96 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -8,7 +8,6 @@ #include <vector> #include <string> - #include "CGNSOptions.h" #include "meshPartitionOptions.h" @@ -109,8 +108,6 @@ class Context_T { int expert_mode; // to disable some warnings for beginners int printing; // dynamic: equal to 1 while gmsh is printing int hide_unselected; // hide all unselected entities - int use_transform; // transform display coordinates? (0=no, 1=scale, 2=...) - double transform[3][3], offset[3]; // transformation matrix for geo/mesh drawing // these are used as temp vars until the GUI is ready double tmp_r[3]; // current Euler angles (in degrees!) @@ -133,6 +130,8 @@ class Context_T { double snap[3]; int occ_fix_small_edges, occ_fix_small_faces, occ_sew_faces; int clip; // status of clip planes (bit array) + int use_transform; // transform display coordinates? (0=no, 1=scale, 2=...) + double transform[3][3], offset[3]; // transformation matrix for geo/mesh drawing } geom; // mesh options diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index b7d60ff987..983c1a746d 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -672,12 +672,6 @@ StringXNumber GeneralOptions_Number[] = { { F|O, "NoPopup" , opt_general_nopopup , 0. , "Disable interactive dialog windows in scripts (and use default values instead)" }, - { F, "OffsetX" , opt_general_offset0 , 0. , - "Model diplay offset along X-axis (in model coordinates)" }, - { F, "OffsetY" , opt_general_offset1 , 0. , - "Model diplay offset along Y-axis (in model coordinates)" }, - { F, "OffsetZ" , opt_general_offset2 , 0. , - "Model diplay offset along Z-axis (in model coordinates)" }, { F|S, "OptionsPositionX" , opt_general_option_position0 , 650. , "Horizontal position (in pixels) of the upper left corner of the option window" }, { F|S, "OptionsPositionY" , opt_general_option_position1 , 150. , @@ -772,26 +766,6 @@ StringXNumber GeneralOptions_Number[] = { "Third trackball quaternion component (used if General.Trackball=1)" }, { F, "TrackballQuaternion3" , opt_general_quaternion3 , 1.0 , "Fourth trackball quaternion component (used if General.Trackball=1)" }, - { F, "Transform" , opt_general_transform , 0. , - "Transform model display coordinates (0=no, 1=scale)" }, - { F, "TransformXX" , opt_general_transform00 , 1. , - "Element (1,1) of the 3x3 model display transformation matrix" }, - { F, "TransformXY" , opt_general_transform01 , 0. , - "Element (1,2) of the 3x3 model display transformation matrix" }, - { F, "TransformXZ" , opt_general_transform02 , 0. , - "Element (1,3) of the 3x3 model display transformation matrix" }, - { F, "TransformYX" , opt_general_transform10 , 0. , - "Element (2,1) of the 3x3 model display transformation matrix" }, - { F, "TransformYY" , opt_general_transform11 , 1. , - "Element (2,2) of the 3x3 model display transformation matrix" }, - { F, "TransformYZ" , opt_general_transform12 , 0. , - "Element (2,3) of the 3x3 model display transformation matrix" }, - { F, "TransformZX" , opt_general_transform20 , 0. , - "Element (3,1) of the 3x3 model display transformation matrix" }, - { F, "TransformZY" , opt_general_transform21 , 0. , - "Element (3,2) of the 3x3 model display transformation matrix" }, - { F, "TransformZZ" , opt_general_transform22 , 1. , - "Element (3,3) of the 3x3 model display transformation matrix" }, { F, "TranslationX" , opt_general_translation0 , 0.0 , "X-axis translation (in model units)" }, { F, "TranslationY" , opt_general_translation1 , 0.0 , @@ -849,12 +823,18 @@ StringXNumber GeometryOptions_Number[] = { { F|O, "NumSubEdges" , opt_geometry_num_sub_edges , 20. , "Number of edge subdivisions between control points when displaying curves" }, - { F|O, "OCCFixSmallEdges" , opt_geometry_occ_fix_small_edges , 0. , + { F|O, "OCCFixSmallEdges" , opt_geometry_occ_fix_small_edges , 1. , "Fix small edges in STEP, IGES and BRep models" }, - { F|O, "OCCFixSmallFaces" , opt_geometry_occ_fix_small_faces , 0. , + { F|O, "OCCFixSmallFaces" , opt_geometry_occ_fix_small_faces , 1. , "Fix small faces in STEP, IGES and BRep models" }, { F|O, "OCCSewFaces" , opt_geometry_occ_sew_faces , 0. , "Sew faces in STEP, IGES and BRep models" }, + { F, "OffsetX" , opt_geometry_offset0 , 0. , + "Model diplay offset along X-axis (in model coordinates)" }, + { F, "OffsetY" , opt_geometry_offset1 , 0. , + "Model diplay offset along Y-axis (in model coordinates)" }, + { F, "OffsetZ" , opt_geometry_offset2 , 0. , + "Model diplay offset along Z-axis (in model coordinates)" }, { F|O, "OldCircle" , opt_geometry_old_circle , 0. , "Use old circle description (compatibility option for old Gmsh geometries)" }, { F|O, "OldNewReg" , opt_geometry_old_newreg , 1. , @@ -890,6 +870,26 @@ StringXNumber GeometryOptions_Number[] = { "Display size of tangent vectors (in pixels)" }, { F|O, "Tolerance" , opt_geometry_tolerance, 1.e-6 , "Geometrical tolerance" }, + { F, "Transform" , opt_geometry_transform , 0. , + "Transform model display coordinates (0=no, 1=scale)" }, + { F, "TransformXX" , opt_geometry_transform00 , 1. , + "Element (1,1) of the 3x3 model display transformation matrix" }, + { F, "TransformXY" , opt_geometry_transform01 , 0. , + "Element (1,2) of the 3x3 model display transformation matrix" }, + { F, "TransformXZ" , opt_geometry_transform02 , 0. , + "Element (1,3) of the 3x3 model display transformation matrix" }, + { F, "TransformYX" , opt_geometry_transform10 , 0. , + "Element (2,1) of the 3x3 model display transformation matrix" }, + { F, "TransformYY" , opt_geometry_transform11 , 1. , + "Element (2,2) of the 3x3 model display transformation matrix" }, + { F, "TransformYZ" , opt_geometry_transform12 , 0. , + "Element (2,3) of the 3x3 model display transformation matrix" }, + { F, "TransformZX" , opt_geometry_transform20 , 0. , + "Element (3,1) of the 3x3 model display transformation matrix" }, + { F, "TransformZY" , opt_geometry_transform21 , 0. , + "Element (3,2) of the 3x3 model display transformation matrix" }, + { F, "TransformZZ" , opt_geometry_transform22 , 1. , + "Element (3,3) of the 3x3 model display transformation matrix" }, { F|O, "Volumes" , opt_geometry_volumes , 0. , "Display geometry volumes? (not implemented yet)" }, diff --git a/Common/Options.cpp b/Common/Options.cpp index 8d64440fcb..5c18e1456a 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -4133,19 +4133,19 @@ double opt_general_light53(OPT_ARGS_NUM) return CTX.light_position[5][3]; } -double opt_general_transform(OPT_ARGS_NUM) +double opt_geometry_transform(OPT_ARGS_NUM) { if(action & GMSH_SET){ - CTX.use_transform = (int)val; - if(CTX.use_transform < 0 || CTX.use_transform > 1) CTX.use_transform = 0; + CTX.geom.use_transform = (int)val; + if(CTX.geom.use_transform < 0 || CTX.geom.use_transform > 1) CTX.geom.use_transform = 0; } #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_GUI) - GUI::instance()->options->general.choice[6]->value(CTX.use_transform); + GUI::instance()->options->geo.choice[3]->value(CTX.geom.use_transform); if(action & GMSH_SET){ - if(CTX.use_transform == 1){ - drawTransform *tr = new drawTransformScaled(CTX.transform, CTX.offset); + if(CTX.geom.use_transform == 1){ + drawTransform *tr = new drawTransformScaled(CTX.geom.transform, CTX.geom.offset); GUI::instance()->graph[0]->gl[0]->getDrawContext()->setTransform(tr); } else{ @@ -4154,104 +4154,104 @@ double opt_general_transform(OPT_ARGS_NUM) if(tr) delete tr; } } - GUI::instance()->options->activate("general_transform"); + GUI::instance()->options->activate("geo_transform"); } #endif - return CTX.use_transform; + return CTX.geom.use_transform; } -static double _opt_general_transform(OPT_ARGS_NUM, int ii, int jj, int nn) +static double _opt_geometry_transform(OPT_ARGS_NUM, int ii, int jj, int nn) { if(action & GMSH_SET) - CTX.transform[ii][jj] = val; + CTX.geom.transform[ii][jj] = val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_GUI) - GUI::instance()->options->general.value[nn]->value(CTX.transform[ii][jj]); + GUI::instance()->options->geo.value[nn]->value(CTX.geom.transform[ii][jj]); if(action & GMSH_SET){ drawTransform *tr = GUI::instance()->graph[0]->gl[0]->getDrawContext()->getTransform(); - if(tr) tr->setMatrix(CTX.transform, CTX.offset); + if(tr) tr->setMatrix(CTX.geom.transform, CTX.geom.offset); } } #endif - return CTX.transform[ii][jj]; + return CTX.geom.transform[ii][jj]; } -double opt_general_transform00(OPT_ARGS_NUM) +double opt_geometry_transform00(OPT_ARGS_NUM) { - return _opt_general_transform(num, action, val, 0, 0, 28); + return _opt_geometry_transform(num, action, val, 0, 0, 7); } -double opt_general_transform01(OPT_ARGS_NUM) +double opt_geometry_transform01(OPT_ARGS_NUM) { - return _opt_general_transform(num, action, val, 0, 1, 29); + return _opt_geometry_transform(num, action, val, 0, 1, 8); } -double opt_general_transform02(OPT_ARGS_NUM) +double opt_geometry_transform02(OPT_ARGS_NUM) { - return _opt_general_transform(num, action, val, 0, 2, 30); + return _opt_geometry_transform(num, action, val, 0, 2, 9); } -double opt_general_transform10(OPT_ARGS_NUM) +double opt_geometry_transform10(OPT_ARGS_NUM) { - return _opt_general_transform(num, action, val, 1, 0, 32); + return _opt_geometry_transform(num, action, val, 1, 0, 11); } -double opt_general_transform11(OPT_ARGS_NUM) +double opt_geometry_transform11(OPT_ARGS_NUM) { - return _opt_general_transform(num, action, val, 1, 1, 33); + return _opt_geometry_transform(num, action, val, 1, 1, 12); } -double opt_general_transform12(OPT_ARGS_NUM) +double opt_geometry_transform12(OPT_ARGS_NUM) { - return _opt_general_transform(num, action, val, 1, 2, 34); + return _opt_geometry_transform(num, action, val, 1, 2, 13); } -double opt_general_transform20(OPT_ARGS_NUM) +double opt_geometry_transform20(OPT_ARGS_NUM) { - return _opt_general_transform(num, action, val, 2, 0, 36); + return _opt_geometry_transform(num, action, val, 2, 0, 15); } -double opt_general_transform21(OPT_ARGS_NUM) +double opt_geometry_transform21(OPT_ARGS_NUM) { - return _opt_general_transform(num, action, val, 2, 1, 37); + return _opt_geometry_transform(num, action, val, 2, 1, 16); } -double opt_general_transform22(OPT_ARGS_NUM) +double opt_geometry_transform22(OPT_ARGS_NUM) { - return _opt_general_transform(num, action, val, 2, 2, 38); + return _opt_geometry_transform(num, action, val, 2, 2, 17); } -static double _opt_general_offset(OPT_ARGS_NUM, int ii, int nn) +static double _opt_geometry_offset(OPT_ARGS_NUM, int ii, int nn) { if(action & GMSH_SET) - CTX.offset[ii] = val; + CTX.geom.offset[ii] = val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_GUI) - GUI::instance()->options->general.value[nn]->value(CTX.offset[ii]); + GUI::instance()->options->geo.value[nn]->value(CTX.geom.offset[ii]); if(action & GMSH_SET){ drawTransform *tr = GUI::instance()->graph[0]->gl[0]->getDrawContext()->getTransform(); - if(tr) tr->setMatrix(CTX.transform, CTX.offset); + if(tr) tr->setMatrix(CTX.geom.transform, CTX.geom.offset); } } #endif - return CTX.offset[ii]; + return CTX.geom.offset[ii]; } -double opt_general_offset0(OPT_ARGS_NUM) +double opt_geometry_offset0(OPT_ARGS_NUM) { - return _opt_general_offset(num, action, val, 0, 31); + return _opt_geometry_offset(num, action, val, 0, 10); } -double opt_general_offset1(OPT_ARGS_NUM) +double opt_geometry_offset1(OPT_ARGS_NUM) { - return _opt_general_offset(num, action, val, 1, 35); + return _opt_geometry_offset(num, action, val, 1, 14); } -double opt_general_offset2(OPT_ARGS_NUM) +double opt_geometry_offset2(OPT_ARGS_NUM) { - return _opt_general_offset(num, action, val, 2, 39); + return _opt_geometry_offset(num, action, val, 2, 18); } double opt_geometry_auto_coherence(OPT_ARGS_NUM) diff --git a/Common/Options.h b/Common/Options.h index 5fba73b448..3e9d961dfc 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -380,19 +380,19 @@ double opt_general_light50(OPT_ARGS_NUM); double opt_general_light51(OPT_ARGS_NUM); double opt_general_light52(OPT_ARGS_NUM); double opt_general_light53(OPT_ARGS_NUM); -double opt_general_transform(OPT_ARGS_NUM); -double opt_general_transform00(OPT_ARGS_NUM); -double opt_general_transform01(OPT_ARGS_NUM); -double opt_general_transform02(OPT_ARGS_NUM); -double opt_general_transform10(OPT_ARGS_NUM); -double opt_general_transform11(OPT_ARGS_NUM); -double opt_general_transform12(OPT_ARGS_NUM); -double opt_general_transform20(OPT_ARGS_NUM); -double opt_general_transform21(OPT_ARGS_NUM); -double opt_general_transform22(OPT_ARGS_NUM); -double opt_general_offset0(OPT_ARGS_NUM); -double opt_general_offset1(OPT_ARGS_NUM); -double opt_general_offset2(OPT_ARGS_NUM); +double opt_geometry_transform(OPT_ARGS_NUM); +double opt_geometry_transform00(OPT_ARGS_NUM); +double opt_geometry_transform01(OPT_ARGS_NUM); +double opt_geometry_transform02(OPT_ARGS_NUM); +double opt_geometry_transform10(OPT_ARGS_NUM); +double opt_geometry_transform11(OPT_ARGS_NUM); +double opt_geometry_transform12(OPT_ARGS_NUM); +double opt_geometry_transform20(OPT_ARGS_NUM); +double opt_geometry_transform21(OPT_ARGS_NUM); +double opt_geometry_transform22(OPT_ARGS_NUM); +double opt_geometry_offset0(OPT_ARGS_NUM); +double opt_geometry_offset1(OPT_ARGS_NUM); +double opt_geometry_offset2(OPT_ARGS_NUM); double opt_geometry_auto_coherence(OPT_ARGS_NUM); double opt_geometry_highlight_orphans(OPT_ARGS_NUM); double opt_geometry_tolerance(OPT_ARGS_NUM); diff --git a/Fltk/aboutWindow.cpp b/Fltk/aboutWindow.cpp index b0a768294b..d43889ea3c 100644 --- a/Fltk/aboutWindow.cpp +++ b/Fltk/aboutWindow.cpp @@ -43,7 +43,8 @@ aboutWindow::aboutWindow() int width = 28 * FL_NORMAL_SIZE; int height = 15 * BH + BH/2; - win = new paletteWindow(width, height, CTX.non_modal_windows, "About Gmsh"); + win = new paletteWindow + (width, height, CTX.non_modal_windows ? true : false, "About Gmsh"); win->box(GMSH_WINDOW_BOX); { diff --git a/Fltk/classificationEditor.cpp b/Fltk/classificationEditor.cpp index f26f74ab87..187fa37db8 100644 --- a/Fltk/classificationEditor.cpp +++ b/Fltk/classificationEditor.cpp @@ -541,7 +541,8 @@ classificationEditor::classificationEditor() int BBB = (int)(1.4 * BB); // labels too long const int width = (int)(3.5 * BBB), height = 10 * BH; - _window = new paletteWindow(width, height, CTX.non_modal_windows, "Classify"); + _window = new paletteWindow + (width, height, CTX.non_modal_windows ? true : false, "Classify"); new Fl_Tabs(WB, WB, width - 2 * WB, height - 2 * WB); { diff --git a/Fltk/clippingWindow.cpp b/Fltk/clippingWindow.cpp index 5962bd5b0d..36f504d04a 100644 --- a/Fltk/clippingWindow.cpp +++ b/Fltk/clippingWindow.cpp @@ -163,7 +163,8 @@ clippingWindow::clippingWindow(int deltaFontSize) int height = 10 * BH + 5 * WB; int L = 7 * FL_NORMAL_SIZE; - win = new paletteWindow(width, height, CTX.non_modal_windows, "Clipping"); + win = new paletteWindow + (width, height, CTX.non_modal_windows ? true : false, "Clipping"); win->box(GMSH_WINDOW_BOX); browser = new Fl_Multi_Browser(WB, WB, L - WB, height - BH - 3 * WB); diff --git a/Fltk/contextWindow.cpp b/Fltk/contextWindow.cpp index 44751d8f88..44cf5c8c7c 100644 --- a/Fltk/contextWindow.cpp +++ b/Fltk/contextWindow.cpp @@ -51,8 +51,8 @@ geometryContextWindow::geometryContextWindow(int deltaFontSize) int width = 31 * FL_NORMAL_SIZE; int height = 4 * WB + 8 * BH; - win = new paletteWindow - (width, height, CTX.non_modal_windows, "Contextual Geometry Definitions"); + win = new paletteWindow(width, height, CTX.non_modal_windows ? true : false, + "Contextual Geometry Definitions"); win->box(GMSH_WINDOW_BOX); { Fl_Tabs *o = new Fl_Tabs(WB, WB, width - 2 * WB, height - 2 * WB); diff --git a/Fltk/extraDialogs.cpp b/Fltk/extraDialogs.cpp index d8e112f7a5..0de9c08749 100644 --- a/Fltk/extraDialogs.cpp +++ b/Fltk/extraDialogs.cpp @@ -42,7 +42,7 @@ int arrow_editor(const char *title, double &a, double &b, double &c) if(!editor){ editor = new _editor; editor->window = new paletteWindow - (2 * BB + 3 * WB, 4 * BH + 3 * WB, CTX.non_modal_windows); + (2 * BB + 3 * WB, 4 * BH + 3 * WB, CTX.non_modal_windows ? true : false); editor->sa = new Fl_Value_Slider(WB, WB, BB, BH, "Head radius"); editor->sa->type(FL_HOR_SLIDER); editor->sa->align(FL_ALIGN_RIGHT); diff --git a/Fltk/fieldWindow.cpp b/Fltk/fieldWindow.cpp index fa00aecace..12500f1c78 100644 --- a/Fltk/fieldWindow.cpp +++ b/Fltk/fieldWindow.cpp @@ -97,7 +97,8 @@ fieldWindow::fieldWindow(int deltaFontSize) : _deltaFontSize(deltaFontSize) int width = (CTX.field_size[0] < width0) ? width0 : CTX.field_size[0]; int height = (CTX.field_size[1] < height0) ? height0 : CTX.field_size[1]; - win = new paletteWindow(width, height, CTX.non_modal_windows, "Fields"); + win = new paletteWindow + (width, height, CTX.non_modal_windows ? true : false, "Fields"); win->box(GMSH_WINDOW_BOX); int x = WB, y = WB, w = (int)(1.5 * BB), h = height - 2 * WB - 3 * BH; diff --git a/Fltk/mainWindow.h b/Fltk/mainWindow.h index 195a70e6b6..b663448066 100644 --- a/Fltk/mainWindow.h +++ b/Fltk/mainWindow.h @@ -34,10 +34,10 @@ class mainWindow : public Fl_Window { return Fl_Window::handle(event); } public: - mainWindow(int w, int h, bool nonmodal=false, const char *l=0) + mainWindow(int w, int h, bool nonModal, const char *l=0) : Fl_Window(w, h, l) { - if(nonmodal) set_non_modal(); + if(nonModal) set_non_modal(); } void show() { diff --git a/Fltk/manipWindow.cpp b/Fltk/manipWindow.cpp index 94af87076b..33cf69d052 100644 --- a/Fltk/manipWindow.cpp +++ b/Fltk/manipWindow.cpp @@ -43,7 +43,8 @@ manipWindow::manipWindow(int deltaFontSize) int width = 4 * BB + 2 * WB; int height = 5 * BH + 3 * WB; - win = new paletteWindow(width, height, CTX.non_modal_windows, "Manipulator"); + win = new paletteWindow + (width, height, CTX.non_modal_windows ? true : false, "Manipulator"); win->box(GMSH_WINDOW_BOX); Fl_Box *top[3], *left[3]; diff --git a/Fltk/menuWindow.cpp b/Fltk/menuWindow.cpp index ce7e31a32a..8df516bb7f 100644 --- a/Fltk/menuWindow.cpp +++ b/Fltk/menuWindow.cpp @@ -2471,7 +2471,8 @@ menuWindow::menuWindow() } #endif - win = new mainWindow(width, _MH + NB_BUTT_SCROLL * BH, CTX.non_modal_windows, "Gmsh"); + win = new mainWindow + (width, _MH + NB_BUTT_SCROLL * BH, CTX.non_modal_windows ? true : false, "Gmsh"); win->box(GMSH_WINDOW_BOX); win->callback(file_quit_cb); diff --git a/Fltk/messageWindow.cpp b/Fltk/messageWindow.cpp index 41d2a6fdb7..e47f34a54c 100644 --- a/Fltk/messageWindow.cpp +++ b/Fltk/messageWindow.cpp @@ -73,7 +73,7 @@ messageWindow::messageWindow(int deltaFontSize) int height = CTX.msg_size[1]; win = new paletteWindow - (width, height, CTX.non_modal_windows, "Message Console"); + (width, height, CTX.non_modal_windows ? true : false, "Message Console"); win->box(GMSH_WINDOW_BOX); browser = new Fl_Browser(0, 0, width, height - 2 * WB - BH); diff --git a/Fltk/optionWindow.cpp b/Fltk/optionWindow.cpp index b5a7423855..7155f44285 100644 --- a/Fltk/optionWindow.cpp +++ b/Fltk/optionWindow.cpp @@ -288,18 +288,6 @@ static void general_options_ok_cb(Fl_Widget *w, void *data) opt_general_axes_zmax(0, GMSH_SET, o->general.value[25]->value()); opt_general_small_axes_position0(0, GMSH_SET, o->general.value[26]->value()); opt_general_small_axes_position1(0, GMSH_SET, o->general.value[27]->value()); - opt_general_offset0(0, GMSH_SET, o->general.value[31]->value()); - opt_general_offset1(0, GMSH_SET, o->general.value[35]->value()); - opt_general_offset2(0, GMSH_SET, o->general.value[39]->value()); - opt_general_transform00(0, GMSH_SET, o->general.value[28]->value()); - opt_general_transform01(0, GMSH_SET, o->general.value[29]->value()); - opt_general_transform02(0, GMSH_SET, o->general.value[30]->value()); - opt_general_transform10(0, GMSH_SET, o->general.value[32]->value()); - opt_general_transform11(0, GMSH_SET, o->general.value[33]->value()); - opt_general_transform12(0, GMSH_SET, o->general.value[34]->value()); - opt_general_transform20(0, GMSH_SET, o->general.value[36]->value()); - opt_general_transform21(0, GMSH_SET, o->general.value[37]->value()); - opt_general_transform22(0, GMSH_SET, o->general.value[38]->value()); opt_general_default_filename(0, GMSH_SET, o->general.input[0]->value()); opt_general_editor(0, GMSH_SET, o->general.input[1]->value()); @@ -316,7 +304,6 @@ static void general_options_ok_cb(Fl_Widget *w, void *data) opt_general_orthographic(0, GMSH_SET, !o->general.choice[2]->value()); opt_general_axes(0, GMSH_SET, o->general.choice[4]->value()); opt_general_background_gradient(0, GMSH_SET, o->general.choice[5]->value()); - opt_general_transform(0, GMSH_SET, o->general.choice[6]->value()); if(CTX.fast_redraw) CTX.post.draw = CTX.mesh.draw = 0; @@ -371,11 +358,24 @@ static void geometry_options_ok_cb(Fl_Widget *w, void *data) opt_geometry_line_width(0, GMSH_SET, o->geo.value[4]->value()); opt_geometry_point_sel_size(0, GMSH_SET, o->geo.value[5]->value()); opt_geometry_line_sel_width(0, GMSH_SET, o->geo.value[6]->value()); + opt_geometry_transform00(0, GMSH_SET, o->geo.value[7]->value()); + opt_geometry_transform01(0, GMSH_SET, o->geo.value[8]->value()); + opt_geometry_transform02(0, GMSH_SET, o->geo.value[9]->value()); + opt_geometry_transform10(0, GMSH_SET, o->geo.value[11]->value()); + opt_geometry_transform11(0, GMSH_SET, o->geo.value[12]->value()); + opt_geometry_transform12(0, GMSH_SET, o->geo.value[13]->value()); + opt_geometry_transform20(0, GMSH_SET, o->geo.value[15]->value()); + opt_geometry_transform21(0, GMSH_SET, o->geo.value[16]->value()); + opt_geometry_transform22(0, GMSH_SET, o->geo.value[17]->value()); + opt_geometry_offset0(0, GMSH_SET, o->geo.value[10]->value()); + opt_geometry_offset1(0, GMSH_SET, o->geo.value[14]->value()); + opt_geometry_offset2(0, GMSH_SET, o->geo.value[18]->value()); opt_geometry_point_type(0, GMSH_SET, o->geo.choice[0]->value()); opt_geometry_line_type(0, GMSH_SET, o->geo.choice[1]->value()); opt_geometry_surface_type(0, GMSH_SET, o->geo.choice[2]->value()); - + opt_geometry_transform(0, GMSH_SET, o->geo.choice[3]->value()); + if(CTX.fast_redraw) CTX.post.draw = CTX.mesh.draw = 0; Draw(); @@ -1146,7 +1146,8 @@ optionWindow::optionWindow(int deltaFontSize) int height = 12 * BH + 4 * WB; int L = 7 * FL_NORMAL_SIZE; - win = new paletteWindow(width, height, CTX.non_modal_windows); + win = new paletteWindow + (width, height, CTX.non_modal_windows ? true : false); win->box(GMSH_WINDOW_BOX); win->label("Options - General"); @@ -1404,61 +1405,6 @@ optionWindow::optionWindow(int deltaFontSize) o->end(); } - { - Fl_Group *o = new Fl_Group - (L + WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Transfo"); - o->hide(); - - static Fl_Menu_Item menu_transform[] = { - {"None", 0, 0, 0}, - {"Scaling", 0, 0, 0}, - {0} - }; - general.choice[6] = new Fl_Choice - (L + 2 * WB, 2 * WB + 1 * BH, IW, BH, "Model coordinate transform"); - general.choice[6]->menu(menu_transform); - general.choice[6]->align(FL_ALIGN_RIGHT); - general.choice[6]->callback(general_options_ok_cb, (void*)"general_transform"); - - int ss = 2 * IW / 3 / 3 + 4; - general.value[28] = new Fl_Value_Input - (L + 2 * WB , 2 * WB + 2 * BH, ss, BH); - general.value[29] = new Fl_Value_Input - (L + 2 * WB + ss , 2 * WB + 2 * BH, ss, BH); - general.value[30] = new Fl_Value_Input - (L + 2 * WB + 2*ss, 2 * WB + 2 * BH, ss, BH, " X"); - general.value[31] = new Fl_Value_Input - (L + 2 * WB + IW , 2 * WB + 2 * BH, 7*IW/10, BH); - - general.value[32] = new Fl_Value_Input - (L + 2 * WB , 2 * WB + 3 * BH, ss, BH); - general.value[33] = new Fl_Value_Input - (L + 2 * WB + ss , 2 * WB + 3 * BH, ss, BH); - general.value[34] = new Fl_Value_Input - (L + 2 * WB + 2*ss, 2 * WB + 3 * BH, ss, BH, " Y +"); - general.value[35] = new Fl_Value_Input - (L + 2 * WB + IW , 2 * WB + 3 * BH, 7*IW/10, BH); - - general.value[36] = new Fl_Value_Input - (L + 2 * WB , 2 * WB + 4 * BH, ss, BH); - general.value[37] = new Fl_Value_Input - (L + 2 * WB + ss , 2 * WB + 4 * BH, ss, BH); - general.value[38] = new Fl_Value_Input - (L + 2 * WB + 2*ss, 2 * WB + 4 * BH, ss, BH, " Z"); - general.value[39] = new Fl_Value_Input - (L + 2 * WB + IW , 2 * WB + 4 * BH, 7*IW/10, BH); - - for(int i = 28; i <= 39; i++){ - general.value[i]->minimum(-1.); - general.value[i]->maximum(1.); - general.value[i]->step(0.1); - general.value[i]->align(FL_ALIGN_RIGHT); - general.value[i]->when(FL_WHEN_RELEASE); - general.value[i]->callback(general_options_ok_cb); - } - - o->end(); - } { Fl_Group *o = new Fl_Group (L + WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Aspect"); @@ -1770,6 +1716,61 @@ optionWindow::optionWindow(int deltaFontSize) o->end(); } + { + Fl_Group *o = new Fl_Group + (L + WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Transfo"); + o->hide(); + + static Fl_Menu_Item menu_transform[] = { + {"None", 0, 0, 0}, + {"Scaling", 0, 0, 0}, + {0} + }; + geo.choice[3] = new Fl_Choice + (L + 2 * WB, 2 * WB + 1 * BH, IW, BH, "Main window transform"); + geo.choice[3]->menu(menu_transform); + geo.choice[3]->align(FL_ALIGN_RIGHT); + geo.choice[3]->callback(geometry_options_ok_cb, (void*)"geo_transform"); + + int ss = 2 * IW / 3 / 3 + 4; + geo.value[7] = new Fl_Value_Input + (L + 2 * WB , 2 * WB + 2 * BH, ss, BH); + geo.value[8] = new Fl_Value_Input + (L + 2 * WB + ss , 2 * WB + 2 * BH, ss, BH); + geo.value[9] = new Fl_Value_Input + (L + 2 * WB + 2*ss, 2 * WB + 2 * BH, ss, BH, " X"); + geo.value[10] = new Fl_Value_Input + (L + 2 * WB + IW , 2 * WB + 2 * BH, 7*IW/10, BH); + + geo.value[11] = new Fl_Value_Input + (L + 2 * WB , 2 * WB + 3 * BH, ss, BH); + geo.value[12] = new Fl_Value_Input + (L + 2 * WB + ss , 2 * WB + 3 * BH, ss, BH); + geo.value[13] = new Fl_Value_Input + (L + 2 * WB + 2*ss, 2 * WB + 3 * BH, ss, BH, " Y +"); + geo.value[14] = new Fl_Value_Input + (L + 2 * WB + IW , 2 * WB + 3 * BH, 7*IW/10, BH); + + geo.value[15] = new Fl_Value_Input + (L + 2 * WB , 2 * WB + 4 * BH, ss, BH); + geo.value[16] = new Fl_Value_Input + (L + 2 * WB + ss , 2 * WB + 4 * BH, ss, BH); + geo.value[17] = new Fl_Value_Input + (L + 2 * WB + 2*ss, 2 * WB + 4 * BH, ss, BH, " Z"); + geo.value[18] = new Fl_Value_Input + (L + 2 * WB + IW , 2 * WB + 4 * BH, 7*IW/10, BH); + + for(int i = 7; i <= 18; i++){ + geo.value[i]->minimum(-1.); + geo.value[i]->maximum(1.); + geo.value[i]->step(0.1); + geo.value[i]->align(FL_ALIGN_RIGHT); + geo.value[i]->when(FL_WHEN_RELEASE); + geo.value[i]->callback(geometry_options_ok_cb); + } + + o->end(); + } { Fl_Group *o = new Fl_Group (L + WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Aspect"); @@ -3402,14 +3403,14 @@ void optionWindow::activate(const char *what) general.value[27]->deactivate(); } } - else if(!strcmp(what, "general_transform")){ - if(general.choice[6]->value() == 1){ - for(int i = 28; i <= 39; i++) - general.value[i]->activate(); + else if(!strcmp(what, "geo_transform")){ + if(geo.choice[3]->value() == 1){ + for(int i = 7; i <= 18; i++) + geo.value[i]->activate(); } else{ - for(int i = 28; i <= 39; i++) - general.value[i]->deactivate(); + for(int i = 7; i <= 18; i++) + geo.value[i]->deactivate(); } } else if(!strcmp(what, "custom_range")){ diff --git a/Fltk/paletteWindow.h b/Fltk/paletteWindow.h index 3103996391..ae87d6e1c8 100644 --- a/Fltk/paletteWindow.h +++ b/Fltk/paletteWindow.h @@ -33,10 +33,10 @@ class paletteWindow : public Fl_Double_Window { return Fl_Double_Window::handle(event); } public: - paletteWindow(int w, int h, int nonmodal=false, const char *l=0) + paletteWindow(int w, int h, bool nonModal, const char *l=0) : Fl_Double_Window(w, h, l) { - if(nonmodal) set_non_modal(); + if(nonModal) set_non_modal(); } void show() { diff --git a/Fltk/partitionDialog.cpp b/Fltk/partitionDialog.cpp index 819278ba8a..4e6a425017 100644 --- a/Fltk/partitionDialog.cpp +++ b/Fltk/partitionDialog.cpp @@ -469,7 +469,7 @@ void partition_dialog() int y = 0; dlg.window = new paletteWindow - (w, h, CTX.non_modal_windows, "Partitioner Options"); + (w, h, CTX.non_modal_windows ? true : false, "Partitioner Options"); dlg.window->box(GMSH_WINDOW_BOX); dlg.window->callback((Fl_Callback *)partition_cancel_cb, &dlg); diff --git a/Fltk/pluginWindow.cpp b/Fltk/pluginWindow.cpp index 6c4f6040b7..5d1d6f3c8d 100644 --- a/Fltk/pluginWindow.cpp +++ b/Fltk/pluginWindow.cpp @@ -239,7 +239,8 @@ pluginWindow::pluginWindow(int deltaFontSize) int width = (CTX.plugin_size[0] < width0) ? width0 : CTX.plugin_size[0]; int height = (CTX.plugin_size[1] < height0) ? height0 : CTX.plugin_size[1]; - win = new paletteWindow(width, height, CTX.non_modal_windows, "Plugins"); + win = new paletteWindow + (width, height, CTX.non_modal_windows ? true : false, "Plugins"); win->box(GMSH_WINDOW_BOX); int L1 = (int)(0.3 * width), L2 = (int)(0.6 * L1); diff --git a/Fltk/projectionEditor.cpp b/Fltk/projectionEditor.cpp index df3d56c9ec..b3262fa45a 100644 --- a/Fltk/projectionEditor.cpp +++ b/Fltk/projectionEditor.cpp @@ -897,7 +897,8 @@ projectionEditor::projectionEditor() const int width = (int)(3.75 * BB), height = 24 * BH; // create all widgets (we construct this once, we never deallocate!) - _window = new paletteWindow(width, height, CTX.non_modal_windows, "Reparameterize"); + _window = new paletteWindow + (width, height, CTX.non_modal_windows ? true : false, "Reparameterize"); new Fl_Box(WB, WB + BH / 2, BB / 2, BH, "Select:"); diff --git a/Fltk/solverWindow.cpp b/Fltk/solverWindow.cpp index 2091b2f264..d888e0652a 100644 --- a/Fltk/solverWindow.cpp +++ b/Fltk/solverWindow.cpp @@ -201,7 +201,7 @@ solverWindow::solverWindow(int solverIndex, int deltaFontSize) int BBS = (width - 8 * WB) / 5; win = new paletteWindow - (width, height, CTX.non_modal_windows, "Solver"); + (width, height, CTX.non_modal_windows ? true : false, "Solver"); win->box(GMSH_WINDOW_BOX); { Fl_Tabs *o = new Fl_Tabs diff --git a/Fltk/statisticsWindow.cpp b/Fltk/statisticsWindow.cpp index 3692f4ff27..654b549afc 100644 --- a/Fltk/statisticsWindow.cpp +++ b/Fltk/statisticsWindow.cpp @@ -84,7 +84,8 @@ statisticsWindow::statisticsWindow(int deltaFontSize) int width = 26 * FL_NORMAL_SIZE; int height = 5 * WB + 18 * BH; - win = new paletteWindow(width, height, CTX.non_modal_windows, "Statistics"); + win = new paletteWindow + (width, height, CTX.non_modal_windows ? true : false, "Statistics"); win->box(GMSH_WINDOW_BOX); { Fl_Tabs *o = new Fl_Tabs(WB, WB, width - 2 * WB, height - 3 * WB - BH); diff --git a/Fltk/visibilityWindow.cpp b/Fltk/visibilityWindow.cpp index 99d7dae8b7..acf5fb751d 100644 --- a/Fltk/visibilityWindow.cpp +++ b/Fltk/visibilityWindow.cpp @@ -1049,7 +1049,7 @@ visibilityWindow::visibilityWindow(int deltaFontSize) int brw = width - 4 * WB; win = new paletteWindow - (width, height, CTX.non_modal_windows, "Visibility"); + (width, height, CTX.non_modal_windows ? true : false, "Visibility"); win->box(GMSH_WINDOW_BOX); Fl_Tabs *o = new Fl_Tabs diff --git a/Graphics/drawPost.cpp b/Graphics/drawPost.cpp index 0857df41a9..d9342403d1 100644 --- a/Graphics/drawPost.cpp +++ b/Graphics/drawPost.cpp @@ -181,9 +181,9 @@ static void applyGeneralRaise(PView *p, int numNodes, int numComp, } } -static void changeCoordinates(PView *p, int ient, int iele, int numNodes, - int numEdges, int numComp, double xyz[NMAX][3], - double val[NMAX][9]) +static void changeCoordinates(PView *p, int ient, int iele, + int numNodes, int numEdges, int numComp, + double xyz[NMAX][3], double val[NMAX][9]) { PViewOptions *opt = p->getOptions(); @@ -1297,7 +1297,7 @@ class initPView { heuristic = _estimateIfClipped(p, heuristic); return heuristic + 1000; } - public : + public: void operator () (PView *p) { // use adaptive data if available diff --git a/doc/VERSIONS.txt b/doc/VERSIONS.txt index 42ad33bd47..0f456b4fe2 100644 --- a/doc/VERSIONS.txt +++ b/doc/VERSIONS.txt @@ -1,11 +1,10 @@ -$Id: VERSIONS.txt,v 1.30 2009-01-07 10:59:20 geuzaine Exp $ +$Id: VERSIONS.txt,v 1.31 2009-01-15 00:45:11 geuzaine Exp $ 2.3.0 (?): major graphics and GUI code refactoring; new full-quad/hexa -subdivision algorithm (new option Mesh.SubdivisionAlgorithm; removed -Mesh.RecombineAlgo); improved automatic transfinite corner selection -(now also for volumes); improved visibility browser; modified arrow -size, clipping planes and transform options; many small improvements -and bug fixes all over the place. +subdivision algorithm (removed Mesh.RecombineAlgo); improved automatic +transfinite corner selection (now also for volumes); improved +visibility browser; modified arrow size, clipping planes and transform +options; many small improvements and bug fixes all over the place. 2.2.6 (Nov 21, 2008): better transfinite smoothing and automatic corner selection; fixed high order meshing crashes on Windows and diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi index 353792c197..a89e32a447 100644 --- a/doc/texinfo/gmsh.texi +++ b/doc/texinfo/gmsh.texi @@ -302,7 +302,7 @@ description of the four modules is given hereafter. @node Geometry, Mesh, Overview, Overview @section Geometry: geometrical entity definition -Gmsh uses a boundary representation (``b-rep'') to describe geometries. +Gmsh uses a boundary representation (``BRep'') to describe geometries. Models are created in a bottom-up flow by successively defining points, oriented lines (line segments, circles, ellipses, splines, @dots{}), oriented surfaces (plane surfaces, ruled surfaces, triangulated @@ -483,7 +483,7 @@ also some (a lot of?) weaknesses: @itemize @bullet @item -the b-rep approach for describing geometries can become inconvenient for +the BRep approach for describing geometries can become inconvenient for complex models; @item there is no support for Nurbs and only very limited support for trimmed diff --git a/doc/texinfo/opt_general.texi b/doc/texinfo/opt_general.texi index 582cfdc732..aa18188185 100644 --- a/doc/texinfo/opt_general.texi +++ b/doc/texinfo/opt_general.texi @@ -684,21 +684,6 @@ Disable interactive dialog windows in scripts (and use default values instead)@* Default value: @code{0}@* Saved in: @code{General.OptionsFileName} -@item General.OffsetX -Model diplay offset along X-axis (in model coordinates)@* -Default value: @code{0}@* -Saved in: @code{-} - -@item General.OffsetY -Model diplay offset along Y-axis (in model coordinates)@* -Default value: @code{0}@* -Saved in: @code{-} - -@item General.OffsetZ -Model diplay offset along Z-axis (in model coordinates)@* -Default value: @code{0}@* -Saved in: @code{-} - @item General.OptionsPositionX Horizontal position (in pixels) of the upper left corner of the option window@* Default value: @code{650}@* @@ -909,56 +894,6 @@ Fourth trackball quaternion component (used if General.Trackball=1)@* Default value: @code{1}@* Saved in: @code{-} -@item General.Transform -Transform model display coordinates (0=no, 1=scale)@* -Default value: @code{0}@* -Saved in: @code{-} - -@item General.TransformXX -Element (1,1) of the 3x3 model display transformation matrix@* -Default value: @code{1}@* -Saved in: @code{-} - -@item General.TransformXY -Element (1,2) of the 3x3 model display transformation matrix@* -Default value: @code{0}@* -Saved in: @code{-} - -@item General.TransformXZ -Element (1,3) of the 3x3 model display transformation matrix@* -Default value: @code{0}@* -Saved in: @code{-} - -@item General.TransformYX -Element (2,1) of the 3x3 model display transformation matrix@* -Default value: @code{0}@* -Saved in: @code{-} - -@item General.TransformYY -Element (2,2) of the 3x3 model display transformation matrix@* -Default value: @code{1}@* -Saved in: @code{-} - -@item General.TransformYZ -Element (2,3) of the 3x3 model display transformation matrix@* -Default value: @code{0}@* -Saved in: @code{-} - -@item General.TransformZX -Element (3,1) of the 3x3 model display transformation matrix@* -Default value: @code{0}@* -Saved in: @code{-} - -@item General.TransformZY -Element (3,2) of the 3x3 model display transformation matrix@* -Default value: @code{0}@* -Saved in: @code{-} - -@item General.TransformZZ -Element (3,3) of the 3x3 model display transformation matrix@* -Default value: @code{1}@* -Saved in: @code{-} - @item General.TranslationX X-axis translation (in model units)@* Default value: @code{0}@* diff --git a/doc/texinfo/opt_geometry.texi b/doc/texinfo/opt_geometry.texi index 2f91929830..2d50775742 100644 --- a/doc/texinfo/opt_geometry.texi +++ b/doc/texinfo/opt_geometry.texi @@ -89,6 +89,21 @@ Sew faces in STEP, IGES and BRep models@* Default value: @code{0}@* Saved in: @code{General.OptionsFileName} +@item Geometry.OffsetX +Model diplay offset along X-axis (in model coordinates)@* +Default value: @code{0}@* +Saved in: @code{-} + +@item Geometry.OffsetY +Model diplay offset along Y-axis (in model coordinates)@* +Default value: @code{0}@* +Saved in: @code{-} + +@item Geometry.OffsetZ +Model diplay offset along Z-axis (in model coordinates)@* +Default value: @code{0}@* +Saved in: @code{-} + @item Geometry.OldCircle Use old circle description (compatibility option for old Gmsh geometries)@* Default value: @code{0}@* @@ -169,6 +184,56 @@ Geometrical tolerance@* Default value: @code{1e-06}@* Saved in: @code{General.OptionsFileName} +@item Geometry.Transform +Transform model display coordinates (0=no, 1=scale)@* +Default value: @code{0}@* +Saved in: @code{-} + +@item Geometry.TransformXX +Element (1,1) of the 3x3 model display transformation matrix@* +Default value: @code{1}@* +Saved in: @code{-} + +@item Geometry.TransformXY +Element (1,2) of the 3x3 model display transformation matrix@* +Default value: @code{0}@* +Saved in: @code{-} + +@item Geometry.TransformXZ +Element (1,3) of the 3x3 model display transformation matrix@* +Default value: @code{0}@* +Saved in: @code{-} + +@item Geometry.TransformYX +Element (2,1) of the 3x3 model display transformation matrix@* +Default value: @code{0}@* +Saved in: @code{-} + +@item Geometry.TransformYY +Element (2,2) of the 3x3 model display transformation matrix@* +Default value: @code{1}@* +Saved in: @code{-} + +@item Geometry.TransformYZ +Element (2,3) of the 3x3 model display transformation matrix@* +Default value: @code{0}@* +Saved in: @code{-} + +@item Geometry.TransformZX +Element (3,1) of the 3x3 model display transformation matrix@* +Default value: @code{0}@* +Saved in: @code{-} + +@item Geometry.TransformZY +Element (3,2) of the 3x3 model display transformation matrix@* +Default value: @code{0}@* +Saved in: @code{-} + +@item Geometry.TransformZZ +Element (3,3) of the 3x3 model display transformation matrix@* +Default value: @code{1}@* +Saved in: @code{-} + @item Geometry.Volumes Display geometry volumes? (not implemented yet)@* Default value: @code{0}@* -- GitLab