diff --git a/Fltk/FlGui.cpp b/Fltk/FlGui.cpp index 6956a5be85c08e97df424f6bf26d6061ec92a720..a1bd54eb76f340557c9693c27a086c3010fff3c7 100644 --- a/Fltk/FlGui.cpp +++ b/Fltk/FlGui.cpp @@ -312,6 +312,11 @@ FlGui::FlGui(int argc, char **argv) graph.push_back(g); } + // create fullscreen window + fullscreen = new openglWindow(100, 100, 100, 100); + fullscreen->mode(FL_RGB | FL_DEPTH | (CTX::instance()->db ? FL_DOUBLE : FL_SINGLE)); + fullscreen->end(); + options = new optionWindow(CTX::instance()->deltaFontSize); fields = new fieldWindow(CTX::instance()->deltaFontSize); plugins = new pluginWindow(CTX::instance()->deltaFontSize); @@ -921,7 +926,8 @@ void redraw_cb(Fl_Widget *w, void *data) void window_cb(Fl_Widget *w, void *data) { - static int oldx = 0, oldy = 0, oldw = 0, oldh = 0, zoom = 1; + static int oldx = 0, oldy = 0, oldw = 0, oldh = 0, zoom = 0, fullscreen = 0; + std::string str((const char*)data); if(str == "minimize"){ @@ -946,30 +952,37 @@ void window_cb(Fl_Widget *w, void *data) FlGui::instance()->stats->win->iconize(); } else if(str == "zoom"){ - if(zoom){ + if(!zoom){ oldx = FlGui::instance()->graph[0]->getWindow()->x(); oldy = FlGui::instance()->graph[0]->getWindow()->y(); oldw = FlGui::instance()->graph[0]->getWindow()->w(); oldh = FlGui::instance()->graph[0]->getWindow()->h(); -//#define FS -#ifndef FS FlGui::instance()->graph[0]->getWindow()->resize(Fl::x(), Fl::y(), Fl::w(), Fl::h()); - FlGui::instance()->graph[0]->hideMessages(); - FlGui::instance()->check(); -#else - FlGui::instance()->graph[0]->getWindow()->fullscreen(); - FlGui::instance()->graph[0]->hideMessages(); -#endif - zoom = 0; + zoom = 1; } else{ -#ifndef FS FlGui::instance()->graph[0]->getWindow()->resize(oldx, oldy, oldw, oldh); - FlGui::instance()->check(); -#else - FlGui::instance()->graph[0]->getWindow()->fullscreen_off(); -#endif - zoom = 1; + zoom = 0; + } + } + else if(str == "fullscreen"){ + if(!fullscreen){ + FlGui::instance()->fullscreen->show(); + FlGui::instance()->fullscreen->getDrawContext()->copyViewAttributes + (FlGui::instance()->getCurrentOpenglWindow()->getDrawContext()); + openglWindow::setLastHandled(FlGui::instance()->fullscreen); + FlGui::instance()->fullscreen->fullscreen(); + drawContext::global()->draw(); + fullscreen = 1; + } + else{ + FlGui::instance()->fullscreen->fullscreen_off(); + FlGui::instance()->graph[0]->gl[0]->getDrawContext()->copyViewAttributes + (FlGui::instance()->getCurrentOpenglWindow()->getDrawContext()); + openglWindow::setLastHandled(FlGui::instance()->graph[0]->gl[0]); + FlGui::instance()->fullscreen->hide(); + drawContext::global()->draw(); + fullscreen = 0; } } else if(str == "front"){ @@ -1017,6 +1030,6 @@ void FlGui::rebuildTree() void FlGui::openModule(const std::string &name) { - if(!onelab->isManuallyClosed("0Gmsh modules/" + name)) - onelab->openTreeItem("0Gmsh modules/" + name); + if(!onelab->isManuallyClosed("0Modules/" + name)) + onelab->openTreeItem("0Modules/" + name); } diff --git a/Fltk/FlGui.h b/Fltk/FlGui.h index b397dbdd851c7b49bfaac2ef720eb32147780299..060a28f1448f26f00e3d3d1e5a18876fc121f95e 100644 --- a/Fltk/FlGui.h +++ b/Fltk/FlGui.h @@ -65,6 +65,7 @@ class FlGui{ meshContextWindow *meshContext; helpWindow *help; onelabGroup *onelab; + openglWindow *fullscreen; public: FlGui(int argc, char **argv); ~FlGui(){} diff --git a/Fltk/drawContextFltk.h b/Fltk/drawContextFltk.h index d3bd00be3ef15ff3f8c5a1cc401bb1b5f370d1ff..5dcacbfaa164a3896dbd19bbf5e313ac78c47f0e 100644 --- a/Fltk/drawContextFltk.h +++ b/Fltk/drawContextFltk.h @@ -19,13 +19,20 @@ class drawContextFltk : public drawContextGlobal{ void draw() { if(!FlGui::available()) return; - for(unsigned int i = 0; i < FlGui::instance()->graph.size(); i++){ - for(unsigned int j = 0; j < FlGui::instance()->graph[i]->gl.size(); j++){ - FlGui::instance()->graph[i]->gl[j]->make_current(); - FlGui::instance()->graph[i]->gl[j]->redraw(); - // to initialize the camera distance from model - drawContext * ctx = FlGui::instance()->graph[i]->gl[j]->getDrawContext(); - ctx->camera.update(); + if(FlGui::instance()->fullscreen->shown()){ + FlGui::instance()->fullscreen->make_current(); + FlGui::instance()->fullscreen->redraw(); + } + else{ + for(unsigned int i = 0; i < FlGui::instance()->graph.size(); i++){ + for(unsigned int j = 0; j < FlGui::instance()->graph[i]->gl.size(); j++){ + FlGui::instance()->graph[i]->gl[j]->make_current(); + FlGui::instance()->graph[i]->gl[j]->redraw(); + // FIXME: I don't think this should be done here CG + // to initialize the camera distance from model + drawContext *ctx = FlGui::instance()->graph[i]->gl[j]->getDrawContext(); + ctx->camera.update(); + } } } FlGui::instance()->check(); diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp index 4830530ad4fbfb50cf6e6fa44a9eac2ab51cdec2..137bf264b4107dce0fc6745d9fac27a66f6e235a 100644 --- a/Fltk/graphicWindow.cpp +++ b/Fltk/graphicWindow.cpp @@ -1960,7 +1960,8 @@ static Fl_Menu_Item bar_table[] = { {"Split Vertically", 0, (Fl_Callback *)file_window_cb, (void*)"split_v"}, {"Unsplit", 0, (Fl_Callback *)file_window_cb, (void*)"split_u", FL_MENU_DIVIDER}, {"Minimize", FL_CTRL+'m', (Fl_Callback *)window_cb, (void*)"minimize"}, - {"Zoom", 0, (Fl_Callback *)window_cb, (void*)"zoom", FL_MENU_DIVIDER}, + {"Zoom", 0, (Fl_Callback *)window_cb, (void*)"zoom"}, + {"Fullscreen", FL_CTRL+'f', (Fl_Callback *)window_cb, (void*)"fullscreen", FL_MENU_DIVIDER}, {"Attach/Detach Menu", FL_CTRL+'d', (Fl_Callback *)attach_detach_menu_cb, 0, FL_MENU_DIVIDER}, {"Bring All to Front", 0, (Fl_Callback *)window_cb, (void*)"front"}, {0}, @@ -2022,7 +2023,8 @@ static Fl_Menu_Item sysbar_table[] = { {"Split Vertically", 0, (Fl_Callback *)file_window_cb, (void*)"split_v"}, {"Unsplit", 0, (Fl_Callback *)file_window_cb, (void*)"split_u", FL_MENU_DIVIDER}, {"Minimize", FL_META+'m', (Fl_Callback *)window_cb, (void*)"minimize"}, - {"Zoom", 0, (Fl_Callback *)window_cb, (void*)"zoom", FL_MENU_DIVIDER}, + {"Zoom", 0, (Fl_Callback *)window_cb, (void*)"zoom"}, + {"Fullscreen", FL_META+'f', (Fl_Callback *)window_cb, (void*)"fullscreen", FL_MENU_DIVIDER}, {"Attach/Detach Menu", FL_META+'d', (Fl_Callback *)attach_detach_menu_cb, 0, FL_MENU_DIVIDER}, {"Bring All to Front", 0, (Fl_Callback *)window_cb, (void*)"front"}, {0}, @@ -2482,7 +2484,7 @@ graphicWindow::graphicWindow(bool main, int numTiles, bool detachedMenu) if(height > Fl::h()){ height = Fl::h(); glheight = height - mh - mheight - sh; - CTX::instance()->glSize[1] = glheight; + CTX::instance()->glSize[1] = glheight + mheight; } int twidth = (main && !detachedMenu) ? 14 * sw : 0; @@ -2492,7 +2494,7 @@ graphicWindow::graphicWindow(bool main, int numTiles, bool detachedMenu) if(width > Fl::w()){ width = Fl::w(); glwidth = width - twidth; - CTX::instance()->glSize[0] = glwidth; + CTX::instance()->glSize[0] = glwidth + twidth; } // the graphic window should be a "normal" window (neither modal nor @@ -3137,189 +3139,189 @@ typedef struct{ } menuItem; static menuItem static_modules[] = { - {"0Gmsh modules/Geometry/Elementary entities/Add/Parameter", + {"0Modules/Geometry/Elementary entities/Add/Parameter", (Fl_Callback *)geometry_elementary_add_new_cb, (void*)"Parameter"} , - {"0Gmsh modules/Geometry/Elementary entities/Add/Point", + {"0Modules/Geometry/Elementary entities/Add/Point", (Fl_Callback *)geometry_elementary_add_new_cb, (void*)"Point"} , - {"0Gmsh modules/Geometry/Elementary entities/Add/Straight line", + {"0Modules/Geometry/Elementary entities/Add/Straight line", (Fl_Callback *)geometry_elementary_add_new_cb, (void*)"Line"} , - {"0Gmsh modules/Geometry/Elementary entities/Add/Spline", + {"0Modules/Geometry/Elementary entities/Add/Spline", (Fl_Callback *)geometry_elementary_add_new_cb, (void*)"Spline"} , - {"0Gmsh modules/Geometry/Elementary entities/Add/B-Spline", + {"0Modules/Geometry/Elementary entities/Add/B-Spline", (Fl_Callback *)geometry_elementary_add_new_cb, (void*)"BSpline"} , - {"0Gmsh modules/Geometry/Elementary entities/Add/Circle arc", + {"0Modules/Geometry/Elementary entities/Add/Circle arc", (Fl_Callback *)geometry_elementary_add_new_cb, (void*)"Circle"} , - {"0Gmsh modules/Geometry/Elementary entities/Add/Ellipse arc", + {"0Modules/Geometry/Elementary entities/Add/Ellipse arc", (Fl_Callback *)geometry_elementary_add_new_cb, (void*)"Ellipse"} , - {"0Gmsh modules/Geometry/Elementary entities/Add/Plane surface", + {"0Modules/Geometry/Elementary entities/Add/Plane surface", (Fl_Callback *)geometry_elementary_add_new_cb, (void*)"Plane Surface"} , - {"0Gmsh modules/Geometry/Elementary entities/Add/Ruled surface", + {"0Modules/Geometry/Elementary entities/Add/Ruled surface", (Fl_Callback *)geometry_elementary_add_new_cb, (void*)"Ruled Surface"} , - {"0Gmsh modules/Geometry/Elementary entities/Add/Volume", + {"0Modules/Geometry/Elementary entities/Add/Volume", (Fl_Callback *)geometry_elementary_add_new_cb, (void*)"Volume"} , - {"0Gmsh modules/Geometry/Elementary entities/Translate/Point", + {"0Modules/Geometry/Elementary entities/Translate/Point", (Fl_Callback *)geometry_elementary_translate_cb, (void*)"Point"} , - {"0Gmsh modules/Geometry/Elementary entities/Translate/Line", + {"0Modules/Geometry/Elementary entities/Translate/Line", (Fl_Callback *)geometry_elementary_translate_cb, (void*)"Line"} , - {"0Gmsh modules/Geometry/Elementary entities/Translate/Surface", + {"0Modules/Geometry/Elementary entities/Translate/Surface", (Fl_Callback *)geometry_elementary_translate_cb, (void*)"Surface"} , - {"0Gmsh modules/Geometry/Elementary entities/Translate/Volume", + {"0Modules/Geometry/Elementary entities/Translate/Volume", (Fl_Callback *)geometry_elementary_translate_cb, (void*)"Volume"} , - {"0Gmsh modules/Geometry/Elementary entities/Translate/Duplicate point", + {"0Modules/Geometry/Elementary entities/Translate/Duplicate point", (Fl_Callback *)geometry_elementary_add_translate_cb, (void*)"Point"} , - {"0Gmsh modules/Geometry/Elementary entities/Translate/Duplicate line", + {"0Modules/Geometry/Elementary entities/Translate/Duplicate line", (Fl_Callback *)geometry_elementary_add_translate_cb, (void*)"Line"} , - {"0Gmsh modules/Geometry/Elementary entities/Translate/Duplicate surface", + {"0Modules/Geometry/Elementary entities/Translate/Duplicate surface", (Fl_Callback *)geometry_elementary_add_translate_cb, (void*)"Surface"} , - {"0Gmsh modules/Geometry/Elementary entities/Translate/Duplicate volume", + {"0Modules/Geometry/Elementary entities/Translate/Duplicate volume", (Fl_Callback *)geometry_elementary_add_translate_cb, (void*)"Volume"} , - {"0Gmsh modules/Geometry/Elementary entities/Translate/Extrude point", + {"0Modules/Geometry/Elementary entities/Translate/Extrude point", (Fl_Callback *)geometry_elementary_extrude_translate_cb, (void*)"Point"} , - {"0Gmsh modules/Geometry/Elementary entities/Translate/Extrude line", + {"0Modules/Geometry/Elementary entities/Translate/Extrude line", (Fl_Callback *)geometry_elementary_extrude_translate_cb, (void*)"Line"} , - {"0Gmsh modules/Geometry/Elementary entities/Translate/Extrude surface", + {"0Modules/Geometry/Elementary entities/Translate/Extrude surface", (Fl_Callback *)geometry_elementary_extrude_translate_cb, (void*)"Surface"} , - {"0Gmsh modules/Geometry/Elementary entities/Rotate/Point", + {"0Modules/Geometry/Elementary entities/Rotate/Point", (Fl_Callback *)geometry_elementary_rotate_cb, (void*)"Point"} , - {"0Gmsh modules/Geometry/Elementary entities/Rotate/Line", + {"0Modules/Geometry/Elementary entities/Rotate/Line", (Fl_Callback *)geometry_elementary_rotate_cb, (void*)"Line"} , - {"0Gmsh modules/Geometry/Elementary entities/Rotate/Surface", + {"0Modules/Geometry/Elementary entities/Rotate/Surface", (Fl_Callback *)geometry_elementary_rotate_cb, (void*)"Surface"} , - {"0Gmsh modules/Geometry/Elementary entities/Rotate/Volume", + {"0Modules/Geometry/Elementary entities/Rotate/Volume", (Fl_Callback *)geometry_elementary_rotate_cb, (void*)"Volume"} , - {"0Gmsh modules/Geometry/Elementary entities/Rotate/Duplicate point", + {"0Modules/Geometry/Elementary entities/Rotate/Duplicate point", (Fl_Callback *)geometry_elementary_add_rotate_cb, (void*)"Point"} , - {"0Gmsh modules/Geometry/Elementary entities/Rotate/Duplicate line", + {"0Modules/Geometry/Elementary entities/Rotate/Duplicate line", (Fl_Callback *)geometry_elementary_add_rotate_cb, (void*)"Line"} , - {"0Gmsh modules/Geometry/Elementary entities/Rotate/Duplicate surface", + {"0Modules/Geometry/Elementary entities/Rotate/Duplicate surface", (Fl_Callback *)geometry_elementary_add_rotate_cb, (void*)"Surface"} , - {"0Gmsh modules/Geometry/Elementary entities/Rotate/Duplicate volume", + {"0Modules/Geometry/Elementary entities/Rotate/Duplicate volume", (Fl_Callback *)geometry_elementary_add_rotate_cb, (void*)"Volume"} , - {"0Gmsh modules/Geometry/Elementary entities/Rotate/Extrude point", + {"0Modules/Geometry/Elementary entities/Rotate/Extrude point", (Fl_Callback *)geometry_elementary_extrude_rotate_cb, (void*)"Point"} , - {"0Gmsh modules/Geometry/Elementary entities/Rotate/Extrude line", + {"0Modules/Geometry/Elementary entities/Rotate/Extrude line", (Fl_Callback *)geometry_elementary_extrude_rotate_cb, (void*)"Line"} , - {"0Gmsh modules/Geometry/Elementary entities/Rotate/Extrude surface", + {"0Modules/Geometry/Elementary entities/Rotate/Extrude surface", (Fl_Callback *)geometry_elementary_extrude_rotate_cb, (void*)"Surface"} , - {"0Gmsh modules/Geometry/Elementary entities/Scale/Point", + {"0Modules/Geometry/Elementary entities/Scale/Point", (Fl_Callback *)geometry_elementary_scale_cb, (void*)"Point"} , - {"0Gmsh modules/Geometry/Elementary entities/Scale/Line", + {"0Modules/Geometry/Elementary entities/Scale/Line", (Fl_Callback *)geometry_elementary_scale_cb, (void*)"Line"} , - {"0Gmsh modules/Geometry/Elementary entities/Scale/Surface", + {"0Modules/Geometry/Elementary entities/Scale/Surface", (Fl_Callback *)geometry_elementary_scale_cb, (void*)"Surface"} , - {"0Gmsh modules/Geometry/Elementary entities/Scale/Volume", + {"0Modules/Geometry/Elementary entities/Scale/Volume", (Fl_Callback *)geometry_elementary_scale_cb, (void*)"Volume"} , - {"0Gmsh modules/Geometry/Elementary entities/Scale/Duplicate point", + {"0Modules/Geometry/Elementary entities/Scale/Duplicate point", (Fl_Callback *)geometry_elementary_add_scale_cb, (void*)"Point"} , - {"0Gmsh modules/Geometry/Elementary entities/Scale/Duplicate line", + {"0Modules/Geometry/Elementary entities/Scale/Duplicate line", (Fl_Callback *)geometry_elementary_add_scale_cb, (void*)"Line"} , - {"0Gmsh modules/Geometry/Elementary entities/Scale/Duplicate surface", + {"0Modules/Geometry/Elementary entities/Scale/Duplicate surface", (Fl_Callback *)geometry_elementary_add_scale_cb, (void*)"Surface"} , - {"0Gmsh modules/Geometry/Elementary entities/Scale/Duplicate volume", + {"0Modules/Geometry/Elementary entities/Scale/Duplicate volume", (Fl_Callback *)geometry_elementary_add_scale_cb, (void*)"Volume"} , - {"0Gmsh modules/Geometry/Elementary entities/Symmetry/Point", + {"0Modules/Geometry/Elementary entities/Symmetry/Point", (Fl_Callback *)geometry_elementary_symmetry_cb, (void*)"Point"} , - {"0Gmsh modules/Geometry/Elementary entities/Symmetry/Line", + {"0Modules/Geometry/Elementary entities/Symmetry/Line", (Fl_Callback *)geometry_elementary_symmetry_cb, (void*)"Line"} , - {"0Gmsh modules/Geometry/Elementary entities/Symmetry/Surface", + {"0Modules/Geometry/Elementary entities/Symmetry/Surface", (Fl_Callback *)geometry_elementary_symmetry_cb, (void*)"Surface"} , - {"0Gmsh modules/Geometry/Elementary entities/Symmetry/Volume", + {"0Modules/Geometry/Elementary entities/Symmetry/Volume", (Fl_Callback *)geometry_elementary_symmetry_cb, (void*)"Volume"} , - {"0Gmsh modules/Geometry/Elementary entities/Symmetry/Duplicate point", + {"0Modules/Geometry/Elementary entities/Symmetry/Duplicate point", (Fl_Callback *)geometry_elementary_add_symmetry_cb, (void*)"Point"} , - {"0Gmsh modules/Geometry/Elementary entities/Symmetry/Duplicate line", + {"0Modules/Geometry/Elementary entities/Symmetry/Duplicate line", (Fl_Callback *)geometry_elementary_add_symmetry_cb, (void*)"Line"} , - {"0Gmsh modules/Geometry/Elementary entities/Symmetry/Duplicate surface", + {"0Modules/Geometry/Elementary entities/Symmetry/Duplicate surface", (Fl_Callback *)geometry_elementary_add_symmetry_cb, (void*)"Surface"} , - {"0Gmsh modules/Geometry/Elementary entities/Symmetry/Duplicate volume", + {"0Modules/Geometry/Elementary entities/Symmetry/Duplicate volume", (Fl_Callback *)geometry_elementary_add_symmetry_cb, (void*)"Volume"} , - {"0Gmsh modules/Geometry/Elementary entities/Split/Line", + {"0Modules/Geometry/Elementary entities/Split/Line", (Fl_Callback *)geometry_elementary_split_cb,(void*)"Line"}, - {"0Gmsh modules/Geometry/Elementary entities/Delete/Point", + {"0Modules/Geometry/Elementary entities/Delete/Point", (Fl_Callback *)geometry_elementary_delete_cb, (void*)"Point"} , - {"0Gmsh modules/Geometry/Elementary entities/Delete/Line", + {"0Modules/Geometry/Elementary entities/Delete/Line", (Fl_Callback *)geometry_elementary_delete_cb, (void*)"Line"} , - {"0Gmsh modules/Geometry/Elementary entities/Delete/Surface", + {"0Modules/Geometry/Elementary entities/Delete/Surface", (Fl_Callback *)geometry_elementary_delete_cb, (void*)"Surface"} , - {"0Gmsh modules/Geometry/Elementary entities/Delete/Volume", + {"0Modules/Geometry/Elementary entities/Delete/Volume", (Fl_Callback *)geometry_elementary_delete_cb, (void*)"Volume"} , - {"0Gmsh modules/Geometry/Physical groups/Add/Point", + {"0Modules/Geometry/Physical groups/Add/Point", (Fl_Callback *)geometry_physical_add_cb, (void*)"Point" } , - {"0Gmsh modules/Geometry/Physical groups/Add/Line", + {"0Modules/Geometry/Physical groups/Add/Line", (Fl_Callback *)geometry_physical_add_cb, (void*)"Line" } , - {"0Gmsh modules/Geometry/Physical groups/Add/Surface", + {"0Modules/Geometry/Physical groups/Add/Surface", (Fl_Callback *)geometry_physical_add_cb, (void*)"Surface" } , - {"0Gmsh modules/Geometry/Physical groups/Add/Volume", + {"0Modules/Geometry/Physical groups/Add/Volume", (Fl_Callback *)geometry_physical_add_cb, (void*)"Volume" } , - {"0Gmsh modules/Geometry/Coherence", + {"0Modules/Geometry/Coherence", (Fl_Callback *)geometry_elementary_coherence_cb} , - {"0Gmsh modules/Geometry/Reload", + {"0Modules/Geometry/Reload", (Fl_Callback *)geometry_reload_cb} , - {"0Gmsh modules/Geometry/Edit file", + {"0Modules/Geometry/Edit file", (Fl_Callback *)geometry_edit_cb} , - {"0Gmsh modules/Mesh/Define/Size fields", + {"0Modules/Mesh/Define/Size fields", (Fl_Callback *)field_cb}, - {"0Gmsh modules/Mesh/Define/Element size at points", + {"0Modules/Mesh/Define/Element size at points", (Fl_Callback *)mesh_define_length_cb } , - {"0Gmsh modules/Mesh/Define/Embedded points", + {"0Modules/Mesh/Define/Embedded points", (Fl_Callback *)mesh_define_embedded_cb, (void*)"point" } , - {"0Gmsh modules/Mesh/Define/Recombine", + {"0Modules/Mesh/Define/Recombine", (Fl_Callback *)mesh_define_recombine_cb } , - {"0Gmsh modules/Mesh/Define/Transfinite/Line", + {"0Modules/Mesh/Define/Transfinite/Line", (Fl_Callback *)mesh_define_transfinite_line_cb} , - {"0Gmsh modules/Mesh/Define/Transfinite/Surface", + {"0Modules/Mesh/Define/Transfinite/Surface", (Fl_Callback *)mesh_define_transfinite_surface_cb} , - {"0Gmsh modules/Mesh/Define/Transfinite/Volume", + {"0Modules/Mesh/Define/Transfinite/Volume", (Fl_Callback *)mesh_define_transfinite_volume_cb} , - {"0Gmsh modules/Mesh/Define/Compound/Line", + {"0Modules/Mesh/Define/Compound/Line", (Fl_Callback *)mesh_define_compound_entity_cb, (void*)"Line"} , - {"0Gmsh modules/Mesh/Define/Compound/Surface", + {"0Modules/Mesh/Define/Compound/Surface", (Fl_Callback *)mesh_define_compound_entity_cb, (void*)"Surface"} , - {"0Gmsh modules/Mesh/Define/Compound/Volume", + {"0Modules/Mesh/Define/Compound/Volume", (Fl_Callback *)mesh_define_compound_entity_cb, (void*)"Volume"} , - {"0Gmsh modules/Mesh/1D", + {"0Modules/Mesh/1D", (Fl_Callback *)mesh_1d_cb} , - {"0Gmsh modules/Mesh/2D", + {"0Modules/Mesh/2D", (Fl_Callback *)mesh_2d_cb} , - {"0Gmsh modules/Mesh/3D", + {"0Modules/Mesh/3D", (Fl_Callback *)mesh_3d_cb} , - {"0Gmsh modules/Mesh/Optimize 3D", + {"0Modules/Mesh/Optimize 3D", (Fl_Callback *)mesh_optimize_cb} , #if defined(HAVE_NETGEN) - {"0Gmsh modules/Mesh/Optimize 3D (Netgen)", + {"0Modules/Mesh/Optimize 3D (Netgen)", (Fl_Callback *)mesh_optimize_netgen_cb} , #endif - {"0Gmsh modules/Mesh/Set order 1", + {"0Modules/Mesh/Set order 1", (Fl_Callback *)mesh_degree_cb, (void*)1}, - {"0Gmsh modules/Mesh/Set order 2", + {"0Modules/Mesh/Set order 2", (Fl_Callback *)mesh_degree_cb, (void*)2}, - {"0Gmsh modules/Mesh/Set order 3", + {"0Modules/Mesh/Set order 3", (Fl_Callback *)mesh_degree_cb, (void*)3}, - {"0Gmsh modules/Mesh/Optimize high order", + {"0Modules/Mesh/Optimize high order", (Fl_Callback *)highordertools_cb}, - {"0Gmsh modules/Mesh/Inspect", + {"0Modules/Mesh/Inspect", (Fl_Callback *)mesh_inspect_cb} , - {"0Gmsh modules/Mesh/Refine by splitting", + {"0Modules/Mesh/Refine by splitting", (Fl_Callback *)mesh_refine_cb} , #if defined(HAVE_METIS) || defined(HAVE_CHACO) - {"0Gmsh modules/Mesh/Partition", + {"0Modules/Mesh/Partition", (Fl_Callback *)mesh_partition_cb} , #endif - {"0Gmsh modules/Mesh/Reclassify 2D", + {"0Modules/Mesh/Reclassify 2D", (Fl_Callback *)mesh_classify_cb} , #if defined(HAVE_FOURIER_MODEL) - {"0Gmsh modules/Mesh/Reparameterize 2D", + {"0Modules/Mesh/Reparameterize 2D", (Fl_Callback *)mesh_parameterize_cb} , #endif - {"0Gmsh modules/Mesh/Delete/Elements", + {"0Modules/Mesh/Delete/Elements", (Fl_Callback *)mesh_delete_parts_cb, (void*)"elements"} , - {"0Gmsh modules/Mesh/Delete/Lines", + {"0Modules/Mesh/Delete/Lines", (Fl_Callback *)mesh_delete_parts_cb, (void*)"lines"} , - {"0Gmsh modules/Mesh/Delete/Surfaces", + {"0Modules/Mesh/Delete/Surfaces", (Fl_Callback *)mesh_delete_parts_cb, (void*)"surfaces"} , - {"0Gmsh modules/Mesh/Delete/Volumes", + {"0Modules/Mesh/Delete/Volumes", (Fl_Callback *)mesh_delete_parts_cb, (void*)"volumes"} , - {"0Gmsh modules/Mesh/Save", + {"0Modules/Mesh/Save", (Fl_Callback *)mesh_save_cb} , }; @@ -3334,7 +3336,7 @@ void onelabGroup::_addGmshMenus() // add dynamic solver module items for(int i = 0; i < 5; i++){ std::string name = opt_solver_name(i, GMSH_GET, ""); - if(name.size()) _addMenu("0Gmsh modules/Solver/" + name, solver_cb, (void*)i); + if(name.size()) _addMenu("0Modules/Solver/" + name, solver_cb, (void*)i); } // add dynamic post-processing module items @@ -3345,7 +3347,7 @@ void onelabGroup::_addGmshMenus() static bool first = true; if(first){ first = false; - Fl_Tree_Item *n0 = _tree->find_item("0Gmsh modules"); + Fl_Tree_Item *n0 = _tree->find_item("0Modules"); for(Fl_Tree_Item *n = n0; n; n = n->next()){ if(!n->is_root() && n->has_children() && n->depth() > 1) n->close(); @@ -3356,7 +3358,7 @@ void onelabGroup::_addGmshMenus() std::set<std::string> onelabGroup::_getClosedGmshMenus() { std::set<std::string> closed; - Fl_Tree_Item *n0 = _tree->find_item("0Gmsh modules"); + Fl_Tree_Item *n0 = _tree->find_item("0Modules"); for(Fl_Tree_Item *n = n0; n; n = n->next()){ if(!n->is_root() && n->has_children() && n->is_close()){ char path[1024]; diff --git a/Fltk/inputRange.h b/Fltk/inputRange.h index f89fad6d42c010800fe67b21951d03d2fac7eb51..c3ba15453eba1b7e7bc98af6a9a8396916f5fbfa 100644 --- a/Fltk/inputRange.h +++ b/Fltk/inputRange.h @@ -277,7 +277,7 @@ class inputRange : public Fl_Group { _loop_butt->label("@-1gmsh_rotate"); _loop_butt->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE); _loop_butt->callback(_loop_butt_cb, this); - _loop_butt->tooltip("Loop over range when computing"); + _loop_butt->tooltip("Loop over range (loop level 1, 2 or 3)"); _graph_butt = new Fl_Button(x + input_w + dot_w + loop_w, y, graph_w, h); _graph_butt->label("@-1gmsh_graph"); diff --git a/Fltk/onelabGroup.cpp b/Fltk/onelabGroup.cpp index 6e683df5677d9b87f35f283ab9d996ece0da612a..d02697ce01432af217871426cb42ae7758867129 100644 --- a/Fltk/onelabGroup.cpp +++ b/Fltk/onelabGroup.cpp @@ -923,7 +923,7 @@ void onelabGroup::_addMenu(const std::string &path, Fl_Callback *callback, void void onelabGroup::_addViewMenu(int num) { std::ostringstream path; - path << "0Gmsh modules/Post-processing/View" << num; + path << "0Modules/Post-processing/View" << num; Fl_Tree_Item *n = _tree->add(path.str().c_str()); int ww = _baseWidth - (n->depth() + 1) * _indent; _tree->begin(); @@ -936,7 +936,7 @@ void onelabGroup::_addViewMenu(int num) viewButton *onelabGroup::getViewButton(int num) { char tmp[256]; - sprintf(tmp, "0Gmsh modules/Post-processing/View%d", num); + sprintf(tmp, "0Modules/Post-processing/View%d", num); Fl_Tree_Item *n = _tree->find_item(tmp); if(n) return (viewButton*)n->widget(); return 0; diff --git a/Fltk/optionWindow.cpp b/Fltk/optionWindow.cpp index deb8dd037e0707420c956e5680a98de9664834ab..f8d51c4fafea39e9be6350ce50f68ad44b1779f5 100644 --- a/Fltk/optionWindow.cpp +++ b/Fltk/optionWindow.cpp @@ -3306,7 +3306,7 @@ optionWindow::optionWindow(int deltaFontSize) view.value[63]->callback(view_options_ok_cb); view.choice[10] = new Fl_Choice - (L + 2 * WB, 2 * WB + 9 * BH, IW, BH, "Data source"); + (L + 2 * WB, 2 * WB + 9 * BH, IW, BH, "Data source for vector fields"); view.choice[10]->align(FL_ALIGN_RIGHT); view.choice[10]->add("Self"); view.choice[10]->callback(view_options_ok_cb); diff --git a/Graphics/drawContext.h b/Graphics/drawContext.h index b3f8db7fd1ae4a0265a7937e7037fee528b503d2..ff1c1fd4d5b1335963968c319528d9b7cc0cd89b 100644 --- a/Graphics/drawContext.h +++ b/Graphics/drawContext.h @@ -127,20 +127,20 @@ class drawContext { public: drawContext(drawTransform *transform=0); ~drawContext(); - void copyViewAttributes(drawContext *ctx) + void copyViewAttributes(drawContext *other) { - camera = ctx->camera; + camera = other->camera; for(int i = 0; i < 3; i++){ - r[i] = ctx->r[i]; - t[i] = ctx->t[i]; - s[i] = ctx->s[i]; - t_init[i] = ctx->t_init[i]; + r[i] = other->r[i]; + t[i] = other->t[i]; + s[i] = other->s[i]; + t_init[i] = other->t_init[i]; } for(int i = 0; i < 4; i++){ - quaternion[i] = ctx->quaternion[i]; + quaternion[i] = other->quaternion[i]; } for(int i = 0; i < 16; i++){ - rot[i] = ctx->rot[i]; + rot[i] = other->rot[i]; } } static void setGlobal(drawContextGlobal *global){ _global = global; } diff --git a/contrib/onelab/python/test.py b/contrib/onelab/python/test.py index 631bb7070ff7213aa29e2017402ce0aa995d032a..bb17cd41dd649651f3958575ffd6c6a61f1bdb84 100755 --- a/contrib/onelab/python/test.py +++ b/contrib/onelab/python/test.py @@ -11,10 +11,11 @@ B = oc.get_number('Group/B', 0, min = -10, max = 10, step = 1) C = oc.get_number('Group/C', 2, choices = [0, 1, 2, 3], attributes={'Highlight':'Pink'}) D = oc.get_number('Group/D', 2, labels = {0:'zero', 1:'un', 2:'deux', 3:'trois'}, attributes={'Highlight':'Blue'}) #utf-8 are allowed everywhere (should be prefixed by 'u' in python 2, not required in python 3) -Omega = oc.get_string(u'Ω', u'∫(∂φ/∂α)³dx', help=u'ask someone@universe.org', choices = ['oui', 'non', u'peut-être']) +#Omega = oc.get_string(u'Ω', u'∫(∂φ/∂α)³dx', help=u'ask someone@universe.org', choices = ['oui', 'non', u'peut-être']) if oc.action != 'compute' : exit(0) #this is the solver code -print (A, B, C, str(Omega)) +#print (A, B, C, str(Omega)) +print (A, B, C)