Activate Part/Part Design check and refine preferences by default (#14406)

* Activate Part/Part Design check and refine preferences by default

* added bool in .ui

* Update tests

* Fix Sketcher tests
This commit is contained in:
Max Wilfinger
2024-07-01 17:50:42 +02:00
committed by GitHub
parent 96731cbd66
commit 86b1c2e863
10 changed files with 25 additions and 19 deletions

View File

@@ -49,7 +49,7 @@ FeatureAddSub::FeatureAddSub()
//init Refine property
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/PartDesign");
this->Refine.setValue(hGrp->GetBool("RefineModel", false));
this->Refine.setValue(hGrp->GetBool("RefineModel", true));
}
FeatureAddSub::Type FeatureAddSub::getAddSubType()

View File

@@ -54,7 +54,7 @@ Boolean::Boolean()
ADD_PROPERTY_TYPE(Refine,(0),"Part Design",(App::PropertyType)(App::Prop_None),"Refine shape (clean up redundant edges) after adding/subtracting");
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/PartDesign");
this->Refine.setValue(hGrp->GetBool("RefineModel", false));
this->Refine.setValue(hGrp->GetBool("RefineModel", true));
ADD_PROPERTY_TYPE(UsePlacement,(0),"Part Design",(App::PropertyType)(App::Prop_None),"Apply the placement of the second ( tool ) object");
this->UsePlacement.setValue(false);

View File

@@ -78,13 +78,10 @@ Transformed::Transformed()
(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", false));
//init Refine property
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/PartDesign");
this->Refine.setValue(hGrp->GetBool("RefineModel", true));
}
void Transformed::positionBySupport()

View File

@@ -387,7 +387,7 @@ void SubShapeBinder::setupObject() {
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/PartDesign");
this->Refine.setValue(hGrp->GetBool("RefineModel", false));
this->Refine.setValue(hGrp->GetBool("RefineModel", true));
}
App::DocumentObject* SubShapeBinder::getSubObject(const char* subname, PyObject** pyObj,

View File

@@ -1420,7 +1420,7 @@ class TestTopologicalNamingProblem(unittest.TestCase):
edges = [name for name in reverseMap.keys() if name.startswith("Edge")]
vertexes = [name for name in reverseMap.keys() if name.startswith("Vertex")]
self.assertEqual(len(body.Shape.childShapes()), 1)
self.assertEqual(body.Shape.childShapes()[0].ElementMapSize, 62)
self.assertEqual(body.Shape.childShapes()[0].ElementMapSize, 64)
self.assertEqual(len(reverseMap),62)
self.assertEqual(len(faces),12)
self.assertEqual(len(edges),30)