Part: move model check to separate function
This is to avoid code duplication.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user