PartDesign: Refine property for primitives #3488

This commit is contained in:
DeepSOIC
2018-09-10 21:03:49 +03:00
committed by wmayer
parent dadf0e80a9
commit ae59630fa4
6 changed files with 40 additions and 48 deletions

View File

@@ -29,7 +29,6 @@
#include "FeaturePrimitive.h"
#include "DatumPoint.h"
#include "DatumCS.h"
#include <Mod/Part/App/modelRefine.h>
#include "FeaturePy.h"
#include <Base/Exception.h>
#include <Base/Tools.h>
@@ -70,24 +69,6 @@ FeaturePrimitive::FeaturePrimitive()
Part::AttachExtension::initExtension(this);
}
TopoDS_Shape FeaturePrimitive::refineShapeIfActive(const TopoDS_Shape& oldShape) const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/PartDesign");
if (hGrp->GetBool("RefineModel", false)) {
try {
Part::BRepBuilderAPI_RefineModel mkRefine(oldShape);
TopoDS_Shape resShape = mkRefine.Shape();
return resShape;
}
catch (Standard_Failure&) {
return oldShape;
}
}
return oldShape;
}
App::DocumentObjectExecReturn* FeaturePrimitive::execute(const TopoDS_Shape& primitiveShape)
{
try {
@@ -124,7 +105,7 @@ App::DocumentObjectExecReturn* FeaturePrimitive::execute(const TopoDS_Shape& pri
// lets check if the result is a solid
if (boolOp.IsNull())
return new App::DocumentObjectExecReturn("Resulting shape is not a solid");
int solidCount = countSolids(boolOp);
if (solidCount > 1) {
return new App::DocumentObjectExecReturn("Additive: Result has multiple solids. This is not supported at this time.");
@@ -144,7 +125,7 @@ App::DocumentObjectExecReturn* FeaturePrimitive::execute(const TopoDS_Shape& pri
// lets check if the result is a solid
if (boolOp.IsNull())
return new App::DocumentObjectExecReturn("Resulting shape is not a solid");
int solidCount = countSolids(boolOp);
if (solidCount > 1) {
return new App::DocumentObjectExecReturn("Subtractive: Result has multiple solids. This is not supported at this time.");