Toponaming: Refactor refine to its own FeatureRefine class

This commit is contained in:
bgbsww
2024-07-30 08:34:34 -04:00
parent 9de78e27f4
commit ae46ea5e7b
15 changed files with 185 additions and 110 deletions

View File

@@ -40,16 +40,11 @@ using namespace PartDesign;
namespace PartDesign {
PROPERTY_SOURCE(PartDesign::FeatureAddSub, PartDesign::Feature)
PROPERTY_SOURCE(PartDesign::FeatureAddSub, PartDesign::FeatureRefine)
FeatureAddSub::FeatureAddSub()
{
ADD_PROPERTY(AddSubShape,(TopoDS_Shape()));
ADD_PROPERTY_TYPE(Refine,(0),"Part Design",(App::PropertyType)(App::Prop_None),"Refine shape (clean up redundant edges) after adding/subtracting");
//init Refine property
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/PartDesign");
this->Refine.setValue(hGrp->GetBool("RefineModel", true));
}
FeatureAddSub::Type FeatureAddSub::getAddSubType()
@@ -64,17 +59,6 @@ short FeatureAddSub::mustExecute() const
return PartDesign::Feature::mustExecute();
}
TopoShape FeatureAddSub::refineShapeIfActive(const TopoShape& oldShape) const
{
if (this->Refine.getValue()) {
TopoShape shape(oldShape);
// this->fixShape(shape); // Todo: Not clear that this is required
return shape.makeElementRefine();
}
return oldShape;
}
void FeatureAddSub::getAddSubShape(Part::TopoShape &addShape, Part::TopoShape &subShape)
{
if (addSubType == Additive)