Salome HOME
0021208: Performance issue when loading SMESH with an hdf file containing a big mesh
authoreap <eap@opencascade.com>
Fri, 24 Feb 2012 10:52:50 +0000 (10:52 +0000)
committereap <eap@opencascade.com>
Fri, 24 Feb 2012 10:52:50 +0000 (10:52 +0000)
don't call GetTypes() of GroupOnFilter that can be very long

src/SMESHGUI/SMESHGUI_Utils.cxx

index 53e4bb38c3457a8be0d4db676c312d1673f10e00..e3c3dac9313164a65be91b03b66e897de3ff9a86 100644 (file)
@@ -315,9 +315,12 @@ namespace SMESH
               SObjectToInterface<SMESH::SMESH_GroupOnFilter>( aSObj1 );
             const bool isGroupOnFilter = !gof->_is_nil();
 
-            SMESH::array_of_ElementType_var elemTypes = idSrc->GetTypes();
-            const bool isEmpty = ( elemTypes->length() == 0 );
-
+            bool isEmpty = false;
+            if ( !isGroupOnFilter ) // GetTypes() can be very long on isGroupOnFilter!
+            {
+              SMESH::array_of_ElementType_var elemTypes = idSrc->GetTypes();
+              isEmpty = ( elemTypes->length() == 0 );
+            }
             if ( isEmpty )
               aPixmap->SetPixMap("ICON_SMESH_TREE_MESH_WARN");
             else if ( objType != GROUP )