Toponaming: Refactor refine to its own FeatureRefine class
This commit is contained in:
@@ -53,10 +53,6 @@ Boolean::Boolean()
|
||||
ADD_PROPERTY(Type,((long)0));
|
||||
Type.setEnums(TypeEnums);
|
||||
|
||||
ADD_PROPERTY_TYPE(Refine,(0),"Part Design",(App::PropertyType)(App::Prop_None),"Refine shape (clean up redundant edges) after adding/subtracting");
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/PartDesign");
|
||||
this->Refine.setValue(hGrp->GetBool("RefineModel", true));
|
||||
ADD_PROPERTY_TYPE(UsePlacement,(0),"Part Design",(App::PropertyType)(App::Prop_None),"Apply the placement of the second ( tool ) object");
|
||||
this->UsePlacement.setValue(false);
|
||||
|
||||
@@ -188,25 +184,4 @@ void Boolean::handleChangedPropertyName(Base::XMLReader &reader, const char * Ty
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// FIXME: This method ( and the Refine property it depends on ) is redundant with the exact same
|
||||
// thing in FeatureAddSub, but cannot reasonably be moved up an inheritance level to Feature as
|
||||
// there are inheritors like FeatureBox for which a refine Property does not make sense. A
|
||||
// solution like moving Refine and refineShapeIfActive to a new FeatureRefine class that sits
|
||||
// between Feature and FeatureBoolean / FeatureAddSub is a possibility, or maybe [ew!] hiding the
|
||||
// property in Feature and only enabling it in the places it is relevant.
|
||||
TopoShape Boolean::refineShapeIfActive(const TopoShape& oldShape) const
|
||||
{
|
||||
if (this->Refine.getValue()) {
|
||||
try {
|
||||
return oldShape.makeElementRefine();
|
||||
}
|
||||
catch (Standard_Failure&) {
|
||||
return oldShape;
|
||||
}
|
||||
}
|
||||
|
||||
return oldShape;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user