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

GModel::readGEO must be a static member function, since the parser can
now create multiple models!
parent b4617114
Branches
Tags
No related merge requests found
...@@ -206,8 +206,7 @@ void ParseString(std::string str) ...@@ -206,8 +206,7 @@ void ParseString(std::string str)
if(fp){ if(fp){
fprintf(fp, "%s\n", str.c_str()); fprintf(fp, "%s\n", str.c_str());
fclose(fp); fclose(fp);
ParseFile(fileName, true); GModel::readGEO(fileName);
GModel::current()->importGEOInternals();
} }
} }
...@@ -363,10 +362,7 @@ int MergeFile(std::string fileName, bool warnIfMissing) ...@@ -363,10 +362,7 @@ int MergeFile(std::string fileName, bool warnIfMissing)
} }
#endif #endif
else { else {
// don't use readGEO here (ParseFile is allowed to change the status = GModel::readGEO(fileName);
// current model)
ParseFile(fileName, true);
status = GModel::current()->importGEOInternals();
} }
} }
......
...@@ -314,7 +314,8 @@ class GModel ...@@ -314,7 +314,8 @@ class GModel
// Gmsh native CAD format // Gmsh native CAD format
int importGEOInternals(); int importGEOInternals();
int readGEO(const std::string &name); // read is static, since it can create multiple models
static int readGEO(const std::string &name);
int writeGEO(const std::string &name, bool printLabels=true); int writeGEO(const std::string &name, bool printLabels=true);
// Fourier model // Fourier model
......
...@@ -38,7 +38,7 @@ void GModel::_deleteGEOInternals() ...@@ -38,7 +38,7 @@ void GModel::_deleteGEOInternals()
int GModel::readGEO(const std::string &name) int GModel::readGEO(const std::string &name)
{ {
ParseFile(name, true); ParseFile(name, true);
return importGEOInternals(); return GModel::current()->importGEOInternals();
} }
int GModel::importGEOInternals() int GModel::importGEOInternals()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment