- if ( myMeshServant ) {
- ::SMESH_Mesh& aMesh = myMeshServant->GetImpl();
- ::SMESH_Group* aGroup = aMesh.GetGroup(myLocalID);
- if (aGroup) {
- // a SMDS group forgets its type after clearing, so we must re-set it
- // if the group becomes empty
- SMDSAbs_ElementType aSMDSType = aGroup->GetGroupDS()->GetType();
- SMESHDS_Group* aGroupDS = aGroup->GetGroupDS();
- int nbDel = 0;
- for (int i = 0; i < theIDs.length(); i++) {
- int anID = (int) theIDs[i];
- if (aGroupDS->Remove(anID))
- nbDel++;
- }
- if (aGroupDS->IsEmpty())
- aGroupDS->SetType(aSMDSType);
- return nbDel;
- }
- }
- MESSAGE("attempt to remove elements from a vague group");
- return 0;
+ SMESHDS_GroupBase* aGroupDS = GetGroupDS();
+ if (aGroupDS)
+ return aGroupDS->GetID(theIndex);
+ MESSAGE("attempt to iterate on a vague group");
+ return -1;