]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0021672: [CEA 565] Dump Study from script
authoreap <eap@opencascade.com>
Wed, 20 Jun 2012 09:40:26 +0000 (09:40 +0000)
committereap <eap@opencascade.com>
Wed, 20 Jun 2012 09:40:26 +0000 (09:40 +0000)
   Standard_EXPORT Handle(GEOM_Function) AddFunction(const Standard_GUID& theGUID,
                                                     int                  theFunctionType,
+                                                    bool                 allowSubShape=false);

src/GEOM/GEOM_Object.cxx
src/GEOM/GEOM_Object.hxx

index 19c7b7ebb3a1f06d53f0ce9148b9d012f566f62d..88ca1b7b12b3d110f7943ab8adbeedca68f0ee59 100644 (file)
@@ -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);
 
index dbb10717f7e5f092e1068f4310f1d5961946612a..a913fb4f70982c419a0d7af3a46cb1b4d04bffb5 100644 (file)
@@ -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();