Skip to content
Snippets Groups Projects
Commit fa52693e authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

new GmshRestoreDefaultOptions() and GmshClearProject() api

parent bbd1af29
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment