From: skv Date: Wed, 26 Mar 2014 09:07:43 +0000 (+0400) Subject: 0022475: EDF 2811 GEOM: Features for "Smoothing Surface" function X-Git-Tag: V7_4_0a1~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a4aaa470ae85e6bb5bfe9cdd7f9681f88ce41c96;p=modules%2Fgeom.git 0022475: EDF 2811 GEOM: Features for "Smoothing Surface" function --- diff --git a/doc/salome/gui/GEOM/images/smoothingsurface_dlg.png b/doc/salome/gui/GEOM/images/smoothingsurface_dlg.png index a92bbba8a..4605175c2 100644 Binary files a/doc/salome/gui/GEOM/images/smoothingsurface_dlg.png and b/doc/salome/gui/GEOM/images/smoothingsurface_dlg.png differ diff --git a/doc/salome/gui/GEOM/input/creating_smoothingsurface.doc b/doc/salome/gui/GEOM/input/creating_smoothingsurface.doc index 5b102a173..a16c2da58 100644 --- a/doc/salome/gui/GEOM/input/creating_smoothingsurface.doc +++ b/doc/salome/gui/GEOM/input/creating_smoothingsurface.doc @@ -5,13 +5,20 @@ To create a Smoothing Surface in the Main Menu select New Entity - > Advanced - > SmoothingSurface -Specify the \b Name of the surface and the list of \b Points, from which it is approximated and press "Apply" or "Apply & Close" button. +To create a surface it is necessary to specify the \b Name of the surface, the list of \b Points +from which it is approximated and some plate approximation parameters such as: Max nbr of +Bezier pieces, Max BSpline surface degree and Max plate criterion value. +And then press "Apply" or "Apply & Close" button. \note The dialog accepts compounds of points as well as single nodes. The result of the operation will be a GEOM_Object(Surface). -TUI Command: geompy.MakeSmoothingSurface(Points) +TUI Command: geompy.MakeSmoothingSurface(thelPoints, theNbMax, theDegMax, theDMax), where: +- \em thelPoints list of points. Compounds of points are accepted as well +- \em theNbMax maximum number of Bezier pieces in the resulting surface +- \em theDegMax maximum degree of the resulting BSpline surface +- \em theDMax specifies maximum value of the GeomPlate_PlateG0Criterion criterion \image html smoothingsurface_dlg.png diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index dcb9de5a0..921e35995 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -4694,10 +4694,16 @@ module GEOM /*! * * Create a smoothing surface from a set of points - * \param thelPoints list of points + * \param thelPoints list of points. Compounds of points are accepted as well. + * \param theNbMax maximum number of Bezier pieces in the resulting surface. + * \param theDegMax maximum degree of the resulting BSpline surface + * \param theDMax specifies maximum value of the GeomPlate_PlateG0Criterion criterion. * \return New GEOM_Object, containing the created shape. */ - GEOM_Object MakeSmoothingSurface (in ListOfGO thelPoints); + GEOM_Object MakeSmoothingSurface (in ListOfGO thelPoints, + in long theNbMax, + in long theDegMax, + in double theDMax); /*@@ insert new functions before this line @@ do not remove this line @@*/ }; diff --git a/src/AdvancedEngine/GEOMImpl_IAdvancedOperations.cxx b/src/AdvancedEngine/GEOMImpl_IAdvancedOperations.cxx index 6e535e2ac..59c4d95f8 100644 --- a/src/AdvancedEngine/GEOMImpl_IAdvancedOperations.cxx +++ b/src/AdvancedEngine/GEOMImpl_IAdvancedOperations.cxx @@ -3430,10 +3430,16 @@ Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedCylinder (double th /*! * Create a smoothing surface from a set of points * \param thelPoints list of points or compounds of points + * \param theNbMax maximum number of Bezier pieces in the resulting surface. + * \param theDegMax maximum degree of the resulting BSpline surface + * \param theDMax specifies maximum value of the GeomPlate_PlateG0Criterion criterion. * \return New GEOM_Object, containing the created shape. */ //============================================================================= -Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeSmoothingSurface (std::list thelPoints) +Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeSmoothingSurface (std::list thelPoints, + int theNbMax, + int theDegMax, + double theDMax) { SetErrorCode(KO); @@ -3462,6 +3468,9 @@ Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeSmoothingSurface (std::lis aData.SetPntOrComp(ind, aRefObj); } + aData.SetNbMax(theNbMax); + aData.SetDegMax(theDegMax); + aData.SetDMax(theDMax); //Compute the resulting value try { @@ -3487,7 +3496,10 @@ Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeSmoothingSurface (std::lis while (it != thelPoints.end()) { pd << ", " << (*it++); } - pd << "])"; + pd << "], " + << theNbMax << ", " + << theDegMax << ", " + << theDMax <<")"; SetErrorCode(OK); diff --git a/src/AdvancedEngine/GEOMImpl_IAdvancedOperations.hxx b/src/AdvancedEngine/GEOMImpl_IAdvancedOperations.hxx index 2f2367f3e..8f59a9590 100644 --- a/src/AdvancedEngine/GEOMImpl_IAdvancedOperations.hxx +++ b/src/AdvancedEngine/GEOMImpl_IAdvancedOperations.hxx @@ -236,7 +236,10 @@ public: double theH, int thePattern); - Standard_EXPORT Handle(GEOM_Object) MakeSmoothingSurface (std::list thelPoints); + Standard_EXPORT Handle(GEOM_Object) MakeSmoothingSurface (std::list thelPoints, + int theNbMax, + int theDegMax, + double theDMax); /*@@ insert new functions before this line @@ do not remove this line @@*/ }; #endif diff --git a/src/AdvancedEngine/GEOMImpl_ISmoothingSurface.hxx b/src/AdvancedEngine/GEOMImpl_ISmoothingSurface.hxx index 5cd77a502..ec3cf1a24 100644 --- a/src/AdvancedEngine/GEOMImpl_ISmoothingSurface.hxx +++ b/src/AdvancedEngine/GEOMImpl_ISmoothingSurface.hxx @@ -27,6 +27,9 @@ #define SMOOTHINGSURFACE_ARG_LENG 1 #define SMOOTHINGSURFACE_ARG_LAST 2 +#define SMOOTHINGSURFACE_ARG_NB_MAX 3 +#define SMOOTHINGSURFACE_ARG_DEG_MAX 4 +#define SMOOTHINGSURFACE_ARG_D_MAX 5 class GEOMImpl_ISmoothingSurface { @@ -39,6 +42,15 @@ public: void SetPntOrComp(int theId, Handle(GEOM_Function) theP) { _func->SetReference(SMOOTHINGSURFACE_ARG_LAST + theId, theP); } Handle(GEOM_Function) GetPntOrComp(int theId) { return _func->GetReference(SMOOTHINGSURFACE_ARG_LAST + theId); } + void SetNbMax(int theNbMax) { _func->SetInteger(SMOOTHINGSURFACE_ARG_NB_MAX, theNbMax); } + int GetNbMax() { return _func->GetInteger(SMOOTHINGSURFACE_ARG_NB_MAX); } + + void SetDegMax(int theDegMax) { _func->SetInteger(SMOOTHINGSURFACE_ARG_DEG_MAX, theDegMax); } + int GetDegMax() { return _func->GetInteger(SMOOTHINGSURFACE_ARG_DEG_MAX); } + + void SetDMax(double theDMax) { _func->SetReal(SMOOTHINGSURFACE_ARG_D_MAX, theDMax); } + double GetDMax() { return _func->GetReal(SMOOTHINGSURFACE_ARG_D_MAX); } + private: Handle(GEOM_Function) _func; }; diff --git a/src/AdvancedEngine/GEOMImpl_SmoothingSurfaceDriver.cxx b/src/AdvancedEngine/GEOMImpl_SmoothingSurfaceDriver.cxx index 662df4623..ef1b732ae 100644 --- a/src/AdvancedEngine/GEOMImpl_SmoothingSurfaceDriver.cxx +++ b/src/AdvancedEngine/GEOMImpl_SmoothingSurfaceDriver.cxx @@ -98,13 +98,17 @@ GEOMImpl_SmoothingSurfaceDriver::GEOMImpl_SmoothingSurfaceDriver() //function : MakeSmoothingSurfaceUnClosed //purpose : //======================================================================= -TopoDS_Shape GEOMImpl_SmoothingSurfaceDriver::MakeSmoothingSurfaceUnClosed(Handle_TColgp_HArray1OfPnt myListOfPoints) const +TopoDS_Shape GEOMImpl_SmoothingSurfaceDriver::MakeSmoothingSurfaceUnClosed + (const Handle_TColgp_HArray1OfPnt &theListOfPoints, + const Standard_Integer theNbMax, + const Standard_Integer theDegMax, + const Standard_Real theDMax) const { TopoDS_Face aInitShape; // Create an average Plane - //Handle(TColgp_HArray1OfPnt) HAP = new TColgp_HArray1OfPnt(1,myListOfPoints.Length()) - GeomPlate_BuildAveragePlane gpbap(myListOfPoints,myListOfPoints->Length(),Precision::Confusion(),1,1); + //Handle(TColgp_HArray1OfPnt) HAP = new TColgp_HArray1OfPnt(1,theListOfPoints.Length()) + GeomPlate_BuildAveragePlane gpbap(theListOfPoints,theListOfPoints->Length(),Precision::Confusion(),1,1); Handle(Geom_Plane) plane(gpbap.Plane()); Standard_Real Umin, Umax, Vmin, Vmax; gpbap.MinMaxBox(Umin,Umax,Vmin,Vmax); @@ -121,11 +125,11 @@ TopoDS_Shape GEOMImpl_SmoothingSurfaceDriver::MakeSmoothingSurfaceUnClosed(Handl Standard_Integer j, j1, j2; // cout << "Init surface" << endl; - j1 = myListOfPoints->Lower(); - j2 = myListOfPoints->Upper(); + j1 = theListOfPoints->Lower(); + j2 = theListOfPoints->Upper(); for (j=j1; j<=j2 ; j++) { - gp_Pnt aPnt = myListOfPoints->Value(j); + gp_Pnt aPnt = theListOfPoints->Value(j); Handle(GeomPlate_PointConstraint) PCont = new GeomPlate_PointConstraint(aPnt,0); aBuilder.Add(PCont); } @@ -136,10 +140,14 @@ TopoDS_Shape GEOMImpl_SmoothingSurfaceDriver::MakeSmoothingSurfaceUnClosed(Handl // A ce niveau : surface algo Handle(GeomPlate_Surface) gpPlate = aBuilder.Surface(); - Standard_Integer nbcarreau=2; - Standard_Integer degmax=8; - Standard_Real seuil; - seuil = Max(0.0001,10*aBuilder.G0Error()); + Standard_Integer nbcarreau = (theNbMax > 0 ? theNbMax : 2); + Standard_Integer degmax = (theDegMax > 0 ? theDegMax : 8); + Standard_Real seuil = theDMax; + + if (seuil <= 0.) { + seuil = Max(0.0001,10*aBuilder.G0Error()); + } + GeomPlate_MakeApprox Mapp(gpPlate,0.0001,nbcarreau,degmax,seuil); // cout << "Approx surface" << endl; @@ -204,9 +212,13 @@ Standard_Integer GEOMImpl_SmoothingSurfaceDriver::Execute(TFunction_Logbook& log anArrayofPnt->SetValue(i, aPnt); } + const Standard_Integer aNbMax = aData.GetNbMax(); + const Standard_Integer aDegMax = aData.GetDegMax(); + const Standard_Real aDMax = aData.GetDMax(); + // Make smoothing surface. - TopoDS_Shape aShape = - GEOMImpl_SmoothingSurfaceDriver::MakeSmoothingSurfaceUnClosed(anArrayofPnt); + TopoDS_Shape aShape = GEOMImpl_SmoothingSurfaceDriver:: + MakeSmoothingSurfaceUnClosed(anArrayofPnt, aNbMax, aDegMax, aDMax); if (aShape.IsNull()) return 0; @@ -237,11 +249,21 @@ GetCreationInformation(std::string& theOperationName, switch ( aType ) { case SMOOTHINGSURFACE_LPOINTS: - AddParam( theParams, "Points" ); - if ( aCI.GetLength() > 1 ) - theParams[0] << aCI.GetLength() << " points: "; - for ( int i = 1, nb = aCI.GetLength(); i <= nb; ++i ) - theParams[0] << aCI.GetPntOrComp( i ) << " "; + { + AddParam( theParams, "Points" ); + if ( aCI.GetLength() > 1 ) + theParams[0] << aCI.GetLength() << " points: "; + for ( int i = 1, nb = aCI.GetLength(); i <= nb; ++i ) + theParams[0] << aCI.GetPntOrComp( i ) << " "; + + const Standard_Integer aNbMax = aCI.GetNbMax(); + const Standard_Integer aDegMax = aCI.GetDegMax(); + const Standard_Real aDMax = aCI.GetDMax(); + + AddParam(theParams, "Max nbr of Bezier pieces", aCI.GetNbMax()); + AddParam(theParams, "Max BSpline surface degree", aCI.GetDegMax()); + AddParam(theParams, "Max plate criterion value", aCI.GetDMax()); + } break; default: return false; diff --git a/src/AdvancedEngine/GEOMImpl_SmoothingSurfaceDriver.hxx b/src/AdvancedEngine/GEOMImpl_SmoothingSurfaceDriver.hxx index 6887f1f29..6a22f65dc 100644 --- a/src/AdvancedEngine/GEOMImpl_SmoothingSurfaceDriver.hxx +++ b/src/AdvancedEngine/GEOMImpl_SmoothingSurfaceDriver.hxx @@ -63,7 +63,11 @@ public: DEFINE_STANDARD_RTTI( GEOMImpl_SmoothingSurfaceDriver ) private: - TopoDS_Shape MakeSmoothingSurfaceUnClosed(Handle_TColgp_HArray1OfPnt myListOfPoints) const; + TopoDS_Shape MakeSmoothingSurfaceUnClosed + (const Handle_TColgp_HArray1OfPnt &theListOfPoints, + const Standard_Integer theNbMax, + const Standard_Integer theDegMax, + const Standard_Real theDMax) const; }; #endif // _GEOMImpl_SmoothingSurfaceDriver_HXX diff --git a/src/AdvancedEngine/GEOM_IAdvancedOperations_i.cc b/src/AdvancedEngine/GEOM_IAdvancedOperations_i.cc index cd131f3ef..7ff12c39d 100644 --- a/src/AdvancedEngine/GEOM_IAdvancedOperations_i.cc +++ b/src/AdvancedEngine/GEOM_IAdvancedOperations_i.cc @@ -755,10 +755,16 @@ GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedCylinder (CORBA::Do /*! * * \param thelPoints list of points + * \param theNbMax maximum number of Bezier pieces in the resulting surface. + * \param theDegMax maximum degree of the resulting BSpline surface + * \param theDMax specifies maximum value of the GeomPlate_PlateG0Criterion criterion. * \return New GEOM_Object, containing the created shape. */ //============================================================================= -GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeSmoothingSurface (const GEOM::ListOfGO& thelPoints) +GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeSmoothingSurface (const GEOM::ListOfGO& thelPoints, + CORBA::Long theNbMax, + CORBA::Long theDegMax, + CORBA::Double theDMax) { GEOM::GEOM_Object_var aGEOMObject; @@ -775,7 +781,8 @@ GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeSmoothingSurface (const GE aPoints.push_back(aPnt); } //Create the SmoothingSurface - Handle(GEOM_Object) anObject = GetOperations()->MakeSmoothingSurface(aPoints); + Handle(GEOM_Object) anObject = GetOperations()->MakeSmoothingSurface + (aPoints, theNbMax, theDegMax, theDMax); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); diff --git a/src/AdvancedEngine/GEOM_IAdvancedOperations_i.hh b/src/AdvancedEngine/GEOM_IAdvancedOperations_i.hh index d7fa5d6a8..7f700132d 100644 --- a/src/AdvancedEngine/GEOM_IAdvancedOperations_i.hh +++ b/src/AdvancedEngine/GEOM_IAdvancedOperations_i.hh @@ -127,7 +127,10 @@ class ADVANCEDENGINE_EXPORT GEOM_IAdvancedOperations_i : GEOM::GEOM_Object_ptr MakeDividedCylinder (CORBA::Double theR, CORBA::Double theH, GEOM::pattern thePattern); - GEOM::GEOM_Object_ptr MakeSmoothingSurface (const GEOM::ListOfGO& thelPoints); + GEOM::GEOM_Object_ptr MakeSmoothingSurface (const GEOM::ListOfGO& thelPoints, + CORBA::Long theNbMax, + CORBA::Long theDegMax, + CORBA::Double theDMax); /*@@ insert new functions before this line @@ do not remove this line @@*/ ::GEOMImpl_IAdvancedOperations* GetOperations() diff --git a/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx b/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx index d8fe39809..15a5cd570 100644 --- a/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx +++ b/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx @@ -42,7 +42,10 @@ // Constructor //================================================================================= AdvancedGUI_SmoothingSurfaceDlg::AdvancedGUI_SmoothingSurfaceDlg (GeometryGUI* theGeometryGUI, QWidget* parent) - : GEOMBase_Skeleton(theGeometryGUI, parent, false) + : GEOMBase_Skeleton(theGeometryGUI, parent, false), + myNbMaxSpin(0), + myDegMaxSpin(0), + myDMaxSpin(0) { QPixmap imageOp (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_SMOOTHINGSURFACE_LPOINTS"))); QPixmap imageSel (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); @@ -65,6 +68,20 @@ AdvancedGUI_SmoothingSurfaceDlg::AdvancedGUI_SmoothingSurfaceDlg (GeometryGUI* t GroupPoints->PushButton1->setIcon( image1 ); GroupPoints->LineEdit1->setReadOnly( true ); + QLabel *aNbMax = new QLabel(tr("GEOM_SMOOTHINGSURFACE_ARG_NB_MAX")); + QLabel *aDegMax = new QLabel(tr("GEOM_SMOOTHINGSURFACE_ARG_DEG_MAX")); + QLabel *aDMax = new QLabel(tr("GEOM_SMOOTHINGSURFACE_ARG_D_MAX")); + + myNbMaxSpin = new SalomeApp_IntSpinBox(0, 1000, 1, 0, true, true); + myDegMaxSpin = new SalomeApp_IntSpinBox(0, 1000, 1, 0, true, true); + myDMaxSpin = new SalomeApp_DoubleSpinBox; + GroupPoints->gridLayout1->addWidget(aNbMax, 1, 0); + GroupPoints->gridLayout1->addWidget(aDegMax, 2, 0); + GroupPoints->gridLayout1->addWidget(aDMax, 3, 0); + GroupPoints->gridLayout1->addWidget(myNbMaxSpin, 1, 1, 1, 2); + GroupPoints->gridLayout1->addWidget(myDegMaxSpin, 2, 1, 1, 2); + GroupPoints->gridLayout1->addWidget(myDMaxSpin, 3, 1, 1, 2); + QVBoxLayout* layout = new QVBoxLayout(centralWidget()); layout->setMargin(0); layout->setSpacing(6); layout->addWidget(GroupPoints); @@ -91,7 +108,12 @@ void AdvancedGUI_SmoothingSurfaceDlg::Init() { // Get setting of step value from file configuration SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100); + + initSpinBox(myDMaxSpin, 0., COORD_MAX, 0.00001, "parametric_precision" ); + + myNbMaxSpin->setValue(2); + myDegMaxSpin->setValue(8); + myDMaxSpin->setValue(0.); //@@ initialize dialog box widgets here @@// @@ -102,7 +124,13 @@ void AdvancedGUI_SmoothingSurfaceDlg::Init() this, SLOT(SetDoubleSpinBoxStep(double))); connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - + connect(myNbMaxSpin, SIGNAL(valueChanged(const QString&)), + this, SLOT(processPreview()) ); + connect(myDegMaxSpin, SIGNAL(valueChanged(const QString&)), + this, SLOT(processPreview()) ); + connect(myDMaxSpin, SIGNAL(valueChanged(const QString&)), + this, SLOT(processPreview()) ); + initName(tr("GEOM_SMOOTHINGSURFACE")); //displayPreview(); } @@ -167,9 +195,14 @@ GEOM::GEOM_IOperations_ptr AdvancedGUI_SmoothingSurfaceDlg::createOperation() //================================================================================= bool AdvancedGUI_SmoothingSurfaceDlg::isValid (QString& msg) { - bool ok = true; + if (myPoints.empty()) { + msg += tr("GEOM_SMOOTHINGSURFACE_NO_POINTS"); + return false; + } - //@@ add custom validation actions here @@// + bool ok = myNbMaxSpin->isValid (msg, !IsPreview()) && + myDegMaxSpin->isValid(msg, !IsPreview()) && + myDMaxSpin->isValid (msg, !IsPreview()); return ok; } @@ -192,9 +225,12 @@ bool AdvancedGUI_SmoothingSurfaceDlg::execute (ObjectList& objects) for ( int i = 0; i < myPoints.count(); i++ ) points[i] = myPoints[i].copy(); + const int aNbMax = myNbMaxSpin->value(); + const int aDegMax = myDegMaxSpin->value(); + const double aDMax = myDMaxSpin->value(); // call engine function - anObj = anOper->MakeSmoothingSurface(points); + anObj = anOper->MakeSmoothingSurface(points, aNbMax, aDegMax, aDMax); res = !anObj->_is_nil(); if (res && !IsPreview()) { diff --git a/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.h b/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.h index c12ab5173..822d2aa0f 100644 --- a/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.h +++ b/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.h @@ -26,6 +26,7 @@ #include class DlgRef_1Sel; +class SalomeApp_IntSpinBox; //================================================================================= // class : AdvancedGUI_SmoothingSurfaceDlg @@ -53,6 +54,9 @@ private: private: DlgRef_1Sel* GroupPoints; QList myPoints; + SalomeApp_IntSpinBox *myNbMaxSpin; + SalomeApp_IntSpinBox *myDegMaxSpin; + SalomeApp_DoubleSpinBox *myDMaxSpin; private slots: void ClickOnOk(); diff --git a/src/AdvancedGUI/AdvancedGUI_msg_en.ts b/src/AdvancedGUI/AdvancedGUI_msg_en.ts index 2aab6e88a..3e6b28602 100644 --- a/src/AdvancedGUI/AdvancedGUI_msg_en.ts +++ b/src/AdvancedGUI/AdvancedGUI_msg_en.ts @@ -287,11 +287,27 @@ GEOM_SMOOTHINGSURFACE_ARG - Nodes + Arguments GEOM_SMOOTHINGSURFACE_ARG_POINTS Points + + GEOM_SMOOTHINGSURFACE_ARG_NB_MAX + Max nbr of Bezier pieces + + + GEOM_SMOOTHINGSURFACE_ARG_DEG_MAX + Max BSpline surface degree + + + GEOM_SMOOTHINGSURFACE_ARG_D_MAX + Max plate criterion value + + + GEOM_SMOOTHINGSURFACE_NO_POINTS + No points selected + diff --git a/src/GEOM_I_Superv/GEOM_Superv_i.cc b/src/GEOM_I_Superv/GEOM_Superv_i.cc index 71e38f9d2..792cbe5ae 100644 --- a/src/GEOM_I_Superv/GEOM_Superv_i.cc +++ b/src/GEOM_I_Superv/GEOM_Superv_i.cc @@ -3516,7 +3516,7 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSmoothingSurface (GEOM::GEOM_List_ptr t if (GEOM_List_i* aListImplP = dynamic_cast*>(GetServant(thelPoints, myPOA).in())) { getCurvesOp(); - GEOM::GEOM_Object_ptr anObj = myAdvancedOp->MakeSmoothingSurface(aListImplP->GetList()); + GEOM::GEOM_Object_ptr anObj = myAdvancedOp->MakeSmoothingSurface(aListImplP->GetList(), 2, 8, 0.); endService( " GEOM_Superv_i::MakeSmoothingSurface" ); return anObj; } diff --git a/src/GEOM_SWIG/geomBuilder.py b/src/GEOM_SWIG/geomBuilder.py old mode 100755 new mode 100644 index 34fe54d71..c269bc765 --- a/src/GEOM_SWIG/geomBuilder.py +++ b/src/GEOM_SWIG/geomBuilder.py @@ -12631,12 +12631,41 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): ## Create a surface from a cloud of points # @param thelPoints list of points. Compounds of points are # accepted as well. + # @param theNbMax maximum number of Bezier pieces in the resulting + # surface. + # @param theDegMax maximum degree of the resulting BSpline surface. + # @param theDMax specifies maximum value of the + # GeomPlate_PlateG0Criterion criterion. + # @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. # @return New GEOM_Object, containing the created shape. # # @ref tui_creation_smoothingsurface "Example" - def MakeSmoothingSurface(self, thelPoints): - anObj = self.AdvOp.MakeSmoothingSurface(thelPoints) + def MakeSmoothingSurface(self, thelPoints, theNbMax=2, theDegMax=8, + theDMax=0.0, theName=None): + """ + Create a surface from a cloud of points + + Parameters: + thelPoints list of points. Compounds of points are + accepted as well. + theNbMax maximum number of Bezier pieces in the resulting + surface. + theDegMax maximum degree of the resulting BSpline surface. + theDMax specifies maximum value of the + GeomPlate_PlateG0Criterion criterion. + 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. + + Returns: + New GEOM_Object, containing the created shape. + """ + anObj = self.AdvOp.MakeSmoothingSurface + (thelPoints, theNbMax, theDegMax, theDMax) RaiseIfFailed("MakeSmoothingSurface", self.AdvOp) + self._autoPublish(anObj, theName, "smoothing") return anObj ## Export a shape to XAO format