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 <martin.marmsoler@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -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>
|
||||
@@ -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<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())) {
|
||||
|
||||
Reference in New Issue
Block a user