Part: add Refine property to BOPs

followup to PartDesign
This commit is contained in:
DeepSOIC
2018-01-18 16:21:51 +03:00
committed by wmayer
parent 1cb2d52dc2
commit 3955146bdb
6 changed files with 28 additions and 3 deletions

View File

@@ -47,6 +47,13 @@ Boolean::Boolean(void)
ADD_PROPERTY_TYPE(History,(ShapeHistory()), "Boolean", (App::PropertyType)
(App::Prop_Output|App::Prop_Transient|App::Prop_Hidden), "Shape history");
History.setSize(0);
ADD_PROPERTY_TYPE(Refine,(0),"Boolean",(App::PropertyType)(App::Prop_None),"Refine shape (clean up redundant edges) after this boolean operation");
//init Refine property
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part/Boolean");
this->Refine.setValue(hGrp->GetBool("RefineModel", false));
}
short Boolean::mustExecute() const
@@ -102,7 +109,7 @@ App::DocumentObjectExecReturn *Boolean::execute(void)
history.push_back(buildHistory(*mkBool.get(), TopAbs_FACE, resShape, BaseShape));
history.push_back(buildHistory(*mkBool.get(), TopAbs_FACE, resShape, ToolShape));
if (hGrp->GetBool("RefineModel", false)) {
if (this->Refine.getValue()) {
try {
TopoDS_Shape oldShape = resShape;
BRepBuilderAPI_RefineModel mkRefine(oldShape);