0022126: Allow method GetMainShape for type GEOM_SUBSHAPE

This commit is contained in:
jfa 2013-03-07 08:27:16 +00:00
parent c3bca71a43
commit 9586662e8e

View File

@ -1583,10 +1583,12 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::GetMainShape (Handle(GEOM_Object)
SetErrorCode(KO); SetErrorCode(KO);
if (theGroup.IsNull()) return NULL; if (theGroup.IsNull()) return NULL;
if ( theGroup->GetType() != GEOM_GROUP ) { if (theGroup->GetType() != GEOM_GROUP &&
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." ); theGroup->GetType() != GEOM_SUBSHAPE) {
SetErrorCode("Error: You could perform this operation only with a group or a sub-shape.");
return NULL; return NULL;
} }
Handle(GEOM_Function) aGroupFunction = theGroup->GetFunction(1); Handle(GEOM_Function) aGroupFunction = theGroup->GetFunction(1);
if (aGroupFunction.IsNull()) return NULL; if (aGroupFunction.IsNull()) return NULL;