From 4a5698375b769af83ddb9f6b045b2ba86a178f41 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 9 Nov 2020 13:14:31 +0100 Subject: [PATCH] Part: [skip ci] correctly show control points of a B-spline/Bezier curve/surface if a placement is set --- src/Mod/Part/Gui/ViewProviderSpline.cpp | 32 ++++++++++++++++++------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/Mod/Part/Gui/ViewProviderSpline.cpp b/src/Mod/Part/Gui/ViewProviderSpline.cpp index 8bcaaad38f..e9d1ce23c4 100644 --- a/src/Mod/Part/Gui/ViewProviderSpline.cpp +++ b/src/Mod/Part/Gui/ViewProviderSpline.cpp @@ -168,7 +168,12 @@ void ViewProviderSpline::showControlPointsOfEdge(const TopoDS_Edge& edge) { std::list poles, knots; Standard_Integer nCt=0; - BRepAdaptor_Curve curve(edge); + + TopoDS_Edge edge_loc(edge); + TopLoc_Location aLoc; + edge_loc.Location(aLoc); + + BRepAdaptor_Curve curve(edge_loc); switch (curve.GetType()) { case GeomAbs_BezierCurve: @@ -232,10 +237,13 @@ void ViewProviderSpline::showControlPointsOfFace(const TopoDS_Face& face) std::list knots; std::vector > poles; Standard_Integer nCtU=0, nCtV=0; - BRepAdaptor_Surface surface(face); - BRepAdaptor_Surface clSurface(face); - switch (clSurface.GetType()) + TopoDS_Face face_loc(face); + TopLoc_Location aLoc; + face_loc.Location(aLoc); + + BRepAdaptor_Surface surface(face_loc); + switch (surface.GetType()) { case GeomAbs_BezierSurface: { @@ -408,7 +416,12 @@ void ViewProviderSplineExtension::showControlPointsOfEdge(const TopoDS_Edge& edg { std::list poles, knots; Standard_Integer nCt=0; - BRepAdaptor_Curve curve(edge); + + TopoDS_Edge edge_loc(edge); + TopLoc_Location aLoc; + edge_loc.Location(aLoc); + + BRepAdaptor_Curve curve(edge_loc); switch (curve.GetType()) { case GeomAbs_BezierCurve: @@ -472,10 +485,13 @@ void ViewProviderSplineExtension::showControlPointsOfFace(const TopoDS_Face& fac std::list knots; std::vector > poles; Standard_Integer nCtU=0, nCtV=0; - BRepAdaptor_Surface surface(face); - BRepAdaptor_Surface clSurface(face); - switch (clSurface.GetType()) + TopoDS_Face face_loc(face); + TopLoc_Location aLoc; + face_loc.Location(aLoc); + + BRepAdaptor_Surface surface(face_loc); + switch (surface.GetType()) { case GeomAbs_BezierSurface: {