From: eap Date: Wed, 20 Jun 2012 09:40:26 +0000 (+0000) Subject: 0021672: [CEA 565] Dump Study from script X-Git-Tag: V6_6_0a1~112 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c83df1846ee44b2997c0d4cbb31eb8e5182efe8d;p=modules%2Fgeom.git 0021672: [CEA 565] Dump Study from script Standard_EXPORT Handle(GEOM_Function) AddFunction(const Standard_GUID& theGUID, int theFunctionType, + bool allowSubShape=false); --- diff --git a/src/GEOM/GEOM_Object.cxx b/src/GEOM/GEOM_Object.cxx index 19c7b7ebb..88ca1b7b1 100644 --- a/src/GEOM/GEOM_Object.cxx +++ b/src/GEOM/GEOM_Object.cxx @@ -542,10 +542,12 @@ bool GEOM_Object::IsMainShape() * AddFunction */ //============================================================================= -Handle(GEOM_Function) GEOM_Object::AddFunction(const Standard_GUID& theGUID, int theFunctionType) +Handle(GEOM_Function) GEOM_Object::AddFunction(const Standard_GUID& theGUID, + int theFunctionType, + bool allowSubShape) { Standard_Integer nb = GetNbFunctions(); - if(nb == 1 && theGUID == GetSubShapeID()) return NULL; //It's impossible to add a function to sub-shape + if(!allowSubShape && nb == 1 && theGUID == GetSubShapeID()) return NULL; //It's impossible to add a function to sub-shape nb++; TDF_Label aChild = FUNCTION_LABEL(nb); diff --git a/src/GEOM/GEOM_Object.hxx b/src/GEOM/GEOM_Object.hxx index dbb10717f..a913fb4f7 100644 --- a/src/GEOM/GEOM_Object.hxx +++ b/src/GEOM/GEOM_Object.hxx @@ -279,7 +279,9 @@ class GEOM_Object : public MMgt_TShared //Adds a function with a driver GUID = theGUID and a type theFunctionType //to the function tree of this GEOM_Object - Standard_EXPORT Handle(GEOM_Function) AddFunction(const Standard_GUID& theGUID, int theFunctionType); + Standard_EXPORT Handle(GEOM_Function) AddFunction(const Standard_GUID& theGUID, + int theFunctionType, + bool allowSubShape=false); //Returns a number of functions of this GEOM_Object Standard_EXPORT int GetNbFunctions();