From c83df1846ee44b2997c0d4cbb31eb8e5182efe8d Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 20 Jun 2012 09:40:26 +0000 Subject: [PATCH] 0021672: [CEA 565] Dump Study from script Standard_EXPORT Handle(GEOM_Function) AddFunction(const Standard_GUID& theGUID, int theFunctionType, + bool allowSubShape=false); --- src/GEOM/GEOM_Object.cxx | 6 ++++-- src/GEOM/GEOM_Object.hxx | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) 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(); -- 2.39.2