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

GmshOption "Reset" to reset db + PViews + previous GModels

parent a4724c42
Branches
Tags
No related merge requests found
...@@ -1314,6 +1314,15 @@ static void setGmshOption(T &n) ...@@ -1314,6 +1314,15 @@ static void setGmshOption(T &n)
FlGui::instance()->rebuildTree(false); FlGui::instance()->rebuildTree(false);
return; return;
} }
if(opt == "Reset"){ // reset db + models except current one
resetDb(false);
for(int i = PView::list.size() - 1; i >= 0; i--)
delete PView::list[i];
for(int i = GModel::list.size() - 1; i >= 0; i--)
if(GModel::list[i] != GModel::current()) delete GModel::list[i];
FlGui::instance()->rebuildTree(false);
return;
}
std::string::size_type dot = opt.find('.'); std::string::size_type dot = opt.find('.');
if(dot == std::string::npos) return; if(dot == std::string::npos) return;
GmshSetOption(opt.substr(0, dot), opt.substr(dot + 1), n.getValue()); GmshSetOption(opt.substr(0, dot), opt.substr(dot + 1), n.getValue());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment