From: mpa Date: Fri, 27 Mar 2015 12:46:09 +0000 (+0300) Subject: INT PAL 0052642: Notebook variables are not dumped to script with Fillet1D, Fillet2D... X-Git-Tag: V7_6_0a1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=55bf84458bad08a70800a13336a06be37cffc1eb;p=modules%2Fgeom.git INT PAL 0052642: Notebook variables are not dumped to script with Fillet1D, Fillet2D operations (improved) --- diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index eaea44370..42d188d54 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -1711,13 +1711,15 @@ module GEOM * \param theHeight Prism dimension along the normal of the face. * \param theAngle Draft angel in degrees * \param theFuse If true material is added else material is removed + * \param theInvert If true material changes the direction * \return New GEOM_Object, containing the modified shape */ GEOM_Object MakeDraftPrism (in GEOM_Object theInitShape, in GEOM_Object theBase, in double theHeight, in double theAngle, - in boolean theFuse); + in boolean theFuse, + in boolean theInvert); /*! * \brief Create a shape by extrusion of the base shape along @@ -1865,13 +1867,15 @@ module GEOM * It can be empty. * \param theThickness Value of the thickness * \param isCopy To make a copy of \a theObject or to modify \a theObject + * \param isInside If true the thickness is applied towards inside * \return New GEOM_Object, containing the created pipe if isCopy = true * or the modified object if isCopy = false */ GEOM_Object MakeThickening (in GEOM_Object theObject, in ListOfLong theFacesIDs, in double theThickness, - in boolean isCopy); + in boolean isCopy, + in boolean isInside); /*! diff --git a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx index 6cc3e28d9..eb9eb15aa 100644 --- a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx @@ -1367,7 +1367,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ2Ways */ //============================================================================= Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDraftPrism - (Handle(GEOM_Object) theInitShape ,Handle(GEOM_Object) theBase, double theHeight, double theAngle, bool theFuse) + (Handle(GEOM_Object) theInitShape ,Handle(GEOM_Object) theBase, double theHeight, double theAngle, bool theFuse, bool theInvert) { SetErrorCode(KO); @@ -1410,6 +1410,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDraftPrism aCI.SetFuseFlag(1); else aCI.SetFuseFlag(0); + aCI.SetInvertFlag(theInvert); //Compute the Draft Prism Feature value try { @@ -1426,16 +1427,20 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDraftPrism } //Make a Python command + GEOM::TPythonDump pd (aFunction); if(theFuse) { - GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakeExtrudedBoss(" - << theInitShape << ", " << theBase << ", " << theHeight << ", " << theAngle << ")"; + pd << aPrism << " = geompy.MakeExtrudedBoss(" << theInitShape << ", " << theBase << ", " + << theHeight << ", " << theAngle; } else { - GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakeExtrudedCut(" - << theInitShape << ", " << theBase << ", " << theHeight << ", " << theAngle << ")"; + pd << aPrism << " = geompy.MakeExtrudedCut(" << theInitShape << ", " << theBase << ", " + << theHeight << ", " << theAngle; } + if (theInvert) + pd << ", " << theInvert; + pd << ")"; SetErrorCode(OK); return aPrism; @@ -2291,7 +2296,8 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThickening (Handle(GEOM_Object) theObject, const Handle(TColStd_HArray1OfInteger) &theFacesIDs, double theOffset, - bool isCopy) + bool isCopy, + bool theInside) { SetErrorCode(KO); @@ -2320,6 +2326,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThickening GEOMImpl_IOffset aTI (aFunction); aTI.SetShape(anOriginal); aTI.SetValue(theOffset); + aTI.SetParam(theInside); if (theFacesIDs.IsNull() == Standard_False) { aTI.SetFaceIDs(theFacesIDs); @@ -2352,19 +2359,21 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThickening aResult = theObject; } + pd << ", ["; if (theFacesIDs.IsNull() == Standard_False) { // Dump faces IDs. Standard_Integer i; - pd << ", ["; - for (i = theFacesIDs->Lower(); i < theFacesIDs->Upper(); ++i) { pd << theFacesIDs->Value(i) << ", "; } - // Dump the last value. - pd << theFacesIDs->Value(i) << "]"; + pd << theFacesIDs->Value(i); } + pd << "]"; + + if (theInside) + pd << ", " << theInside; pd << ")"; SetErrorCode(OK); diff --git a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx index 3de3f3240..80c8ff4f8 100644 --- a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx @@ -96,7 +96,7 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations { double theDX, double theDY, double theDZ); Standard_EXPORT Handle(GEOM_Object) MakeDraftPrism (Handle(GEOM_Object) theInitShape, Handle(GEOM_Object) theBase, - double theHeight, double theAngle, bool theFuse); + double theHeight, double theAngle, bool theFuse, bool theInvert = false ); Standard_EXPORT Handle(GEOM_Object) MakePipe (Handle(GEOM_Object) theBase, Handle(GEOM_Object) thePath); @@ -148,7 +148,8 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations { (Handle(GEOM_Object) theObject, const Handle(TColStd_HArray1OfInteger) &theFacesIDs, double theOffset, - bool isCopy); + bool isCopy, + bool theInside = false); Standard_EXPORT Handle(GEOM_Object) RestorePath (Handle(GEOM_Object) theShape, Handle(GEOM_Object) theBase1, diff --git a/src/GEOMImpl/GEOMImpl_IOffset.hxx b/src/GEOMImpl/GEOMImpl_IOffset.hxx index dfddeb2b2..82c8bc5fe 100644 --- a/src/GEOMImpl/GEOMImpl_IOffset.hxx +++ b/src/GEOMImpl/GEOMImpl_IOffset.hxx @@ -28,6 +28,7 @@ #define OFF_ARG_SHAPE 1 #define OFF_ARG_VALUE 2 #define OFF_ARG_IDS 3 +#define OFF_ARG_PARAM 4 class GEOMImpl_IOffset { @@ -43,6 +44,10 @@ class GEOMImpl_IOffset double GetValue() { return _func->GetReal(OFF_ARG_VALUE); } + void SetParam(Standard_Boolean theParam) { _func->SetInteger(OFF_ARG_PARAM, theParam ? 1 : 0); } + + Standard_Boolean GetParam() { return _func->GetInteger(OFF_ARG_PARAM); } + void SetFaceIDs(const Handle(TColStd_HArray1OfInteger)& theFaceIDs) { _func->SetIntegerArray(OFF_ARG_IDS, theFaceIDs); } diff --git a/src/GEOMImpl/GEOMImpl_IPrism.hxx b/src/GEOMImpl/GEOMImpl_IPrism.hxx index 523a836c1..4153cc29f 100644 --- a/src/GEOMImpl/GEOMImpl_IPrism.hxx +++ b/src/GEOMImpl/GEOMImpl_IPrism.hxx @@ -38,6 +38,7 @@ #define PRISM_ARG_FUSE 11 #define PRISM_ARG_INIT 12 #define PRISM_ARG_MODE 13 +#define PRISM_ARG_INVERT 14 class GEOMImpl_IPrism { @@ -75,9 +76,11 @@ class GEOMImpl_IPrism void SetFuseFlag(int theFlag) { _func->SetInteger(PRISM_ARG_FUSE, theFlag); } // void SetMode(GEOMImpl_Mode theMode) { _func->SetInteger(PRISM_ARG_MODE, theMode); } //TEST + void SetInvertFlag(Standard_Boolean theInvert) { _func->SetInteger(PRISM_ARG_INVERT, theInvert ? 1 : 0);} int GetFuseFlag() { return _func->GetInteger(PRISM_ARG_FUSE); } // GEOMImpl_Mode GetMode() { return _func->GetInteger(PRISM_ARG_MODE); } //TEST + Standard_Boolean GetInvertFlag() { return _func->GetInteger(PRISM_ARG_INVERT); } private: diff --git a/src/GEOMImpl/GEOMImpl_OffsetDriver.cxx b/src/GEOMImpl/GEOMImpl_OffsetDriver.cxx index 495d6294e..da393a67e 100644 --- a/src/GEOMImpl/GEOMImpl_OffsetDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_OffsetDriver.cxx @@ -73,8 +73,12 @@ Standard_Integer GEOMImpl_OffsetDriver::Execute(TFunction_Logbook& log) const Handle(GEOM_Function) aRefShape = aCI.GetShape(); TopoDS_Shape aShapeBase = aRefShape->GetValue(); Standard_Real anOffset = aCI.GetValue(); + Standard_Boolean isInside = aCI.GetParam(); Standard_Real aTol = Precision::Confusion(); + if (isInside) + anOffset = -anOffset; + if (Abs(anOffset) < aTol) { TCollection_AsciiString aMsg ("Absolute value of offset can not be less than the tolerance value ("); aMsg += TCollection_AsciiString(aTol); @@ -208,7 +212,7 @@ GetCreationInformation(std::string& theOperationName, case OFFSET_THICKENING_COPY: theOperationName = "MakeThickening"; AddParam( theParams, "Object", aCI.GetShape() ); - AddParam( theParams, "Offset", aCI.GetValue() ); + AddParam( theParams, "Offset", aCI.GetParam() ? -aCI.GetValue() : aCI.GetValue() ); { Handle(TColStd_HArray1OfInteger) aFacesIDs = aCI.GetFaceIDs(); diff --git a/src/GEOMImpl/GEOMImpl_PrismDriver.cxx b/src/GEOMImpl/GEOMImpl_PrismDriver.cxx index 205a130cf..52f6d2109 100644 --- a/src/GEOMImpl/GEOMImpl_PrismDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_PrismDriver.cxx @@ -196,6 +196,7 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const Standard_Real aHeight = aCI.GetH(); // Height of the extrusion Standard_Real anAngle = aCI.GetDraftAngle(); // Draft angle Standard_Boolean isProtrusion = (aCI.GetFuseFlag()==1); + Standard_Boolean isInvert = aCI.GetInvertFlag(); // Flag to know wether the feature is a protrusion (fuse) or a depression (cut) // history of the Base wire (RefBase) @@ -217,7 +218,7 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const if(!aSuppObj.IsNull()) // If the wire has a support aSupport = aSuppObj->GetValue(); - aShape = MakeDraftPrism(anInitShape, aSketch, aHeight, anAngle, isProtrusion, aSupport); + aShape = MakeDraftPrism(anInitShape, aSketch, aHeight, anAngle, isProtrusion, aSupport, isInvert); } if (aShape.IsNull()) return 0; @@ -411,7 +412,8 @@ TopoDS_Shape GEOMImpl_PrismDriver::MakeDraftPrism ( const TopoDS_Shape& theInitS const Standard_Real theHeight, const Standard_Real theAngle, bool isProtrusion, - const TopoDS_Shape& theSupport) + const TopoDS_Shape& theSupport, + bool isInvert) { TopoDS_Shape aShape; @@ -470,11 +472,11 @@ TopoDS_Shape GEOMImpl_PrismDriver::MakeDraftPrism ( const TopoDS_Shape& theInitS } // Invert height and angle if the operation is an extruded cut - bool invert = !isProtrusion; + bool invert = isInvert? isProtrusion : !isProtrusion; // If the face has a reversed orientation invert for extruded boss operations if(aFaceBase.Orientation() == TopAbs_REVERSED) - invert = isProtrusion; + invert = !invert; Standard_Real anAngle = theAngle; Standard_Real aHeight = theHeight; diff --git a/src/GEOMImpl/GEOMImpl_PrismDriver.hxx b/src/GEOMImpl/GEOMImpl_PrismDriver.hxx index 529d91afe..2d7715578 100644 --- a/src/GEOMImpl/GEOMImpl_PrismDriver.hxx +++ b/src/GEOMImpl/GEOMImpl_PrismDriver.hxx @@ -93,7 +93,8 @@ public: const Standard_Real theHeight, const Standard_Real theAngle, bool isProtrusion, - const TopoDS_Shape& theSupport); + const TopoDS_Shape& theSupport, + bool isInvert = false); Standard_EXPORT virtual bool GetCreationInformation(std::string& theOperationName, diff --git a/src/GEOM_I/GEOM_I3DPrimOperations_i.cc b/src/GEOM_I/GEOM_I3DPrimOperations_i.cc index 3a67fc182..66e4b809f 100644 --- a/src/GEOM_I/GEOM_I3DPrimOperations_i.cc +++ b/src/GEOM_I/GEOM_I3DPrimOperations_i.cc @@ -766,7 +766,8 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDraftPrism (GEOM::GEOM_Object_ptr theInitShape, GEOM::GEOM_Object_ptr theBase, CORBA::Double theHeight, CORBA::Double theAngle, - CORBA::Boolean theFuse) + CORBA::Boolean theFuse, + CORBA::Boolean theInvert) { GEOM::GEOM_Object_var aGEOMObject; @@ -780,7 +781,7 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDraftPrism if (aBase.IsNull() || aInit.IsNull()) return aGEOMObject._retn(); //Create the Prism - Handle(GEOM_Object) anObject = GetOperations()->MakeDraftPrism(aInit, aBase, theHeight, theAngle, theFuse); + Handle(GEOM_Object) anObject = GetOperations()->MakeDraftPrism(aInit, aBase, theHeight, theAngle, theFuse, theInvert); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -1187,7 +1188,8 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThickening (GEOM::GEOM_Object_ptr theObject, const GEOM::ListOfLong &theFacesIDs, CORBA::Double theOffset, - CORBA::Boolean doCopy) + CORBA::Boolean doCopy, + CORBA::Boolean theInside) { GEOM::GEOM_Object_var aGEOMObject; //Set a not done flag @@ -1225,7 +1227,7 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThickening if (doCopy) { Handle(GEOM_Object) anObject = GetOperations()->MakeThickening( - aBasicObject, aFaceIDs, theOffset, doCopy); + aBasicObject, aFaceIDs, theOffset, doCopy, theInside); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -1233,7 +1235,7 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThickening } else { - GetOperations()->MakeThickening(aBasicObject, aFaceIDs, theOffset, doCopy); + GetOperations()->MakeThickening(aBasicObject, aFaceIDs, theOffset, doCopy, theInside); // Update GUI. UpdateGUIForObject(theObject); diff --git a/src/GEOM_I/GEOM_I3DPrimOperations_i.hh b/src/GEOM_I/GEOM_I3DPrimOperations_i.hh index ab2f135f0..733e62833 100644 --- a/src/GEOM_I/GEOM_I3DPrimOperations_i.hh +++ b/src/GEOM_I/GEOM_I3DPrimOperations_i.hh @@ -153,7 +153,8 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i : GEOM::GEOM_Object_ptr theBase, CORBA::Double theHeight, CORBA::Double theAngle, - CORBA::Boolean theFuse); + CORBA::Boolean theFuse, + CORBA::Boolean theInvert); GEOM::GEOM_Object_ptr MakePipe (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr thePath); @@ -201,7 +202,8 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i : GEOM::GEOM_Object_ptr MakeThickening (GEOM::GEOM_Object_ptr theObject, const GEOM::ListOfLong &theFacesIDs, CORBA::Double theOffset, - CORBA::Boolean isCopy); + CORBA::Boolean isCopy, + CORBA::Boolean theInside); GEOM::GEOM_Object_ptr RestorePath (GEOM::GEOM_Object_ptr theShape, GEOM::GEOM_Object_ptr theBase1, diff --git a/src/GEOM_SWIG/geomBuilder.py b/src/GEOM_SWIG/geomBuilder.py index e5c2bd608..fabb95341 100644 --- a/src/GEOM_SWIG/geomBuilder.py +++ b/src/GEOM_SWIG/geomBuilder.py @@ -4149,6 +4149,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): # @param theFacesIDs the list of face IDs to be removed from the # result. It is ignored if \a theShape is a face or a shell. # It is empty by default. + # @param theInside If true the thickness is applied towards inside # @param theName Object name; when specified, this parameter is used # for result publication in the study. Otherwise, if automatic # publication is switched on, default value is used for result name. @@ -4158,7 +4159,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): # @ref tui_creation_thickness "Example" @ManageTransactions("PrimOp") def MakeThickSolid(self, theShape, theThickness, - theFacesIDs=[], theName=None): + theFacesIDs=[], theInside=False, theName=None): """ Make a thick solid from a shape. If the input is a surface shape (face or shell) the result is a thick solid. If an input shape is @@ -4171,6 +4172,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): theFacesIDs the list of face IDs to be removed from the result. It is ignored if theShape is a face or a shell. It is empty by default. + theInside If true the thickness is applied towards inside theName Object name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name. @@ -4179,9 +4181,11 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): New GEOM.GEOM_Object, containing the created solid """ # Example: see GEOM_TestAll.py + theThickness,Parameters = ParseParameters(theThickness) anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs, - theThickness, True) + theThickness, True, theInside) RaiseIfFailed("MakeThickSolid", self.PrimOp) + anObj.SetParameters(Parameters) self._autoPublish(anObj, theName, "thickSolid") return anObj @@ -4195,12 +4199,13 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): # @param theFacesIDs the list of face IDs to be removed from the # result. It is ignored if \a theShape is a face or a shell. # It is empty by default. + # @param theInside If true the thickness is applied towards inside # # @return The modified shape # # @ref tui_creation_thickness "Example" @ManageTransactions("PrimOp") - def Thicken(self, theShape, theThickness, theFacesIDs=[]): + def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False): """ Modifies a shape to make it a thick solid. If the input is a surface shape (face or shell) the result is a thick solid. If @@ -4214,14 +4219,17 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): theFacesIDs the list of face IDs to be removed from the result. It is ignored if \a theShape is a face or a shell. It is empty by default. + theInside If true the thickness is applied towards inside Returns: The modified shape """ # Example: see GEOM_TestAll.py + theThickness,Parameters = ParseParameters(theThickness) anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs, - theThickness, False) + theThickness, False, theInside) RaiseIfFailed("Thicken", self.PrimOp) + anObj.SetParameters(Parameters) return anObj ## Build a middle path of a pipe-like shape. @@ -5835,8 +5843,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): Returns: New GEOM.GEOM_Object, containing the created edge. """ + theMin, theMax, Parameters = ParseParameters(theMin, theMax) anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax) RaiseIfFailed("ExtendEdge", self.ShapesOp) + anObj.SetParameters(Parameters) self._autoPublish(anObj, theName, "edge") return anObj @@ -5883,9 +5893,11 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): Returns: New GEOM.GEOM_Object, containing the created face. """ + theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax) anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax, theVMin, theVMax) RaiseIfFailed("ExtendFace", self.ShapesOp) + anObj.SetParameters(Parameters) self._autoPublish(anObj, theName, "face") return anObj @@ -10059,6 +10071,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): # @param theBase Closed edge or wire defining the base shape to be extruded. # @param theH Prism dimension along the normal to theBase # @param theAngle Draft angle in degrees. + # @param theInvert If true material changes the direction # @param theName Object name; when specified, this parameter is used # for result publication in the study. Otherwise, if automatic # publication is switched on, default value is used for result name. @@ -10067,7 +10080,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): # # @ref tui_creation_prism "Example" @ManageTransactions("PrimOp") - def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None): + def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None): """ Add material to a solid by extrusion of the base shape on the given distance. @@ -10076,6 +10089,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): theBase Closed edge or wire defining the base shape to be extruded. theH Prism dimension along the normal to theBase theAngle Draft angle in degrees. + theInvert If true material changes the direction. theName Object name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name. @@ -10084,10 +10098,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): New GEOM.GEOM_Object, containing the initial shape with removed material. """ # Example: see GEOM_TestAll.py - #theH,Parameters = ParseParameters(theH) - anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False) + theH,theAngle,Parameters = ParseParameters(theH,theAngle) + anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert) RaiseIfFailed("MakeExtrudedBoss", self.PrimOp) - #anObj.SetParameters(Parameters) + anObj.SetParameters(Parameters) self._autoPublish(anObj, theName, "extrudedCut") return anObj @@ -10097,6 +10111,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): # @param theBase Closed edge or wire defining the base shape to be extruded. # @param theH Prism dimension along the normal to theBase # @param theAngle Draft angle in degrees. + # @param theInvert If true material changes the direction # @param theName Object name; when specified, this parameter is used # for result publication in the study. Otherwise, if automatic # publication is switched on, default value is used for result name. @@ -10105,7 +10120,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): # # @ref tui_creation_prism "Example" @ManageTransactions("PrimOp") - def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None): + def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None): """ Add material to a solid by extrusion of the base shape on the given distance. @@ -10114,6 +10129,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): theBase Closed edge or wire defining the base shape to be extruded. theH Prism dimension along the normal to theBase theAngle Draft angle in degrees. + theInvert If true material changes the direction. theName Object name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name. @@ -10122,10 +10138,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): New GEOM.GEOM_Object, containing the initial shape with added material. """ # Example: see GEOM_TestAll.py - #theH,Parameters = ParseParameters(theH) - anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True) + theH,theAngle,Parameters = ParseParameters(theH,theAngle) + anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert) RaiseIfFailed("MakeExtrudedBoss", self.PrimOp) - #anObj.SetParameters(Parameters) + anObj.SetParameters(Parameters) self._autoPublish(anObj, theName, "extrudedBoss") return anObj diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx index ecdfae3fa..e2de72611 100644 --- a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx @@ -717,15 +717,15 @@ bool GenerationGUI_PrismDlg::execute (ObjectList& objects) if(GroupThickening->checkButton1->isChecked()) { double aThickness = GroupThickening->SpinBox_DX->value(); - if (GroupThickening->checkButton2->isChecked()) - { - aThickness = -aThickness; - } + bool isInside = GroupThickening->checkButton2->isChecked(); GEOM::ListOfLong_var anArray = new GEOM::ListOfLong; anObj = anotherOper->MakeThickening - (anObj, anArray, aThickness, /*copy=*/false); + (anObj, anArray, aThickness, /*copy=*/false, isInside); + + if (!anObj->_is_nil() && !IsPreview()) + anObj->SetParameters(GroupThickening->SpinBox_DX->text().toUtf8().constData()); } if (!anObj->_is_nil()) diff --git a/src/GenerationGUI/GenerationGUI_ThicknessDlg.cxx b/src/GenerationGUI/GenerationGUI_ThicknessDlg.cxx index f743fa631..650024b3d 100644 --- a/src/GenerationGUI/GenerationGUI_ThicknessDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_ThicknessDlg.cxx @@ -421,6 +421,7 @@ bool GenerationGUI_ThicknessDlg::execute (ObjectList& objects) GEOM::GEOM_I3DPrimOperations_var anOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation()); double aThickness = myThicknessSpin->value(); + bool anInside = myInsideCheck->isChecked(); GEOM::ListOfLong_var anObjIDsList = new GEOM::ListOfLong(); TopoDS_Shape aShape; @@ -452,14 +453,15 @@ bool GenerationGUI_ThicknessDlg::execute (ObjectList& objects) } } - if (myInsideCheck->isChecked()) { - aThickness = -aThickness; - } - anObj = anOper->MakeThickening - (myObject.get(), anObjIDsList.in(), aThickness, true); + (myObject.get(), anObjIDsList.in(), aThickness, true, anInside); if (!anObj->_is_nil()) { + if (!IsPreview()) { + QStringList aParameters; + aParameters << myThicknessSpin->text(); + anObj->SetParameters(aParameters.join(":").toUtf8().constData()); + } objects.push_back(anObj._retn()); } diff --git a/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.cxx b/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.cxx index d8d36b167..8812cd5ee 100644 --- a/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.cxx +++ b/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.cxx @@ -365,14 +365,9 @@ bool OperationGUI_ExtrudedFeatureDlg::execute (ObjectList& objects) if (myGroup->PushButton3->isChecked()) angle=myGroup->SpinBox_DY->value(); - - if (myGroup->PushButton4->isChecked()) - { - aHeight = -aHeight; - angle = -angle; - } - bool isProtrusion = (myOperation == OperationGUI::BOSS); + bool isProtrusion = (myOperation == OperationGUI::BOSS); + bool isInvert = myGroup->PushButton4->isChecked(); // Hide the initial shape in order to see the modifications on the preview erase(myObject1.get(),false); @@ -380,9 +375,18 @@ bool OperationGUI_ExtrudedFeatureDlg::execute (ObjectList& objects) GEOM::GEOM_Object_var anObj = anOper->MakeDraftPrism(myObject1.get(), myObject2.get(), aHeight, angle, - isProtrusion); - if (!anObj->_is_nil()) + isProtrusion, + isInvert); + if (!anObj->_is_nil()) { + if (!IsPreview()) { + QStringList aParameters; + aParameters << myGroup->SpinBox_DX->text(); + if (myGroup->PushButton3->isChecked()) + aParameters << myGroup->SpinBox_DY->text(); + anObj->SetParameters(aParameters.join(":").toLatin1().constData()); + } objects.push_back(anObj._retn()); + } return true; } diff --git a/src/TransformationGUI/TransformationGUI_ExtensionDlg.cxx b/src/TransformationGUI/TransformationGUI_ExtensionDlg.cxx index 41f453063..130060b9d 100644 --- a/src/TransformationGUI/TransformationGUI_ExtensionDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ExtensionDlg.cxx @@ -390,6 +390,13 @@ bool TransformationGUI_ExtensionDlg::execute(ObjectList& objects) case 0: anObj = anOper->ExtendEdge(myBase.get(), myUMinSpinBox->value(), myUMaxSpinBox->value()); + if (!anObj->_is_nil() && !IsPreview()) + { + QStringList aParameters; + aParameters << myUMinSpinBox->text(); + aParameters << myUMaxSpinBox->text(); + anObj->SetParameters(aParameters.join(":").toUtf8().constData()); + } res = true; break; case 1: @@ -397,6 +404,15 @@ bool TransformationGUI_ExtensionDlg::execute(ObjectList& objects) myUMaxSpinBox->value(), myVMinSpinBox->value(), myVMaxSpinBox->value()); + if (!anObj->_is_nil() && !IsPreview()) + { + QStringList aParameters; + aParameters << myUMinSpinBox->text(); + aParameters << myUMaxSpinBox->text(); + aParameters << myVMinSpinBox->text(); + aParameters << myVMaxSpinBox->text(); + anObj->SetParameters(aParameters.join(":").toUtf8().constData()); + } res = true; break; default: