From bb8f8d4647d7feeb60466897cbb73f7d3bdae951 Mon Sep 17 00:00:00 2001 From: tomate44 Date: Mon, 22 Aug 2022 09:04:31 +0200 Subject: [PATCH] [Part] Change BSplineCurve/Surface setBounds() method name to scaleKnotsToBounds() --- src/Mod/Part/App/BSplineCurvePy.xml | 8 ++++---- src/Mod/Part/App/BSplineCurvePyImp.cpp | 4 ++-- src/Mod/Part/App/BSplineSurfacePy.xml | 8 ++++---- src/Mod/Part/App/BSplineSurfacePyImp.cpp | 4 ++-- src/Mod/Part/App/Geometry.cpp | 4 ++-- src/Mod/Part/App/Geometry.h | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Mod/Part/App/BSplineCurvePy.xml b/src/Mod/Part/App/BSplineCurvePy.xml index 5fa29e2305..f857240f31 100644 --- a/src/Mod/Part/App/BSplineCurvePy.xml +++ b/src/Mod/Part/App/BSplineCurvePy.xml @@ -464,12 +464,12 @@ from the knots table of this B-Spline curve. - + - Changes the bounds of the curve. - The geometry is not modified. - bspline_curve.setBounds(u0, u1) + Scales the knots list to fit the specified bounds. + The shape of the curve is not modified. + bspline_curve.scaleKnotsToBounds(u0, u1) Default arguments are (0.0, 1.0) diff --git a/src/Mod/Part/App/BSplineCurvePyImp.cpp b/src/Mod/Part/App/BSplineCurvePyImp.cpp index 74733720fc..bb4e8fb0d3 100644 --- a/src/Mod/Part/App/BSplineCurvePyImp.cpp +++ b/src/Mod/Part/App/BSplineCurvePyImp.cpp @@ -1392,7 +1392,7 @@ PyObject* BSplineCurvePy::makeC1Continuous(PyObject *args) } } -PyObject* BSplineCurvePy::setBounds(PyObject *args) +PyObject* BSplineCurvePy::scaleKnotsToBounds(PyObject *args) { double u0=0.0; double u1=1.0; @@ -1404,7 +1404,7 @@ PyObject* BSplineCurvePy::setBounds(PyObject *args) return nullptr;; } GeomBSplineCurve* curve = getGeomBSplineCurvePtr(); - curve->setBounds(u0, u1); + curve->scaleKnotsToBounds(u0, u1); Py_Return; } catch (Standard_Failure& e) { diff --git a/src/Mod/Part/App/BSplineSurfacePy.xml b/src/Mod/Part/App/BSplineSurfacePy.xml index 8c6352ae7c..9a29e0363a 100644 --- a/src/Mod/Part/App/BSplineSurfacePy.xml +++ b/src/Mod/Part/App/BSplineSurfacePy.xml @@ -729,12 +729,12 @@ - + - Changes the U and V parametric bounds of the surface. - The geometry is not modified. - bspline_surf.setBounds(u0, u1, v0, v1) + Scales the U and V knots lists to fit the specified bounds. + The shape of the surface is not modified. + bspline_surf.scaleKnotsToBounds(u0, u1, v0, v1) Default arguments are 0.0, 1.0, 0.0, 1.0 diff --git a/src/Mod/Part/App/BSplineSurfacePyImp.cpp b/src/Mod/Part/App/BSplineSurfacePyImp.cpp index 12b0a12e2a..86842398f8 100644 --- a/src/Mod/Part/App/BSplineSurfacePyImp.cpp +++ b/src/Mod/Part/App/BSplineSurfacePyImp.cpp @@ -1680,7 +1680,7 @@ Py::List BSplineSurfacePy::getVKnotSequence(void) const return list; } -PyObject* BSplineSurfacePy::setBounds(PyObject *args) +PyObject* BSplineSurfacePy::scaleKnotsToBounds(PyObject *args) { double u0=0.0; double u1=1.0; @@ -1695,7 +1695,7 @@ PyObject* BSplineSurfacePy::setBounds(PyObject *args) return nullptr;; } GeomBSplineSurface* surf = getGeomBSplineSurfacePtr(); - surf->setBounds(u0, u1, v0, v1); + surf->scaleKnotsToBounds(u0, u1, v0, v1); Py_Return; } catch (Standard_Failure& e) { diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp index 2f352f7691..118f0bb16b 100644 --- a/src/Mod/Part/App/Geometry.cpp +++ b/src/Mod/Part/App/Geometry.cpp @@ -1616,7 +1616,7 @@ void GeomBSplineCurve::Trim(double u, double v) } } -void GeomBSplineCurve::setBounds(double u0, double u1) +void GeomBSplineCurve::scaleKnotsToBounds(double u0, double u1) { try { Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast(myCurve->Copy()); @@ -4478,7 +4478,7 @@ Geometry *GeomBSplineSurface::copy() const return newSurf; } -void GeomBSplineSurface::setBounds(double u0, double u1, double v0, double v1) +void GeomBSplineSurface::scaleKnotsToBounds(double u0, double u1, double v0, double v1) { try { Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast(mySurface->Copy()); diff --git a/src/Mod/Part/App/Geometry.h b/src/Mod/Part/App/Geometry.h index b7661a673b..84df0bb2e8 100644 --- a/src/Mod/Part/App/Geometry.h +++ b/src/Mod/Part/App/Geometry.h @@ -317,7 +317,7 @@ public: bool removeKnot(int index, int multiplicity, double tolerance = Precision::PConfusion()); void Trim(double u, double v); - void setBounds(double u0, double u1); + void scaleKnotsToBounds(double u0, double u1); // Persistence implementer --------------------- unsigned int getMemSize() const override; @@ -845,7 +845,7 @@ public: ~GeomBSplineSurface() override; Geometry *copy() const override; - void setBounds(double u0, double u1, double v0, double v1); + void scaleKnotsToBounds(double u0, double u1, double v0, double v1); // Persistence implementer --------------------- unsigned int getMemSize() const override; void Save(Base::Writer &/*writer*/) const override;