From 850a71d3c7eb30c0bcf0572ce5278fdcea150d4b Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Wed, 2 Dec 2020 13:06:07 +0100 Subject: [PATCH] Sketcher - Construction Migration - step 2: Adapt GeometryFacade to retrieve construction from extension ======================================================================================================== Access to the Construction state from facade is now obtained from the extension data. --- src/Mod/Sketcher/App/ExternalGeometryFacade.h | 9 +++++++-- src/Mod/Sketcher/App/GeometryFacade.h | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Mod/Sketcher/App/ExternalGeometryFacade.h b/src/Mod/Sketcher/App/ExternalGeometryFacade.h index 960f1e3f1a..eed4591e8f 100644 --- a/src/Mod/Sketcher/App/ExternalGeometryFacade.h +++ b/src/Mod/Sketcher/App/ExternalGeometryFacade.h @@ -86,6 +86,13 @@ public: virtual bool testGeometryMode(int flag) const override { return getGeoExt()->testGeometryMode(flag); } virtual void setGeometryMode(int flag, bool v=true) override { getGeoExt()->setGeometryMode(flag, v); } + // Convenience accessor + bool getBlocked() const { return this->testGeometryMode(GeometryMode::Blocked);} + void setBlocked(bool status = true) {this->setGeometryMode(GeometryMode::Blocked, status);} + + inline bool getConstruction(void) const {return this->testGeometryMode(GeometryMode::Construction);}; + inline void setConstruction(bool construction) {this->setGeometryMode(GeometryMode::Construction, construction);}; + // Geometry Extension Information inline const std::string &getSketchExtensionName () const {return SketchGeoExtension->getName();} inline const std::string &getExternalExtensionName () const {return ExternalGeoExtension->getName();} @@ -113,8 +120,6 @@ public: const Handle(Geom_Geometry)& handle() const {return getGeo()->handle();}; Part::Geometry *copy(void) const {return getGeo()->copy();}; Part::Geometry *clone(void) const {return getGeo()->clone();}; - inline bool getConstruction(void) const {return getGeo()->getConstruction();}; - inline void setConstruction(bool construction) {getGeo()->setConstruction(construction);}; boost::uuids::uuid getTag() const {return getGeo()->getTag();}; std::vector> getExtensions() const {return getGeo()->getExtensions();}; diff --git a/src/Mod/Sketcher/App/GeometryFacade.h b/src/Mod/Sketcher/App/GeometryFacade.h index 133582198b..579f14805a 100644 --- a/src/Mod/Sketcher/App/GeometryFacade.h +++ b/src/Mod/Sketcher/App/GeometryFacade.h @@ -133,6 +133,9 @@ public: bool getBlocked() const { return this->testGeometryMode(GeometryMode::Blocked);} void setBlocked(bool status = true) {this->setGeometryMode(GeometryMode::Blocked, status);} + inline bool getConstruction(void) const {return this->testGeometryMode(GeometryMode::Construction);}; + inline void setConstruction(bool construction) {this->setGeometryMode(GeometryMode::Construction, construction);}; + bool isInternalAligned() const { return this->getInternalType() != InternalType::None; } // Geometry Extension Information @@ -161,8 +164,6 @@ public: const Handle(Geom_Geometry)& handle() const {return getGeo()->handle();}; Part::Geometry *copy(void) const {return getGeo()->copy();}; Part::Geometry *clone(void) const {return getGeo()->clone();}; - inline bool getConstruction(void) const {return getGeo()->getConstruction();}; - inline void setConstruction(bool construction) {getGeo()->setConstruction(construction);}; boost::uuids::uuid getTag() const {return getGeo()->getTag();}; std::vector> getExtensions() const {return getGeo()->getExtensions();};