From 00d6e38575a970f66269c8a22a81cab4f91c6309 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 23 Jun 2011 12:37:17 +0000 Subject: [PATCH] 0021014: EDF 1583 SMESH: Improvement of the Python Dump for the creation of groups Make groupType() return "SMESH_GroupOnFilter" --- src/SMESHGUI/SMESHGUI_Selection.cxx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index b0ec372bf..caf66e053 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -661,17 +661,19 @@ QString SMESHGUI_Selection::groupType( int ind ) const { QString e = entry( ind ); _PTR(SObject) SO = SMESH::GetActiveStudyDocument()->FindObjectID( e.toLatin1().constData() ); - QString type; if( SO ) { - CORBA::Object_var obj = SMESH::SObjectToObject( SO ); - - SMESH::SMESH_Group_var aGroup = SMESH::SMESH_Group::_narrow( obj ); - SMESH::SMESH_GroupOnGeom_var aGroupOnGeom = SMESH::SMESH_GroupOnGeom::_narrow( obj ); - if( !aGroup->_is_nil() ) - type = QString( "Group" ); - else if ( !aGroupOnGeom->_is_nil() ) - type = QString( "GroupOnGeom" ); + SMESH::SMESH_Group_var g = SMESH::SObjectToInterface( SO ); + if( !g->_is_nil() ) + return "Group"; + + SMESH::SMESH_GroupOnGeom_var gog = SMESH::SObjectToInterface( SO ); + if( !gog->_is_nil() ) + return "GroupOnGeom"; + + SMESH::SMESH_GroupOnFilter_var gof = SMESH::SObjectToInterface(SO); + if ( !gof->_is_nil() ) + return "GroupOnFilter"; } - return type; + return ""; }