From: eap Date: Mon, 24 Oct 2011 13:12:22 +0000 (+0000) Subject: in PublishGroup(), for the standalone groups, set full ot empty icon X-Git-Tag: V6_4_0a1~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8801aa27edbc4a4add072d9a5088007b6cb66302;p=modules%2Fsmesh.git in PublishGroup(), for the standalone groups, set full ot empty icon depending on availability of elements of type of the group in the mesh --- diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 1fd5f5415..900534d11 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -698,10 +698,18 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr theStudy // Add new group to corresponding sub-tree SMESH::array_of_ElementType_var elemTypes = theGroup->GetTypes(); - const int isEmpty = ( elemTypes->length() == 0 ); + int isEmpty = ( elemTypes->length() == 0 ); std::string pm[2] = { "ICON_SMESH_TREE_GROUP", "ICON_SMESH_TREE_MESH_WARN" }; if ( SMESH::DownCast< SMESH_GroupOnFilter_i* > ( theGroup )) + { pm[0] = "ICON_SMESH_TREE_GROUP_ON_FILTER"; + } + else if ( SMESH::DownCast< SMESH_Group_i* > ( theGroup )) + { + SMESH::array_of_ElementType_var allElemTypes = theMesh->GetTypes(); + for ( size_t i =0; i < allElemTypes->length() && isEmpty; ++i ) + isEmpty = ( allElemTypes[i] != theGroup->GetType() ); + } aGroupSO = publish (theStudy, theGroup, aRootSO, 0, pm[isEmpty].c_str() ); } if ( aGroupSO->_is_nil() )