Salome HOME
23636: EDF 18217 - Problem when suppressing CAD
[modules/smesh.git] / src / SMESHDS / SMESHDS_GroupBase.cxx
index 818c52009306bfed4f4b76d5096f4f8543377c49..0aad7f8a3483d57a652ba1a24eed77e9b07ac2f9 100644 (file)
@@ -51,7 +51,7 @@ SMESHDS_GroupBase::SMESHDS_GroupBase (const int                 theID,
 
 //=============================================================================
 /*!
- *  
+ *  Don't use it!
  */
 //=============================================================================
 
@@ -124,6 +124,9 @@ int SMESHDS_GroupBase::Extent() const
 
 bool SMESHDS_GroupBase::IsEmpty()
 {
+  if ( myMesh->GetMeshInfo().NbElements( myType ) == 0 )
+    // avoid long iteration over sub-meshes of a complex sub-mesh of a group on geometry
+    return true;
   SMDS_ElemIteratorPtr it = GetElements();
   return ( !it || !it->more() );
 }