From b81f654905334f798694954caec9a671070f0397 Mon Sep 17 00:00:00 2001 From: tomate44 Date: Thu, 10 Sep 2020 08:10:39 +0200 Subject: [PATCH] Part: remove uIso and vIso methods. Methods from base class GeomSurface will be used instead --- src/Mod/Part/App/BSplineSurfacePy.xml | 10 ----- src/Mod/Part/App/BSplineSurfacePyImp.cpp | 36 ---------------- src/Mod/Part/App/BezierSurfacePy.xml | 10 ----- src/Mod/Part/App/BezierSurfacePyImp.cpp | 35 ---------------- src/Mod/Part/App/ConePy.xml | 10 ----- src/Mod/Part/App/ConePyImp.cpp | 40 ------------------ src/Mod/Part/App/CylinderPy.xml | 10 ----- src/Mod/Part/App/CylinderPyImp.cpp | 53 ------------------------ src/Mod/Part/App/PlanePy.xml | 10 ----- src/Mod/Part/App/PlanePyImp.cpp | 44 -------------------- src/Mod/Part/App/SpherePy.xml | 13 ------ src/Mod/Part/App/SpherePyImp.cpp | 10 ----- src/Mod/Part/App/ToroidPy.xml | 10 ----- src/Mod/Part/App/ToroidPyImp.cpp | 38 ----------------- 14 files changed, 329 deletions(-) diff --git a/src/Mod/Part/App/BSplineSurfacePy.xml b/src/Mod/Part/App/BSplineSurfacePy.xml index 81c6b2a522..817b8d7baa 100644 --- a/src/Mod/Part/App/BSplineSurfacePy.xml +++ b/src/Mod/Part/App/BSplineSurfacePy.xml @@ -668,16 +668,6 @@ - - - Builds the U isoparametric B-Spline curve of this B-Spline surface - - - - - Builds the V isoparametric B-Spline curve of this B-Spline surface - - Returns a reparametrized copy of this surface diff --git a/src/Mod/Part/App/BSplineSurfacePyImp.cpp b/src/Mod/Part/App/BSplineSurfacePyImp.cpp index 33ae6d96a7..30d17ba837 100644 --- a/src/Mod/Part/App/BSplineSurfacePyImp.cpp +++ b/src/Mod/Part/App/BSplineSurfacePyImp.cpp @@ -1109,42 +1109,6 @@ PyObject* BSplineSurfacePy::exchangeUV(PyObject *args) Py_Return; } -PyObject* BSplineSurfacePy::uIso(PyObject * args) -{ - double u; - if (!PyArg_ParseTuple(args, "d", &u)) - return 0; - - try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast - (getGeometryPtr()->handle()); - Handle(Geom_Curve) c = surf->UIso(u); - return new BSplineCurvePy(new GeomBSplineCurve(Handle(Geom_BSplineCurve)::DownCast(c))); - } - catch (Standard_Failure& e) { - PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); - return 0; - } -} - -PyObject* BSplineSurfacePy::vIso(PyObject * args) -{ - double v; - if (!PyArg_ParseTuple(args, "d", &v)) - return 0; - - try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast - (getGeometryPtr()->handle()); - Handle(Geom_Curve) c = surf->VIso(v); - return new BSplineCurvePy(new GeomBSplineCurve(Handle(Geom_BSplineCurve)::DownCast(c))); - } - catch (Standard_Failure& e) { - PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); - return 0; - } -} - PyObject* BSplineSurfacePy::reparametrize(PyObject * args) { int u,v; diff --git a/src/Mod/Part/App/BezierSurfacePy.xml b/src/Mod/Part/App/BezierSurfacePy.xml index ec72c1aee9..df24314d95 100644 --- a/src/Mod/Part/App/BezierSurfacePy.xml +++ b/src/Mod/Part/App/BezierSurfacePy.xml @@ -308,15 +308,5 @@ - - - Builds the U isoparametric Bezier curve of this Bezier surface - - - - - Builds the V isoparametric Bezier curve of this Bezier surface - - diff --git a/src/Mod/Part/App/BezierSurfacePyImp.cpp b/src/Mod/Part/App/BezierSurfacePyImp.cpp index 57f38986e6..b052894b77 100644 --- a/src/Mod/Part/App/BezierSurfacePyImp.cpp +++ b/src/Mod/Part/App/BezierSurfacePyImp.cpp @@ -672,41 +672,6 @@ PyObject* BezierSurfacePy::exchangeUV(PyObject *args) } } -PyObject* BezierSurfacePy::uIso(PyObject * args) -{ - double u; - if (!PyArg_ParseTuple(args, "d", &u)) - return 0; - - try { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast - (getGeometryPtr()->handle()); - Handle(Geom_Curve) c = surf->UIso(u); - return new BezierCurvePy(new GeomBezierCurve(Handle(Geom_BezierCurve)::DownCast(c))); - } - catch (Standard_Failure& e) { - PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); - return 0; - } -} - -PyObject* BezierSurfacePy::vIso(PyObject * args) -{ - double v; - if (!PyArg_ParseTuple(args, "d", &v)) - return 0; - - try { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast - (getGeometryPtr()->handle()); - Handle(Geom_Curve) c = surf->VIso(v); - return new BezierCurvePy(new GeomBezierCurve(Handle(Geom_BezierCurve)::DownCast(c))); - } - catch (Standard_Failure& e) { - PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); - return 0; - } -} Py::Long BezierSurfacePy::getUDegree(void) const { Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast diff --git a/src/Mod/Part/App/ConePy.xml b/src/Mod/Part/App/ConePy.xml index 4a88d3910b..be5b63d638 100644 --- a/src/Mod/Part/App/ConePy.xml +++ b/src/Mod/Part/App/ConePy.xml @@ -71,15 +71,5 @@ - - - Builds the U isoparametric circle of this cone - - - - - Builds the V isoparametric circle of this cone - - diff --git a/src/Mod/Part/App/ConePyImp.cpp b/src/Mod/Part/App/ConePyImp.cpp index bed52fa0e1..0dde93d207 100644 --- a/src/Mod/Part/App/ConePyImp.cpp +++ b/src/Mod/Part/App/ConePyImp.cpp @@ -151,46 +151,6 @@ int ConePy::PyInit(PyObject* args, PyObject* kwds) return -1; } -PyObject* ConePy::uIso(PyObject * args) -{ - double u; - if (!PyArg_ParseTuple(args, "d", &u)) - return 0; - - try { - Handle(Geom_ConicalSurface) cone = Handle(Geom_ConicalSurface)::DownCast - (getGeomConePtr()->handle()); - Handle(Geom_Line) c = Handle(Geom_Line)::DownCast(cone->UIso(u)); - GeomLine* line = new GeomLine(); - Handle(Geom_Line) this_curv = Handle(Geom_Line)::DownCast - (line->handle()); - this_curv->SetLin(c->Lin()); - return new LinePy(line); - } - catch (Standard_Failure& e) { - PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); - return 0; - } -} - -PyObject* ConePy::vIso(PyObject * args) -{ - double v; - if (!PyArg_ParseTuple(args, "d", &v)) - return 0; - - try { - Handle(Geom_ConicalSurface) cone = Handle(Geom_ConicalSurface)::DownCast - (getGeomConePtr()->handle()); - Handle(Geom_Curve) c = cone->VIso(v); - return new CirclePy(new GeomCircle(Handle(Geom_Circle)::DownCast(c))); - } - catch (Standard_Failure& e) { - PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); - return 0; - } -} - Py::Object ConePy::getApex(void) const { Handle(Geom_ConicalSurface) s = Handle(Geom_ConicalSurface)::DownCast diff --git a/src/Mod/Part/App/CylinderPy.xml b/src/Mod/Part/App/CylinderPy.xml index e84c29a64c..19636c65c2 100644 --- a/src/Mod/Part/App/CylinderPy.xml +++ b/src/Mod/Part/App/CylinderPy.xml @@ -49,15 +49,5 @@ - - - Builds the U isoparametric circle of this cylinder - - - - - Builds the V isoparametric circle of this cylinder - - diff --git a/src/Mod/Part/App/CylinderPyImp.cpp b/src/Mod/Part/App/CylinderPyImp.cpp index 271a050afb..c39d80ede2 100644 --- a/src/Mod/Part/App/CylinderPyImp.cpp +++ b/src/Mod/Part/App/CylinderPyImp.cpp @@ -157,59 +157,6 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds) return -1; } -PyObject* CylinderPy::uIso(PyObject * args) -{ - double v; - if (!PyArg_ParseTuple(args, "d", &v)) - return 0; - - try { - Handle(Geom_CylindricalSurface) cyl = Handle(Geom_CylindricalSurface)::DownCast - (getGeomCylinderPtr()->handle()); - Handle(Geom_Curve) c = cyl->UIso(v); - if (!Handle(Geom_Line)::DownCast(c).IsNull()) { - GeomLine* line = new GeomLine(); - Handle(Geom_Line) this_curv = Handle(Geom_Line)::DownCast - (line->handle()); - this_curv->SetLin(Handle(Geom_Line)::DownCast(c)->Lin()); - return new LinePy(line); - } - - PyErr_SetString(PyExc_NotImplementedError, "this type of conical curve is not implemented"); - return 0; - } - catch (Standard_Failure& e) { - PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); - return 0; - } -} - -PyObject* CylinderPy::vIso(PyObject * args) -{ - double v; - if (!PyArg_ParseTuple(args, "d", &v)) - return 0; - - try { - Handle(Geom_CylindricalSurface) cyl = Handle(Geom_CylindricalSurface)::DownCast - (getGeomCylinderPtr()->handle()); - Handle(Geom_Curve) c = cyl->VIso(v); - if (!Handle(Geom_Circle)::DownCast(c).IsNull()) { - return new CirclePy(new GeomCircle(Handle(Geom_Circle)::DownCast(c))); - } - if (!Handle(Geom_Ellipse)::DownCast(c).IsNull()) { - return new EllipsePy(new GeomEllipse(Handle(Geom_Ellipse)::DownCast(c))); - } - - PyErr_SetString(PyExc_NotImplementedError, "this type of conical curve is not implemented"); - return 0; - } - catch (Standard_Failure& e) { - PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); - return 0; - } -} - Py::Float CylinderPy::getRadius(void) const { Handle(Geom_CylindricalSurface) cyl = Handle(Geom_CylindricalSurface)::DownCast diff --git a/src/Mod/Part/App/PlanePy.xml b/src/Mod/Part/App/PlanePy.xml index ae6ec9d4ff..9139c7f5ec 100644 --- a/src/Mod/Part/App/PlanePy.xml +++ b/src/Mod/Part/App/PlanePy.xml @@ -47,15 +47,5 @@ Part.Plane(A,B,C,D) - - - Builds the U isoparametric line of this plane - - - - - Builds the V isoparametric line of this plane - - diff --git a/src/Mod/Part/App/PlanePyImp.cpp b/src/Mod/Part/App/PlanePyImp.cpp index 855d48bff8..f93dc98356 100644 --- a/src/Mod/Part/App/PlanePyImp.cpp +++ b/src/Mod/Part/App/PlanePyImp.cpp @@ -255,50 +255,6 @@ void PlanePy::setAxis(Py::Object arg) } } -PyObject* PlanePy::uIso(PyObject * args) -{ - double u; - if (!PyArg_ParseTuple(args, "d", &u)) - return 0; - - try { - Handle(Geom_Plane) plane = Handle(Geom_Plane)::DownCast - (getGeomPlanePtr()->handle()); - Handle(Geom_Line) c = Handle(Geom_Line)::DownCast(plane->UIso(u)); - GeomLine* line = new GeomLine(); - Handle(Geom_Line) this_curv = Handle(Geom_Line)::DownCast - (line->handle()); - this_curv->SetLin(c->Lin()); - return new LinePy(line); - } - catch (Standard_Failure& e) { - PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); - return 0; - } -} - -PyObject* PlanePy::vIso(PyObject * args) -{ - double v; - if (!PyArg_ParseTuple(args, "d", &v)) - return 0; - - try { - Handle(Geom_Plane) plane = Handle(Geom_Plane)::DownCast - (getGeomPlanePtr()->handle()); - Handle(Geom_Line) c = Handle(Geom_Line)::DownCast(plane->VIso(v)); - GeomLine* line = new GeomLine(); - Handle(Geom_Line) this_curv = Handle(Geom_Line)::DownCast - (line->handle()); - this_curv->SetLin(c->Lin()); - return new LinePy(line); - } - catch (Standard_Failure& e) { - PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); - return 0; - } -} - PyObject *PlanePy::getCustomAttributes(const char* /*attr*/) const { return 0; diff --git a/src/Mod/Part/App/SpherePy.xml b/src/Mod/Part/App/SpherePy.xml index 3d60b16142..1484e3058c 100644 --- a/src/Mod/Part/App/SpherePy.xml +++ b/src/Mod/Part/App/SpherePy.xml @@ -45,18 +45,5 @@ - - - - Builds the U isoparametric circle of this sphere - - - - - - Builds the V isoparametric circle of this sphere -where V must be in the range [-Pi/2,Pi/2] - - diff --git a/src/Mod/Part/App/SpherePyImp.cpp b/src/Mod/Part/App/SpherePyImp.cpp index 34d6e580ef..f55e763a8e 100644 --- a/src/Mod/Part/App/SpherePyImp.cpp +++ b/src/Mod/Part/App/SpherePyImp.cpp @@ -181,16 +181,6 @@ void SpherePy::setAxis(Py::Object arg) } } -PyObject *SpherePy::uIso(PyObject *args) -{ - return GeometrySurfacePy::uIso(args); -} - -PyObject *SpherePy::vIso(PyObject *args) -{ - return GeometrySurfacePy::vIso(args); -} - PyObject *SpherePy::getCustomAttributes(const char* /*attr*/) const { return 0; diff --git a/src/Mod/Part/App/ToroidPy.xml b/src/Mod/Part/App/ToroidPy.xml index be4f1f09ca..d2ff0af68c 100644 --- a/src/Mod/Part/App/ToroidPy.xml +++ b/src/Mod/Part/App/ToroidPy.xml @@ -51,15 +51,5 @@ - - - Builds the U isoparametric circle of this toroid - - - - - Builds the V isoparametric circle of this toroid - - diff --git a/src/Mod/Part/App/ToroidPyImp.cpp b/src/Mod/Part/App/ToroidPyImp.cpp index d1897d123d..4c83fcc07c 100644 --- a/src/Mod/Part/App/ToroidPyImp.cpp +++ b/src/Mod/Part/App/ToroidPyImp.cpp @@ -66,44 +66,6 @@ int ToroidPy::PyInit(PyObject* args, PyObject* /*kwd*/) return -1; } -PyObject* ToroidPy::uIso(PyObject * args) -{ - double u; - if (!PyArg_ParseTuple(args, "d", &u)) - return 0; - - try { - Handle(Geom_ToroidalSurface) torus = Handle(Geom_ToroidalSurface)::DownCast - (getGeomToroidPtr()->handle()); - Handle(Geom_Circle) c = Handle(Geom_Circle)::DownCast(torus->UIso(u)); - return new CirclePy(new GeomCircle(c)); - } - catch (Standard_Failure& e) { - - PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); - return 0; - } -} - -PyObject* ToroidPy::vIso(PyObject * args) -{ - double v; - if (!PyArg_ParseTuple(args, "d", &v)) - return 0; - - try { - Handle(Geom_ToroidalSurface) torus = Handle(Geom_ToroidalSurface)::DownCast - (getGeomToroidPtr()->handle()); - Handle(Geom_Circle) c = Handle(Geom_Circle)::DownCast(torus->VIso(v)); - return new CirclePy(new GeomCircle(c)); - } - catch (Standard_Failure& e) { - - PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); - return 0; - } -} - Py::Float ToroidPy::getMajorRadius(void) const { Handle(Geom_ToroidalSurface) torus = Handle(Geom_ToroidalSurface)::DownCast