PartDesign: fix FeatureDressUp base checking

This commit is contained in:
Zheng, Lei
2020-02-13 16:43:59 +08:00
committed by wwmayer
parent 469614eb17
commit 3a9002217c
2 changed files with 12 additions and 14 deletions

View File

@@ -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);
}

View File

@@ -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);