From 34d1e45f35b993e51184b8b94ac05fe507644ccf Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 24 Oct 2013 18:11:24 +0200 Subject: [PATCH] + Attribute to get continuity of curve --- src/Mod/Part/App/GeometryCurvePy.xml | 8 ++++++ src/Mod/Part/App/GeometryCurvePyImp.cpp | 35 +++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/src/Mod/Part/App/GeometryCurvePy.xml b/src/Mod/Part/App/GeometryCurvePy.xml index 925686b51..b8a5498ea 100644 --- a/src/Mod/Part/App/GeometryCurvePy.xml +++ b/src/Mod/Part/App/GeometryCurvePy.xml @@ -66,6 +66,14 @@ of the nearest orthogonal projection of the point. + + + + Returns the global continuity of the curve. + + + + diff --git a/src/Mod/Part/App/GeometryCurvePyImp.cpp b/src/Mod/Part/App/GeometryCurvePyImp.cpp index b52b2a1ee..1e59fab9c 100644 --- a/src/Mod/Part/App/GeometryCurvePyImp.cpp +++ b/src/Mod/Part/App/GeometryCurvePyImp.cpp @@ -367,6 +367,41 @@ PyObject* GeometryCurvePy::toBSpline(PyObject * args) return 0; } +Py::String GeometryCurvePy::getContinuity(void) const +{ + GeomAbs_Shape c = Handle_Geom_Curve::DownCast + (getGeometryPtr()->handle())->Continuity(); + std::string str; + switch (c) { + case GeomAbs_C0: + str = "C0"; + break; + break; + case GeomAbs_G1: + str = "G1"; + break; + case GeomAbs_C1: + str = "C1"; + break; + case GeomAbs_G2: + str = "G2"; + break; + case GeomAbs_C2: + str = "C2"; + break; + case GeomAbs_C3: + str = "C3"; + break; + case GeomAbs_CN: + str = "CN"; + break; + default: + str = "Unknown"; + break; + } + return Py::String(str); +} + Py::Float GeometryCurvePy::getFirstParameter(void) const { return Py::Float(Handle_Geom_Curve::DownCast