diff --git a/src/App/Datums.cpp b/src/App/Datums.cpp index 4f16c1ebff..2aa606a3bd 100644 --- a/src/App/Datums.cpp +++ b/src/App/Datums.cpp @@ -68,7 +68,7 @@ bool DatumElement::getCameraAlignmentDirection(Base::Vector3d& direction, const return true; } -App::LocalCoordinateSystem* DatumElement::getLCS() +App::LocalCoordinateSystem* DatumElement::getLCS() const { auto inList = getInList(); for (auto* obj : inList) { @@ -81,9 +81,9 @@ App::LocalCoordinateSystem* DatumElement::getLCS() return nullptr; } -bool DatumElement::isOriginFeature() +bool DatumElement::isOriginFeature() const { - auto lcs = getLCS(); + const auto* lcs = getLCS(); return lcs ? lcs->isOrigin() : false; } diff --git a/src/App/Datums.h b/src/App/Datums.h index a99682f0c6..a1a15663d9 100644 --- a/src/App/Datums.h +++ b/src/App/Datums.h @@ -50,14 +50,14 @@ public: ~DatumElement() override; /// Finds the origin object this plane belongs to - App::LocalCoordinateSystem* getLCS(); + App::LocalCoordinateSystem* getLCS() const; Base::Vector3d getBasePoint() const; Base::Vector3d getDirection() const; bool getCameraAlignmentDirection(Base::Vector3d& direction, const char* subname) const override; /// Returns true if this DatumElement is part of a App::Origin. - bool isOriginFeature(); + bool isOriginFeature() const; }; class AppExport Plane: public App::DatumElement @@ -199,7 +199,7 @@ public: /// Points types static constexpr const char* PointRoles[1] = {"Origin"}; - virtual bool isOrigin() + virtual bool isOrigin() const { return false; } diff --git a/src/App/Origin.h b/src/App/Origin.h index 9de0979fe7..268a4fcaf7 100644 --- a/src/App/Origin.h +++ b/src/App/Origin.h @@ -48,10 +48,10 @@ public: return "Gui::ViewProviderCoordinateSystem"; } - bool isOrigin() override + bool isOrigin() const override { return true; - }; + } }; } // namespace App