Standard_EXPORT Handle(GEOM_Function) AddFunction(const Standard_GUID& theGUID,
int theFunctionType,
+ bool allowSubShape=false);
* 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);
//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();