Corrections for bug IPAL12999.

This commit is contained in:
skl 2006-07-19 11:56:40 +00:00
parent 68748ac514
commit 8ca4c231a8
2 changed files with 9 additions and 1 deletions

View File

@ -272,7 +272,10 @@ bool GEOM_Object::IsMainShape()
Handle(GEOM_Function) GEOM_Object::AddFunction(const Standard_GUID& theGUID, int theFunctionType)
{
Standard_Integer nb = GetNbFunctions();
if(nb == 1 && theGUID == GetSubShapeID()) return NULL; //It's impossible to add a function to sub shape
//if(nb == 1 && theGUID == GetSubShapeID()) return NULL; //It's impossible to add a function to sub shape
// change by skl (+srn) for IPAL12999
if(nb == 1 && GetFunction(1)->GetDriverGUID() == GetSubShapeID()) return NULL; //It's impossible to add a function to sub shape
nb++;
TDF_Label aChild = FUNCTION_LABEL(nb);

View File

@ -788,6 +788,11 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientation (Handle(GEOM_
if (theObject.IsNull())
return NULL;
if (!theObject->IsMainShape()) {
SetErrorCode("Sub shape cannot be transformed - need to create a copy");
return NULL;
}
Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction();
if (aLastFunction.IsNull())
return NULL; //There is no function which creates an object to be processed