From fa52693e2952f1cc13920c74dc6ee51e3a14e36b Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Tue, 1 Apr 2014 11:59:33 +0000 Subject: [PATCH] new GmshRestoreDefaultOptions() and GmshClearProject() api --- Common/Gmsh.cpp | 13 +++++++++++++ Common/Gmsh.h | 2 ++ contrib/mobile/drawContext.cpp | 7 +++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Common/Gmsh.cpp b/Common/Gmsh.cpp index 7bfa425fb2..bec4c82f0a 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 8d5e21ee30..e6245c412c 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 d862bb46c8..758465ad3a 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); -- GitLab