-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021 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
//purpose :
//=======================================================================
-int SMESHDS_Group::Extent() const
+smIdType SMESHDS_Group::Extent() const
{
return myGroup.Extent();
}
*/
//=============================================================================
-bool SMESHDS_Group::Contains (const int theID)
+bool SMESHDS_Group::Contains (const smIdType theID)
{
const SMDS_MeshElement* aElem = findInMesh (theID);
if (aElem)
*/
//=============================================================================
-bool SMESHDS_Group::Add (const int theID)
+bool SMESHDS_Group::Add (const smIdType theID)
{
return Add( findInMesh( theID ));
}
bool SMESHDS_Group::Add (const SMDS_MeshElement* aElem )
{
- if (!aElem || myGroup.Contains(aElem))
- return false;
-
- if (myGroup.IsEmpty())
- SetType( aElem->GetType() );
-
- myGroup.Add (aElem);
- resetIterator();
- return true;
+ bool added = false;
+ if ( aElem )
+ {
+ added = myGroup.Add (aElem);
+ if ( added )
+ resetIterator();
+ }
+ return added;
}
//=============================================================================
*/
//=============================================================================
-bool SMESHDS_Group::Remove (const int theID)
+bool SMESHDS_Group::Remove (const smIdType theID)
{
- const SMDS_MeshElement* aElem = findInMesh (theID);
- if (!aElem || !myGroup.Contains(aElem))
- return false;
- myGroup.Remove (aElem);
- resetIterator();
- return true;
+ bool removed = false;
+ if ( const SMDS_MeshElement* aElem = findInMesh( theID ))
+ {
+ removed = myGroup.Remove (aElem);
+ if ( removed )
+ resetIterator();
+ }
+ return removed;
}