Salome HOME
In PublishSubMesh(), set an icon corresponding to group emptiness
authoreap <eap@opencascade.com>
Wed, 22 Jun 2011 15:51:42 +0000 (15:51 +0000)
committereap <eap@opencascade.com>
Wed, 22 Jun 2011 15:51:42 +0000 (15:51 +0000)
src/SMESH_I/SMESH_Gen_i_1.cxx

index 9948b7d7df38954c43eb56550a036ef537bc0f4f..19fc2a975adbed7b9e0f1582d06f64101d2e3b3c 100644 (file)
@@ -632,7 +632,10 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr      theS
     SetName( aRootSO, aRootName );
 
     // Add new submesh to corresponding sub-tree
-    aSubMeshSO = publish (theStudy, theSubMesh, aRootSO, 0, "ICON_SMESH_TREE_MESH_WARN");
+    SMESH::array_of_ElementType_var elemTypes = theSubMesh->GetTypes();
+    const int isEmpty = ( elemTypes->length() == 0 );
+    const char* pm[2] = { "ICON_SMESH_TREE_MESH", "ICON_SMESH_TREE_MESH_WARN" };
+    aSubMeshSO = publish (theStudy, theSubMesh, aRootSO, 0, pm[isEmpty] );
     if ( aSubMeshSO->_is_nil() )
       return aSubMeshSO._retn();
   }