diff --git a/src/Mod/Part/App/FeaturePartBoolean.cpp b/src/Mod/Part/App/FeaturePartBoolean.cpp index 22587b7ace..0104dbf3ce 100644 --- a/src/Mod/Part/App/FeaturePartBoolean.cpp +++ b/src/Mod/Part/App/FeaturePartBoolean.cpp @@ -58,6 +58,13 @@ void throwIfInvalidIfCheckModel(const TopoDS_Shape& shape) } } +bool getRefineModelParameter() +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part/Boolean"); + return hGrp->GetBool("RefineModel", false); +} + } PROPERTY_SOURCE_ABSTRACT(Part::Boolean, Part::Feature) @@ -73,10 +80,7 @@ Boolean::Boolean() 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 hGrp = App::GetApplication().GetUserParameter() - .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part/Boolean"); - this->Refine.setValue(hGrp->GetBool("RefineModel", false)); + this->Refine.setValue(getRefineModelParameter()); } short Boolean::mustExecute() const diff --git a/src/Mod/Part/App/FeaturePartCommon.cpp b/src/Mod/Part/App/FeaturePartCommon.cpp index 008a946f0a..1d2e052bb5 100644 --- a/src/Mod/Part/App/FeaturePartCommon.cpp +++ b/src/Mod/Part/App/FeaturePartCommon.cpp @@ -30,9 +30,6 @@ # include #endif -#include -#include - #include "FeaturePartCommon.h" #include "TopoShapeOpCode.h" #include "modelRefine.h" @@ -43,6 +40,7 @@ using namespace Part; namespace Part { extern void throwIfInvalidIfCheckModel(const TopoDS_Shape& shape); + extern bool getRefineModelParameter(); } PROPERTY_SOURCE(Part::Common, Part::Boolean) @@ -76,10 +74,7 @@ MultiCommon::MultiCommon() 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 hGrp = App::GetApplication().GetUserParameter() - .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part/Boolean"); - this->Refine.setValue(hGrp->GetBool("RefineModel", false)); + this->Refine.setValue(getRefineModelParameter()); } short MultiCommon::mustExecute() const diff --git a/src/Mod/Part/App/FeaturePartFuse.cpp b/src/Mod/Part/App/FeaturePartFuse.cpp index 3a41e7af12..1833516962 100644 --- a/src/Mod/Part/App/FeaturePartFuse.cpp +++ b/src/Mod/Part/App/FeaturePartFuse.cpp @@ -30,10 +30,6 @@ # include #endif -#include -#include -#include - #include "FeaturePartFuse.h" #include "TopoShape.h" #include "modelRefine.h" @@ -46,6 +42,7 @@ using namespace Part; namespace Part { extern void throwIfInvalidIfCheckModel(const TopoDS_Shape& shape); + extern bool getRefineModelParameter(); } PROPERTY_SOURCE(Part::Fuse, Part::Boolean) @@ -79,11 +76,7 @@ MultiFuse::MultiFuse() 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 hGrp = App::GetApplication().GetUserParameter() - .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part/Boolean"); - this->Refine.setValue(hGrp->GetBool("RefineModel", false)); - + this->Refine.setValue(getRefineModelParameter()); } short MultiFuse::mustExecute() const