From 3a9002217c8c8bc13fa3e3e4630b7a5dfe0b9342 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Thu, 13 Feb 2020 16:43:59 +0800 Subject: [PATCH] PartDesign: fix FeatureDressUp base checking --- src/Mod/PartDesign/App/FeatureDressUp.cpp | 24 +++++++++++------------ src/Mod/PartDesign/App/FeatureDressUp.h | 2 -- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/Mod/PartDesign/App/FeatureDressUp.cpp b/src/Mod/PartDesign/App/FeatureDressUp.cpp index 3f697733b0..5bafab6420 100644 --- a/src/Mod/PartDesign/App/FeatureDressUp.cpp +++ b/src/Mod/PartDesign/App/FeatureDressUp.cpp @@ -50,17 +50,12 @@ DressUp::DressUp() ADD_PROPERTY(Base,(0)); Placement.setStatus(App::Property::ReadOnly, true); - ADD_PROPERTY_TYPE(SupportTransform,(false),"Base", App::Prop_None, - "Enable support for transform patterns"); + ADD_PROPERTY_TYPE(SupportTransform,(true),"Base", App::Prop_None, + "Enable support for transformed patterns"); addSubType = Additive; } -void DressUp::setupObject() { - SupportTransform.setValue(true); - FeatureAddSub::setupObject(); -} - short DressUp::mustExecute() const { if (Base.getValue() && Base.getValue()->isTouched()) @@ -191,14 +186,19 @@ void DressUp::onChanged(const App::Property* prop) s = getBaseShape(); else s = Shape.getShape(); + } else if (!SupportTransform.getValue()) { + addSubType = base->getAddSubType(); + s = base->AddSubShape.getShape(); } else { addSubType = base->getAddSubType(); - if(!SupportTransform.getValue()) - s = base->AddSubShape.getShape(); - else if(addSubType == Additive) - s = Shape.getShape().cut(base->getBaseShape()); + auto baseBase = base->getBaseObject(true); + if(!baseBase) { + s = Shape.getShape(); + addSubType = Additive; + } else if (addSubType == Additive) + s = Shape.getShape().cut(base->getBaseTopoShape().getShape()); else - s = TopoShape(base->getBaseShape()).cut(Shape.getValue()); + s = base->getBaseTopoShape().cut(Shape.getValue()); } AddSubShape.setValue(s); } diff --git a/src/Mod/PartDesign/App/FeatureDressUp.h b/src/Mod/PartDesign/App/FeatureDressUp.h index 039b66cc12..9e4f3650aa 100644 --- a/src/Mod/PartDesign/App/FeatureDressUp.h +++ b/src/Mod/PartDesign/App/FeatureDressUp.h @@ -45,8 +45,6 @@ public: App::PropertyLinkSub Base; App::PropertyBool SupportTransform; - virtual void setupObject(); - short mustExecute() const; /// updates the Placement property from the Placement of the BaseFeature void positionByBaseFeature(void);