diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp index b6f67986bcd6627211498b0370fc64fd67fd962c..bb175c76bb68be15fe3d5c8864f468af70b255e4 100644 --- a/Common/OpenFile.cpp +++ b/Common/OpenFile.cpp @@ -152,22 +152,6 @@ void AddToTemporaryBoundingBox(double x, double y, double z) for(int i = 0; i < 3; i++) CTX::instance()->cg[i] = temp_bb.center()[i]; } -static void ComputeMaxEntityNum() -{ - GModel::current()->getGEOInternals()->MaxPointNum = - std::max(GModel::current()->getGEOInternals()->MaxPointNum, - GModel::current()->getMaxElementaryNumber(0)); - GModel::current()->getGEOInternals()->MaxLineNum = - std::max(GModel::current()->getGEOInternals()->MaxLineNum, - GModel::current()->getMaxElementaryNumber(1)); - GModel::current()->getGEOInternals()->MaxSurfaceNum = - std::max(GModel::current()->getGEOInternals()->MaxSurfaceNum, - GModel::current()->getMaxElementaryNumber(2)); - GModel::current()->getGEOInternals()->MaxVolumeNum = - std::max(GModel::current()->getGEOInternals()->MaxVolumeNum, - GModel::current()->getMaxElementaryNumber(3)); -} - static std::vector<gmshFILE> openedFiles; int ParseFile(const std::string &fileName, bool close, bool warnIfMissing) @@ -484,7 +468,7 @@ int MergeFile(const std::string &fileName, bool warnIfMissing, bool setWindowTit } } - ComputeMaxEntityNum(); + GModel::current()->getGEOInternals()->ComputeMaxEntityNum(); if(setBoundingBox) SetBoundingBox(); CTX::instance()->geom.draw = 1; CTX::instance()->mesh.changed = ENT_ALL; diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp index dc09d2882f0b4bbaa5c1f1016b89a6eec08636f2..8f955dc7b794e032cdb2fe8ac433dfe55dd6bce3 100644 --- a/Geo/Geo.cpp +++ b/Geo/Geo.cpp @@ -4544,6 +4544,7 @@ void GEO_Internals::alloc_all() { MaxPointNum = MaxLineNum = MaxLineLoopNum = MaxSurfaceNum = 0; MaxSurfaceLoopNum = MaxVolumeNum = MaxPhysicalNum = 0; + ComputeMaxEntityNum(); Points = Tree_Create(sizeof(Vertex *), compareVertex); Curves = Tree_Create(sizeof(Curve *), compareCurve); EdgeLoops = Tree_Create(sizeof(EdgeLoop *), compareEdgeLoop); @@ -4574,6 +4575,18 @@ void GEO_Internals::reset_physicals() List_Reset(PhysicalGroups); } +void GEO_Internals::ComputeMaxEntityNum() +{ + MaxPointNum = + std::max(MaxPointNum, GModel::current()->getMaxElementaryNumber(0)); + MaxLineNum = + std::max(MaxLineNum, GModel::current()->getMaxElementaryNumber(1)); + MaxSurfaceNum = + std::max(MaxSurfaceNum, GModel::current()->getMaxElementaryNumber(2)); + MaxVolumeNum = + std::max(MaxVolumeNum, GModel::current()->getMaxElementaryNumber(3)); +} + int select_contour(int type, int num, List_T * List) { int k = 0; diff --git a/Geo/Geo.h b/Geo/Geo.h index 024c7adb1616ebd653e3a754035c6b7b102af874..f454c479597f9c503890d4c8dea438ecdd411243 100644 --- a/Geo/Geo.h +++ b/Geo/Geo.h @@ -297,6 +297,8 @@ class GEO_Internals{ void reset_physicals(); std::map<int,int> periodicFaces; std::map<int,int> periodicEdges; + + void ComputeMaxEntityNum(); }; class Shape{