diff --git a/CMakeLists.txt b/CMakeLists.txt index 2be4ca0e04d84813db790611996dc5ff69dbd705..4c6bb65e9f66731d69d689dfee8ab89ac00b86db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,7 @@ opt(NETGEN "Enable Netgen 3D frontal mesh generator" ${DEFAULT}) opt(NUMPY "Enable conversion between fullMatrix and numpy array (requires SWIG)" OFF) opt(OCC "Enable Open CASCADE geometrical models" ${DEFAULT}) opt(ONELAB "Enable ONELAB solver interface" ${DEFAULT}) +opt(ONELAB2 "Enable experimental ONELAB-Cloud solver interface" OFF) opt(ONELAB_METAMODEL "Enable ONELAB metamodels (experimental)" ${DEFAULT}) opt(OPENMP "Enable OpenMP (experimental)" OFF) opt(OPTHOM "Enable high-order mesh optimization tools" ${DEFAULT}) @@ -500,6 +501,10 @@ if(ENABLE_ONELAB) DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) endif(ENABLE_ONELAB) +if(ENABLE_ONELAB2) + set_config_option(HAVE_ONELAB2 "ONELAB2") +endif(ENABLE_ONELAB2) + if(ENABLE_BUILD_IOS) find_file(CMAKE_TOOLCHAIN_FILE "ios.cmake") if(NOT CMAKE_TOOLCHAIN_FILE) diff --git a/Common/GmshConfig.h.in b/Common/GmshConfig.h.in index 7c4949eaabc79025a2bb8fea6f34e292fc4ef1d8..b6e2c4b18379bd150b094caa85bd0d16565e85da 100644 --- a/Common/GmshConfig.h.in +++ b/Common/GmshConfig.h.in @@ -47,6 +47,7 @@ #cmakedefine HAVE_NO_VSNPRINTF #cmakedefine HAVE_OCC #cmakedefine HAVE_ONELAB +#cmakedefine HAVE_ONELAB2 #cmakedefine HAVE_ONELAB_METAMODEL #cmakedefine HAVE_OPENGL #cmakedefine HAVE_OPTHOM diff --git a/Fltk/FlGui.cpp b/Fltk/FlGui.cpp index 7b7cdab7272b70592010d1a60407307b75f724d1..465734911fa661a7347cc311f81573e4f54e3cdb 100644 --- a/Fltk/FlGui.cpp +++ b/Fltk/FlGui.cpp @@ -761,7 +761,7 @@ void FlGui::updateViews(bool numberOfViewsHasChanged, bool deleteWidgets) for(unsigned int i = 0; i < graph.size(); i++) graph[i]->checkAnimButtons(); if(numberOfViewsHasChanged){ - onelab->rebuildTree(deleteWidgets); + if(onelab) onelab->rebuildTree(deleteWidgets); options->resetBrowser(); options->resetExternalViewList(); fields->loadFieldViewList(); @@ -1105,11 +1105,12 @@ void FlGui::saveMessages(const char *fileName) void FlGui::rebuildTree(bool deleteWidgets) { - onelab->rebuildTree(deleteWidgets); + if(onelab) onelab->rebuildTree(deleteWidgets); } void FlGui::openModule(const std::string &name) { + if(!onelab) return; if(!onelab->isManuallyClosed("0Modules/" + name)) onelab->openTreeItem("0Modules/" + name); } diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp index 5d4a7454ec1d2476fef3e5d5764fd44a184a4e06..9ec0a454626f20e7f043129bdf827e97255284c4 100644 --- a/Fltk/graphicWindow.cpp +++ b/Fltk/graphicWindow.cpp @@ -3004,8 +3004,12 @@ graphicWindow::graphicWindow(bool main, int numTiles, bool detachedMenu) } if(main && !detachedMenu){ +#if defined(HAVE_ONELAB2) + // Hey Maxime, this is for you! +#else _onelab = new onelabGroup(0, mh, twidth, height - mh - sh); _onelab->enableTreeWidgetResize(false); +#endif } else{ _onelab = 0; @@ -3289,12 +3293,13 @@ void graphicWindow::checkAnimButtons() void graphicWindow::setMenuWidth(int w) { + if(!_onelab) return; if(_menuwin){ _menuwin->size(std::max(w, _onelab->getMinWindowWidth()), _menuwin->h()); _menuwin->redraw(); return; } - if(!_onelab || !_browser) return; + if(!_browser) return; double dw = w - _onelab->w(); if(!dw) return; for(unsigned int i = 0; i < gl.size(); i++){ diff --git a/Fltk/onelabGroup.cpp b/Fltk/onelabGroup.cpp index 5e72cb116a9639e64e48b91ec24fb575f35c2288..2e5e4c1ba66094a3991b7c0f6b0f72c5fd489541 100644 --- a/Fltk/onelabGroup.cpp +++ b/Fltk/onelabGroup.cpp @@ -2063,6 +2063,8 @@ void onelabGroup::addSolver(const std::string &name, const std::string &executab void solver_cb(Fl_Widget *w, void *data) { + if(!FlGui::instance()->onelab) return; + int num = (intptr_t)data; if(num >= 0){ std::string name = opt_solver_name(num, GMSH_GET, "");