Part: move model check to separate function

This is to avoid code duplication.
This commit is contained in:
wmayer
2024-07-02 08:40:30 +02:00
committed by wwmayer
parent 01f5095aa8
commit 23999464e4
3 changed files with 39 additions and 33 deletions

View File

@@ -40,6 +40,11 @@
using namespace Part;
namespace Part
{
extern void throwIfInvalidIfCheckModel(const TopoDS_Shape& shape);
}
PROPERTY_SOURCE(Part::Common, Part::Boolean)
@@ -101,17 +106,7 @@ App::DocumentObjectExecReturn *MultiCommon::execute()
throw Base::RuntimeError("Resulting shape is null");
}
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/Part/Boolean");
if (hGrp->GetBool("CheckModel", false)) {
BRepCheck_Analyzer aChecker(res.getShape());
if (!aChecker.IsValid()) {
return new App::DocumentObjectExecReturn("Resulting shape is invalid");
}
}
throwIfInvalidIfCheckModel(res.getShape());
if (this->Refine.getValue()) {
res = res.makeElementRefine();