0021672: [CEA 565] Dump Study from script

Standard_EXPORT Handle(GEOM_Function) AddFunction(const Standard_GUID& theGUID,
                                                     int                  theFunctionType,
+                                                    bool                 allowSubShape=false);
This commit is contained in:
eap 2012-06-20 09:40:26 +00:00
parent a211d6f8bd
commit c83df1846e
2 changed files with 7 additions and 3 deletions

View File

@ -542,10 +542,12 @@ bool GEOM_Object::IsMainShape()
* AddFunction * 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(); 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++; nb++;
TDF_Label aChild = FUNCTION_LABEL(nb); TDF_Label aChild = FUNCTION_LABEL(nb);

View File

@ -279,7 +279,9 @@ class GEOM_Object : public MMgt_TShared
//Adds a function with a driver GUID = theGUID and a type theFunctionType //Adds a function with a driver GUID = theGUID and a type theFunctionType
//to the function tree of this GEOM_Object //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 //Returns a number of functions of this GEOM_Object
Standard_EXPORT int GetNbFunctions(); Standard_EXPORT int GetNbFunctions();