Part: add Refine property to BOPs
followup to PartDesign
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user