Salome HOME
PAL6825
[modules/smesh.git] / src / SMESHDS / SMESHDS_GroupBase.cxx
index c3fc31d7017c8df8c942e5fd963687665910caba..c4adcc53b6921a4ce7aeb6c6e789722b7cbfea1c 100644 (file)
@@ -41,7 +41,7 @@ SMESHDS_GroupBase::SMESHDS_GroupBase (const int                 theID,
                                       const SMESHDS_Mesh*       theMesh,
                                       const SMDSAbs_ElementType theType):
        myID(theID), myMesh(theMesh), myType(theType), myStoreName(""),
-       myCurIndex(0), myCurID(0)
+       myCurIndex(0), myCurID(-1)
 {
 }
 
@@ -86,6 +86,18 @@ const SMDS_MeshElement* SMESHDS_GroupBase::findInMesh (const int theID) const
   return aElem;
 }
 
+//=============================================================================
+/*!
+ *  Internal method: resets cached iterator, should be called by ancestors
+ *  when they are modified (ex: Add() or Remove() )
+ */
+//=============================================================================
+void SMESHDS_GroupBase::resetIterator()
+{
+  myCurIndex = 0;
+  myCurID = -1;
+}
+
 //=======================================================================
 //function : Extent
 //purpose  :