Skip to content

Commit

Permalink
Measure: Use getGlobalPlacement method (FreeCAD#16251)
Browse files Browse the repository at this point in the history
* 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 FreeCAD#16058

---------

Co-authored-by: Martin Marmsoler <martin.marmsoler@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 16, 2024
1 parent eb14fc9 commit ab031bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Mod/Part/App/MeasureClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include <App/DocumentObject.h>
#include <App/MeasureManager.h>
#include <App/DocumentObserver.h>
#include <App/GeoFeature.h>
#include <Base/Console.h>
#include <Base/Matrix.h>
#include <Base/Rotation.h>
Expand All @@ -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
Expand Down Expand Up @@ -102,10 +104,8 @@ TopoDS_Shape getLocatedShape(const App::SubObjectT& subject, Base::Matrix4D* mat
return {};
}

auto gf = dynamic_cast<const App::GeoFeature*>(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())) {
Expand Down

0 comments on commit ab031bc

Please sign in to comment.