X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMDS%2FSMDS_MeshElementIDFactory.hxx;h=526bcb5a051e773eee12cfe94c3a563a264ce9b4;hp=f987eaed2d4c7bb67ec51b69441dbe03f3779425;hb=c0562941eac9e5a0a8b36d731f3348fe09bf32d0;hpb=c3bf92bd87b770fd81631a3853f7f5bb1ac6a4e8 diff --git a/src/SMDS/SMDS_MeshElementIDFactory.hxx b/src/SMDS/SMDS_MeshElementIDFactory.hxx index f987eaed2..526bcb5a0 100644 --- a/src/SMDS/SMDS_MeshElementIDFactory.hxx +++ b/src/SMDS/SMDS_MeshElementIDFactory.hxx @@ -28,22 +28,35 @@ #define _SMDS_MeshElementIDFactory_HeaderFile #include "SMDS_MeshIDFactory.hxx" +#include "SMDS_ElemIterator.hxx" -#include -using namespace std; +#include class SMDS_MeshElement; +typedef NCollection_DataMap SMDS_IdElementMap; + class SMDS_MeshElementIDFactory:public SMDS_MeshIDFactory { - public: - SMDS_MeshElementIDFactory(); - bool BindID(int ID, SMDS_MeshElement * elem); - SMDS_MeshElement * MeshElement(int ID); - virtual int GetFreeID(); - virtual void ReleaseID(int ID); - private: - map myIDElements; +public: + SMDS_MeshElementIDFactory(); + bool BindID(int ID, SMDS_MeshElement * elem); + SMDS_MeshElement * MeshElement(int ID); + virtual int GetFreeID(); + virtual void ReleaseID(int ID); + int GetMaxID() const; + int GetMinID() const; + SMDS_ElemIteratorPtr elementsIterator() const; +private: + void updateMinMax() const; + void updateMinMax(int id) const + { + if (id > myMax) myMax = id; + if (id < myMin) myMin = id; + } + + SMDS_IdElementMap myIDElements; + mutable int myMin, myMax; };