From 8801aa27edbc4a4add072d9a5088007b6cb66302 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 24 Oct 2011 13:12:22 +0000 Subject: [PATCH] in PublishGroup(), for the standalone groups, set full ot empty icon depending on availability of elements of type of the group in the mesh --- src/SMESH_I/SMESH_Gen_i_1.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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() ) -- 2.39.2