From: jfa Date: Thu, 7 Mar 2013 08:27:16 +0000 (+0000) Subject: 0022126: Allow method GetMainShape for type GEOM_SUBSHAPE X-Git-Tag: V6_main_FINAL~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9586662e8e142d24c5c979142a7c1288d4b8fd6b;p=modules%2Fgeom.git 0022126: Allow method GetMainShape for type GEOM_SUBSHAPE --- diff --git a/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx b/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx index 78a0548e8..49675b0ad 100644 --- a/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx @@ -1151,8 +1151,8 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::UnionListOfGroups for (i = 1; i <= aLen; i++) { Handle(GEOM_Object) aGr_i = Handle(GEOM_Object)::DownCast(theGList->Value(i)); if ( aGr_i->GetType() != GEOM_GROUP ) { - SetErrorCode( "Error: You could perform this operation only with group. Please select a group." ); - return NULL; + SetErrorCode( "Error: You could perform this operation only with group. Please select a group." ); + return NULL; } // Get group type aType_i = GetType(aGr_i); @@ -1582,11 +1582,13 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::GetMainShape (Handle(GEOM_Object) { SetErrorCode(KO); - if(theGroup.IsNull()) return NULL; - if ( theGroup->GetType() != GEOM_GROUP ) { - SetErrorCode( "Error: You could perform this operation only with group. Please select a group." ); + if (theGroup.IsNull()) return NULL; + if (theGroup->GetType() != GEOM_GROUP && + theGroup->GetType() != GEOM_SUBSHAPE) { + SetErrorCode("Error: You could perform this operation only with a group or a sub-shape."); return NULL; } + Handle(GEOM_Function) aGroupFunction = theGroup->GetFunction(1); if (aGroupFunction.IsNull()) return NULL;