X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMDS%2FSMDS_MeshElementIDFactory.hxx;h=b78358f30060866f806050a92b9aa5e502528362;hb=4f65b594f797e8ecdd689021c145331a78652d48;hp=8814676335d34505bea659a419044d47232ecfe0;hpb=13b8c20dfc9f5bedf2dd4699ac1e05a8d4227791;p=modules%2Fsmesh.git diff --git a/src/SMDS/SMDS_MeshElementIDFactory.hxx b/src/SMDS/SMDS_MeshElementIDFactory.hxx index 881467633..b78358f30 100644 --- a/src/SMDS/SMDS_MeshElementIDFactory.hxx +++ b/src/SMDS/SMDS_MeshElementIDFactory.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -27,22 +27,38 @@ #ifndef _SMDS_MeshElementIDFactory_HeaderFile #define _SMDS_MeshElementIDFactory_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshIDFactory.hxx" -#include +#include "SMDS_ElemIterator.hxx" -#include -using namespace std; +#include class SMDS_MeshElement; -class SMDS_MeshElementIDFactory:public SMDS_MeshIDFactory +typedef NCollection_DataMap SMDS_IdElementMap; + +class SMDS_EXPORT SMDS_MeshElementIDFactory:public SMDS_MeshIDFactory { - public: - SMDS_MeshElementIDFactory(); - bool BindID(int ID, SMDS_MeshElement * elem); - SMDS_MeshElement * MeshElement(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; };