From d60613364b6cd9bf55337ee14f89b04bd4b73751 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Thu, 5 Jan 2017 21:45:47 +0100 Subject: [PATCH] Sketcher: BSpline basic SketchObject support --- src/Mod/Sketcher/App/SketchObject.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 9a33e90b0..6d45e60c4 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -43,6 +43,7 @@ # include # include # include +# include # include # include # include @@ -514,6 +515,12 @@ Base::Vector3d SketchObject::getPoint(int GeoId, PointPos PosId) const return aop->getEndPoint(); else if (PosId == mid) return aop->getCenter(); + } else if (geo->getTypeId() == Part::GeomBSplineCurve::getClassTypeId()) { + const Part::GeomBSplineCurve *bsp = static_cast(geo); + if (PosId == start) + return bsp->getStartPoint(); + else if (PosId == end) + return bsp->getEndPoint(); } return Base::Vector3d(); @@ -571,6 +578,7 @@ bool SketchObject::isSupportedGeometry(const Part::Geometry *geo) const geo->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId() || geo->getTypeId() == Part::GeomArcOfHyperbola::getClassTypeId() || geo->getTypeId() == Part::GeomArcOfParabola::getClassTypeId() || + geo->getTypeId() == Part::GeomBSplineCurve::getClassTypeId() || geo->getTypeId() == Part::GeomLineSegment::getClassTypeId()) { return true; } @@ -4213,6 +4221,11 @@ void SketchObject::rebuildVertexIndex(void) VertexId2PosId.push_back(end); VertexId2GeoId.push_back(i); VertexId2PosId.push_back(mid); + } else if ((*it)->getTypeId() == Part::GeomBSplineCurve::getClassTypeId()) { + VertexId2GeoId.push_back(i); + VertexId2PosId.push_back(start); + VertexId2GeoId.push_back(i); + VertexId2PosId.push_back(end); } } }