From 5b358e1bd9daf18589d3ca579cf1d607480a34b3 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 20 Dec 2017 22:01:24 +0100 Subject: [PATCH] show base feature's placement on load if not part of a body --- src/Mod/PartDesign/App/FeatureBase.cpp | 8 +++++++- src/Mod/PartDesign/App/FeatureBase.h | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Mod/PartDesign/App/FeatureBase.cpp b/src/Mod/PartDesign/App/FeatureBase.cpp index abe1a3d0e5..03244e87b5 100644 --- a/src/Mod/PartDesign/App/FeatureBase.cpp +++ b/src/Mod/PartDesign/App/FeatureBase.cpp @@ -91,7 +91,13 @@ void FeatureBase::onChanged(const App::Property* prop) { Part::Feature::onChanged(prop); } - +void FeatureBase::onDocumentRestored() +{ + // if the base is not part of a body then show its placement property again + auto body = getFeatureBody(); + if (!body) + Placement.setStatus(App::Property::Hidden, false); +} }//namespace PartDesign diff --git a/src/Mod/PartDesign/App/FeatureBase.h b/src/Mod/PartDesign/App/FeatureBase.h index 3516d8c5b5..1a993d25c0 100644 --- a/src/Mod/PartDesign/App/FeatureBase.h +++ b/src/Mod/PartDesign/App/FeatureBase.h @@ -48,7 +48,8 @@ public: } virtual void onChanged(const App::Property* prop); - virtual App::DocumentObjectExecReturn* execute(void); + virtual App::DocumentObjectExecReturn* execute(void); + virtual void onDocumentRestored(); }; } //namespace PartDesign