diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp index 81f15cd90a2095b4241593740bc6671a818db8d7..eec1795dfb42853e6d6bfe3cf6f349dc071cd0ea 100644 --- a/Common/OpenFile.cpp +++ b/Common/OpenFile.cpp @@ -206,8 +206,7 @@ void ParseString(std::string str) if(fp){ fprintf(fp, "%s\n", str.c_str()); fclose(fp); - ParseFile(fileName, true); - GModel::current()->importGEOInternals(); + GModel::readGEO(fileName); } } @@ -363,10 +362,7 @@ int MergeFile(std::string fileName, bool warnIfMissing) } #endif else { - // don't use readGEO here (ParseFile is allowed to change the - // current model) - ParseFile(fileName, true); - status = GModel::current()->importGEOInternals(); + status = GModel::readGEO(fileName); } } diff --git a/Geo/GModel.h b/Geo/GModel.h index 126600e3616d363a959fb9b0081693880c0a09c9..c2b31682d911206a54076aac5d5e051ae5f74981 100644 --- a/Geo/GModel.h +++ b/Geo/GModel.h @@ -314,7 +314,8 @@ class GModel // Gmsh native CAD format 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); // Fourier model diff --git a/Geo/GModelIO_Geo.cpp b/Geo/GModelIO_Geo.cpp index 2bd5313f24977756cbb667eb38aadf6f3c6fd372..0fe4956ac6f1d48da490834179f2aaac63f535c8 100644 --- a/Geo/GModelIO_Geo.cpp +++ b/Geo/GModelIO_Geo.cpp @@ -38,7 +38,7 @@ void GModel::_deleteGEOInternals() int GModel::readGEO(const std::string &name) { ParseFile(name, true); - return importGEOInternals(); + return GModel::current()->importGEOInternals(); } int GModel::importGEOInternals()