X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMDS%2FSMDS_MeshElementIDFactory.cxx;fp=src%2FSMDS%2FSMDS_MeshElementIDFactory.cxx;h=43f12c7771912daa708edc644b22104f7da9b0de;hp=d635b0110c15ea89c0360c75d87946aaa202f336;hb=c3bf92bd87b770fd81631a3853f7f5bb1ac6a4e8;hpb=fe9985e3cf9bb2e7d67a8c7ad4cf4c489fbf0922 diff --git a/src/SMDS/SMDS_MeshElementIDFactory.cxx b/src/SMDS/SMDS_MeshElementIDFactory.cxx index d635b0110..43f12c777 100644 --- a/src/SMDS/SMDS_MeshElementIDFactory.cxx +++ b/src/SMDS/SMDS_MeshElementIDFactory.cxx @@ -58,3 +58,27 @@ SMDS_MeshElement* SMDS_MeshElementIDFactory::MeshElement(int ID) map::iterator it=myIDElements.find(ID); if(it==myIDElements.end()) return NULL; else return (*it).second; } + + +//======================================================================= +//function : GetFreeID +//purpose : +//======================================================================= +int SMDS_MeshElementIDFactory::GetFreeID() +{ + int ID; + do { + ID = SMDS_MeshIDFactory::GetFreeID(); + } while (myIDElements.find(ID) != myIDElements.end()); + return ID; +} + +//======================================================================= +//function : ReleaseID +//purpose : +//======================================================================= +void SMDS_MeshElementIDFactory::ReleaseID(const int ID) +{ + myIDElements.erase(ID); + SMDS_MeshIDFactory::ReleaseID(ID); +}