From f291942d45e587180b96d97aa7f6fb4fa9c4d912 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sun, 19 Feb 2017 21:37:06 +0100 Subject: [PATCH] Part: Add support for reversing a geomcurve --- src/Mod/Part/App/Geometry.cpp | 15 +++++++++++++++ src/Mod/Part/App/Geometry.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp index 00aa1acfa..1ffb07786 100644 --- a/src/Mod/Part/App/Geometry.cpp +++ b/src/Mod/Part/App/Geometry.cpp @@ -511,6 +511,21 @@ double GeomCurve::length(double u, double v) const } } +void GeomCurve::Reverse(void) +{ + Handle_Geom_Curve c = Handle_Geom_Curve::DownCast(handle()); + + try { + if (!c.IsNull()) { + c->Reverse(); + } + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + throw Base::RuntimeError(e->GetMessageString()); + } +} + // ------------------------------------------------- diff --git a/src/Mod/Part/App/Geometry.h b/src/Mod/Part/App/Geometry.h index cad394648..23f8e48c7 100644 --- a/src/Mod/Part/App/Geometry.h +++ b/src/Mod/Part/App/Geometry.h @@ -146,6 +146,8 @@ public: double curvatureAt(double u) const; double length(double u, double v) const; bool normalAt(double u, Base::Vector3d& dir) const; + + void Reverse(void); }; class PartExport GeomBoundedCurve : public GeomCurve