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);
|
||||
|
||||
@@ -42,6 +42,7 @@ public:
|
||||
App::PropertyLink Base;
|
||||
App::PropertyLink Tool;
|
||||
PropertyShapeHistory History;
|
||||
App::PropertyBool Refine;
|
||||
|
||||
/** @name methods override Feature */
|
||||
//@{
|
||||
|
||||
@@ -66,6 +66,13 @@ MultiCommon::MultiCommon(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 MultiCommon::mustExecute() const
|
||||
@@ -145,7 +152,7 @@ App::DocumentObjectExecReturn *MultiCommon::execute(void)
|
||||
return new App::DocumentObjectExecReturn("Resulting shape is invalid");
|
||||
}
|
||||
}
|
||||
if (hGrp->GetBool("RefineModel", false)) {
|
||||
if (this->Refine.getValue()) {
|
||||
try {
|
||||
TopoDS_Shape oldShape = resShape;
|
||||
BRepBuilderAPI_RefineModel mkRefine(oldShape);
|
||||
|
||||
@@ -54,6 +54,7 @@ public:
|
||||
|
||||
App::PropertyLinkList Shapes;
|
||||
PropertyShapeHistory History;
|
||||
App::PropertyBool Refine;
|
||||
|
||||
/** @name methods override feature */
|
||||
//@{
|
||||
|
||||
@@ -65,6 +65,14 @@ MultiFuse::MultiFuse(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 MultiFuse::mustExecute() const
|
||||
@@ -169,7 +177,7 @@ App::DocumentObjectExecReturn *MultiFuse::execute(void)
|
||||
return new App::DocumentObjectExecReturn("Resulting shape is invalid");
|
||||
}
|
||||
}
|
||||
if (hGrp->GetBool("RefineModel", false)) {
|
||||
if (this->Refine.getValue()) {
|
||||
try {
|
||||
TopoDS_Shape oldShape = resShape;
|
||||
BRepBuilderAPI_RefineModel mkRefine(oldShape);
|
||||
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
|
||||
App::PropertyLinkList Shapes;
|
||||
PropertyShapeHistory History;
|
||||
App::PropertyBool Refine;
|
||||
|
||||
/** @name methods override feature */
|
||||
//@{
|
||||
|
||||
Reference in New Issue
Block a user