X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_GroupOnShapeDlg.cxx;h=9054ad855a30fb13ff598b7e4ac2b3b34e30630d;hp=6a0f17d332c3f0f7119ef456504d083d5120644b;hb=6472eab132825fec572beda8276947593f85ffa1;hpb=6d32f944a0a115b6419184c50b57bf7c4eef5786 diff --git a/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx index 6a0f17d33..9054ad855 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx @@ -206,7 +206,7 @@ LightApp_Dialog* SMESHGUI_GroupOnShapeOp::dlg() const */ //================================================================================ -static SMESH::ElementType elementType(GEOM::GEOM_Object_var geom) +SMESH::ElementType SMESHGUI_GroupOnShapeOp::ElementType(GEOM::GEOM_Object_var geom) { if ( !geom->_is_nil() ) { switch ( geom->GetShapeType() ) { @@ -220,27 +220,28 @@ static SMESH::ElementType elementType(GEOM::GEOM_Object_var geom) case GEOM::COMPOUND: break; default: return SMESH::ALL; } - GEOM::GEOM_IShapesOperations_wrap aShapeOp = - SMESH::GetGEOMGen()->GetIShapesOperations(); + GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen( geom ); + GEOM::GEOM_IShapesOperations_wrap aShapeOp = geomGen->GetIShapesOperations(); - if ( geom->GetType() == 37 ) { // geom group - GEOM::GEOM_IGroupOperations_wrap aGroupOp = - SMESH::GetGEOMGen()->GetIGroupOperations(); + if ( geom->GetType() == 37 ) // geom group + { + GEOM::GEOM_IGroupOperations_ptr aGroupOp = geomGen->GetIGroupOperations(); if ( !aGroupOp->_is_nil() ) { // mainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap GEOM::GEOM_Object_var mainShape = aGroupOp->GetMainShape( geom ); GEOM::ListOfLong_var ids = aGroupOp->GetObjects( geom ); if ( ids->length() && !mainShape->_is_nil() && !aShapeOp->_is_nil() ) { GEOM::GEOM_Object_wrap member = aShapeOp->GetSubShape( mainShape, ids[0] ); - return elementType( member ); + return ElementType( member ); } } } - else if ( !aShapeOp->_is_nil() ) { // just a compoud shape + else if ( !aShapeOp->_is_nil() ) // just a compoud shape + { GEOM::ListOfLong_var ids = aShapeOp->SubShapeAllIDs( geom, GEOM::SHAPE, false ); if ( ids->length() ) { GEOM::GEOM_Object_wrap member = aShapeOp->GetSubShape( geom, ids[0] ); - return elementType( member ); + return ElementType( member ); } } } @@ -335,7 +336,7 @@ bool SMESHGUI_GroupOnShapeOp::onApply() if ( geom->_is_nil() ) continue; // group type - SMESH::ElementType elemType = isNode ? SMESH::NODE : elementType( geom ); + SMESH::ElementType elemType = isNode ? SMESH::NODE : ElementType( geom ); if ( elemType == SMESH::ALL ) continue;