return false;
}
+//=======================================================================
+//function : Contains
+//purpose :
+//=======================================================================
+
+bool SMESHDS_Group::Contains (const SMDS_MeshElement* elem)
+{
+ if (elem)
+ return myGroup.Contains(elem);
+ return false;
+}
+
//=============================================================================
/*!
*
virtual bool Contains (const int theID);
+ virtual bool Contains (const SMDS_MeshElement* elem);
+
virtual SMDS_ElemIteratorPtr GetElements();
bool Add (const int theID);
bool SMESHDS_GroupBase::Contains (const int theID)
{
- SMDS_ElemIteratorPtr it = GetElements();
- bool contains = false;
- if ( it )
- while ( !contains && it->more() )
- contains = ( it->next()->GetID() == theID );
- return contains;
+ if ( SMDS_ElemIteratorPtr it = GetElements() ) {
+ while ( it->more() )
+ if ( it->next()->GetID() == theID )
+ return true;
+ }
+ return false;
+}
+
+//=======================================================================
+//function : Contains
+//purpose :
+//=======================================================================
+
+bool SMESHDS_GroupBase::Contains (const SMDS_MeshElement* elem)
+{
+ if ( elem )
+ return Contains( elem->GetID() );
}
//=======================================================================
virtual bool Contains (const int theID);
+ virtual bool Contains (const SMDS_MeshElement* elem);
+
virtual SMDS_ElemIteratorPtr GetElements() = 0;
int GetID (const int theIndex);
{
return mySubMesh->Contains( findInMesh( theID ));
}
+
+//=======================================================================
+//function : Contains
+//purpose :
+//=======================================================================
+
+bool SMESHDS_GroupOnGeom::Contains (const SMDS_MeshElement* elem)
+{
+ return mySubMesh->Contains( elem );
+}
+
virtual bool Contains (const int theID);
+ virtual bool Contains (const SMDS_MeshElement* elem);
+
virtual SMDS_ElemIteratorPtr GetElements();
private: