0019957: EDF 785 SMESH: Convert Quadratic and Group on GEOM

return bool from Remove()
This commit is contained in:
eap 2008-11-21 10:57:09 +00:00
parent 5231e88856
commit 92a6856b9a
2 changed files with 9 additions and 4 deletions

View File

@ -137,10 +137,15 @@ void SMDS_MeshGroup::Add(const SMDS_MeshElement * theElem)
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMDS_MeshGroup::Remove(const SMDS_MeshElement * theElem) bool SMDS_MeshGroup::Remove(const SMDS_MeshElement * theElem)
{ {
myElements.erase(theElem); TIterator found = myElements.find(theElem);
if (myElements.empty()) myType = SMDSAbs_All; if ( found != myElements.end() ) {
myElements.erase(found);
if (myElements.empty()) myType = SMDSAbs_All;
return true;
}
return false;
} }
//======================================================================= //=======================================================================

View File

@ -46,7 +46,7 @@ class SMDS_EXPORT SMDS_MeshGroup:public SMDS_MeshObject
void SetType (const SMDSAbs_ElementType theType); void SetType (const SMDSAbs_ElementType theType);
void Clear(); void Clear();
void Add(const SMDS_MeshElement * theElem); void Add(const SMDS_MeshElement * theElem);
void Remove(const SMDS_MeshElement * theElem); bool Remove(const SMDS_MeshElement * theElem);
bool IsEmpty() const { return myElements.empty(); } bool IsEmpty() const { return myElements.empty(); }
int Extent() const { return myElements.size(); } int Extent() const { return myElements.size(); }