diff --git a/Common/Gmsh.cpp b/Common/Gmsh.cpp index 7bfa425fb2a0f08c362406c73267e702590274c7..bec4c82f0ada032915f17f81c7b1f57e02f93bad 100644 --- a/Common/Gmsh.cpp +++ b/Common/Gmsh.cpp @@ -139,12 +139,25 @@ int GmshGetOption(const std::string &category, const std::string &name, return ColorOption(GMSH_GET, category.c_str(), index, name.c_str(), value); } +int GmshRestoreDefaultOptions() +{ + ReInitOptions(0); + InitOptionsGUI(0); + return 1; +} + int GmshOpenProject(const std::string &fileName) { OpenProject(fileName); return 1; } +int GmshClearProject() +{ + ClearProject(); + return 1; +} + int GmshMergeFile(const std::string &fileName) { return MergeFile(fileName, true); diff --git a/Common/Gmsh.h b/Common/Gmsh.h index 8d5e21ee304852032d96804176ddc3dae23d586c..e6245c412c87e8fcca6cffb0e0e88cb40d0023c3 100644 --- a/Common/Gmsh.h +++ b/Common/Gmsh.h @@ -27,7 +27,9 @@ int GmshGetOption(const std::string &category, const std::string &name, double &value, int index=0); int GmshGetOption(const std::string &category, const std::string &name, unsigned int &value, int index=0); +int GmshRestoreDefaultOptions(); int GmshOpenProject(const std::string &fileName); +int GmshClearProject(); int GmshMergeFile(const std::string &fileName); int GmshMergePostProcessingFile(const std::string &fileName); int GmshWriteFile(const std::string &fileName); diff --git a/contrib/mobile/drawContext.cpp b/contrib/mobile/drawContext.cpp index d862bb46c83eb1f3046bfe83c18318436877cb58..758465ad3af98b7809ce2ebcfc7c5eedaf7e56b1 100644 --- a/contrib/mobile/drawContext.cpp +++ b/contrib/mobile/drawContext.cpp @@ -80,13 +80,16 @@ void drawContext::load(std::string filename) if(locked) return; // delete all models and post-processing views - ClearProject(); + GmshClearProject(); // reset onelab database onelab::server::instance()->clear(); + // restore default options + GmshRestoreDefaultOptions(); + // open the file with Gmsh - OpenProject(filename); + GmshOpenProject(filename); // reset openGL view eventHandler(10);