SetType( aElem->GetType() );
myGroup.Add (aElem);
+ resetIterator();
return true;
}
if (!aElem || !myGroup.Contains(aElem))
return false;
myGroup.Remove (aElem);
+ resetIterator();
return true;
}
void SMESHDS_Group::Clear()
{
myGroup.Clear();
+ resetIterator();
}
// =====================
const SMESHDS_Mesh* theMesh,
const SMDSAbs_ElementType theType):
myID(theID), myMesh(theMesh), myType(theType), myStoreName(""),
- myCurIndex(0), myCurID(0)
+ myCurIndex(0), myCurID(-1)
{
}
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 :