From ab031bc92ca56d7f0cb48b6b137da36e5b090ce0 Mon Sep 17 00:00:00 2001 From: hlorus <64740362+hlorus@users.noreply.github.com> Date: Mon, 16 Sep 2024 18:05:21 +0200 Subject: [PATCH] Measure: Use getGlobalPlacement method (#16251) * Initial commit to apply delta also for interactive measurement * Not required special logic to check if possible, it can be easily checked if the property exists * remember setting so it is not required to turn it always on * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Measure: Use getGlobalPlacement method Fixes #16058 --------- Co-authored-by: Martin Marmsoler Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/Mod/Part/App/MeasureClient.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Mod/Part/App/MeasureClient.cpp b/src/Mod/Part/App/MeasureClient.cpp index bd1f9605ea..2239b9865a 100644 --- a/src/Mod/Part/App/MeasureClient.cpp +++ b/src/Mod/Part/App/MeasureClient.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +61,7 @@ using namespace Part; + // From: https://github.com/Celemation/FreeCAD/blob/joel_selection_summary_demo/src/Gui/SelectionSummary.cpp // Should work with edges and wires @@ -102,10 +104,8 @@ TopoDS_Shape getLocatedShape(const App::SubObjectT& subject, Base::Matrix4D* mat return {}; } - auto gf = dynamic_cast(obj); - if (gf) { - shape.setPlacement(gf->globalPlacement()); - } + auto placement = App::GeoFeature::getGlobalPlacement(obj, subject.getObject(), subject.getSubName()); + shape.setPlacement(placement); // Don't get the subShape from datum elements if (obj->getTypeId().isDerivedFrom(Part::Datum::getClassTypeId())) {