Salome HOME
bug corrections in Zcracks for V83
[modules/smesh.git] / src / SMESHDS / SMESHDS_GroupBase.cxx
index ef2f2de4a5c5e1c76b7900f9c6cc40f9d19093bb..7d4d10fdfc9f41f8fff17b1f3db466370501b952 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  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
@@ -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 false;
   SMDS_ElemIteratorPtr it = GetElements();
   return ( !it || !it->more() );
 }