diff --git a/Common/Context.h b/Common/Context.h index 09b62c8314da48f970456566a8eea642d40a4b54..9ab1a0ae9629970885590777db95763d10b3f0bc 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 b7d60ff987c8a0edf5ba6b625a4df41e52e10135..983c1a746d55032cfdf9c3a772f577c362928719 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 8d64440fcb19400ba29fd7a7fd7a2541be3fead6..5c18e1456a4c403a06623b4088029715f35374e6 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 5fba73b448cf9786fc18d859d5ca26b593c67c7e..3e9d961dfcc442eb7f173db550ec54c5e7cc870d 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 b0a768294b32d4096d3f18bbbfad9891b02c3034..d43889ea3cb777080bb884d7abc7e294ab3f5632 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 f26f74ab87865af7bbe093989ca86106b2fc1bba..187fa37db878483b7c5e7e2fc235ec7bc7c10b2f 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 5962bd5b0d2fe2a4df69359cead8bdab722c15f4..36f504d04a9089e03edc4626263f92727f07cbbb 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 44751d8f8842f1d99e911f867f7559ba8c27a150..44cf5c8c7c02ae10d1cd520d71772f3021974eab 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 d8e112f7a5689b8a5b8d6fa7b1b989a798c6d9e2..0de9c08749a052b3d5b5b13676f807989b35864a 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 fa00aecace54e19a31885ba421e894caa22f3e1e..12500f1c78eec3b7e503cd6eea7b51194bf9da88 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 195a70e6b61eb5c77f73c1b557073d396d366f2b..b663448066567bfc1b0285d0823de05e52ee72e2 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 94af87076b97e2a40875ff18aa954c4f865a5bf6..33cf69d052773001d11131475579aea23b5a557b 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 ce7e31a32ac4a0327b8d3c3d9f97c34d4bde6c5f..8df516bb7f8e9a9dcbec07162ea5d94bcbc93acd 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 41d2a6fdb745b0c77dfb3da91a41823e82a5af89..e47f34a54cfa5efb4df34a343096e9c3c9ed46c5 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 b5a74238557e1c7a2134e1befb9aa37ab20e0626..7155f44285d9d3eac0c99200d053a7633e0c166c 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 3103996391c86245d3355d2bb360bbe8b1ffe0f8..ae87d6e1c8a6b4278077370ff8f0a70d9aecfabc 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 819278ba8adb7239449b8d17d306d6adb7021ffd..4e6a42501738d6849acc1db840efa009d9728aaa 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 6c4f6040b78d5924ba17a383c5247cc06013e2c3..5d1d6f3c8ddbafac7efad611a48a9c51fbd1c578 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 df3d56c9ec0c961fc194be22b5d093f5e55d5583..b3262fa45a9e72881043681698b63edc81697200 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 2091b2f26444a293d2b62416fe59849955c541b1..d888e0652a0340ace60adfc865c76c4bce1ae71f 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 3692f4ff2775c9fa4b5cf70518112a9a9644c410..654b549afce57b2ee9b4876057238a607d7057c0 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 99d7dae8b76d4aa6a1772df3b3689697a41932c0..acf5fb751d3f322868b67a0de8a154ecccb69383 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 0857df41a99cfc78b420a55794fc58c7fb5dc1ac..d9342403d159a18269f7a737c22ac7e29109b914 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 42ad33bd470060406152e903f54b7ce1841849f5..0f456b4fe2fc5a4bfd6316c3f28eac73258c5309 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 353792c197fcf7ae6fec45cf995d77dbaf10110f..a89e32a44728707470b8db5e916de3e93da56c65 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 582cfdc732ccf22e17bed8d5cbb25c772d51966b..aa181881850c8170356f6e9abaa50dc58e5014a6 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 2f919298304dcd1b0edacbf67030f0210fc158ef..2d50775742bf8a77ec6306d12e3f3b8aab7ba635 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}@*