Salome HOME
merge from branch BR_SMDS_MEMIMP 29 nov 2010
[modules/smesh.git] / src / SMDS / SMDS_MeshIDFactory.hxx
index 4479432c13662ad2f24b3ed616473a51cc1ea52e..fed18dc69f7b77d8853509a6f30902d843406cbc 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -19,6 +19,7 @@
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SMESH SMDS : implementaion of Salome mesh data structure
 //  File   : SMDS_MeshIDFactory.hxx
 //  Module : SMESH
 #include "SMDS_MeshObject.hxx"
 #include <set>
 
+class SMDS_Mesh;
 
 class SMDS_EXPORT SMDS_MeshIDFactory:public SMDS_MeshObject
 {
 public:
-  virtual int  GetFreeID();
-  virtual void ReleaseID(int ID);
+  int  GetFreeID();
+  virtual void ReleaseID(int ID, int vtkId = -1);
   virtual void Clear();
 
-  protected:
-        SMDS_MeshIDFactory();
-        int myMaxID;
-        std::set<int> myPoolOfID;
+  void SetMesh(SMDS_Mesh *mesh);
+  SMDS_Mesh* GetMesh();
+  inline bool isPoolIdEmpty() { return myPoolOfID.empty(); };
+  virtual void emptyPool(int maxId);
+  inline void adjustMaxId(int ID) { if (ID > myMaxID) myMaxID = ID;};
+protected:
+  SMDS_MeshIDFactory();
+  int myMaxID;
+  std::set<int> myPoolOfID;
+  SMDS_Mesh *myMesh;
 };
 
 #endif