handle exception thrown by BRepBuilderAPI_RefineModel
This commit is contained in:
@@ -102,12 +102,17 @@ App::DocumentObjectExecReturn *Boolean::execute(void)
|
||||
history.push_back(buildHistory(*mkBool.get(), TopAbs_FACE, resShape, ToolShape));
|
||||
|
||||
if (hGrp->GetBool("RefineModel", false)) {
|
||||
TopoDS_Shape oldShape = resShape;
|
||||
BRepBuilderAPI_RefineModel mkRefine(oldShape);
|
||||
resShape = mkRefine.Shape();
|
||||
ShapeHistory hist = buildHistory(mkRefine, TopAbs_FACE, resShape, oldShape);
|
||||
history[0] = joinHistory(history[0], hist);
|
||||
history[1] = joinHistory(history[1], hist);
|
||||
try {
|
||||
TopoDS_Shape oldShape = resShape;
|
||||
BRepBuilderAPI_RefineModel mkRefine(oldShape);
|
||||
resShape = mkRefine.Shape();
|
||||
ShapeHistory hist = buildHistory(mkRefine, TopAbs_FACE, resShape, oldShape);
|
||||
history[0] = joinHistory(history[0], hist);
|
||||
history[1] = joinHistory(history[1], hist);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
this->Shape.setValue(resShape);
|
||||
|
||||
@@ -140,12 +140,17 @@ App::DocumentObjectExecReturn *MultiCommon::execute(void)
|
||||
}
|
||||
}
|
||||
if (hGrp->GetBool("RefineModel", false)) {
|
||||
TopoDS_Shape oldShape = resShape;
|
||||
BRepBuilderAPI_RefineModel mkRefine(oldShape);
|
||||
resShape = mkRefine.Shape();
|
||||
ShapeHistory hist = buildHistory(mkRefine, TopAbs_FACE, resShape, oldShape);
|
||||
for (std::vector<ShapeHistory>::iterator jt = history.begin(); jt != history.end(); ++jt)
|
||||
*jt = joinHistory(*jt, hist);
|
||||
try {
|
||||
TopoDS_Shape oldShape = resShape;
|
||||
BRepBuilderAPI_RefineModel mkRefine(oldShape);
|
||||
resShape = mkRefine.Shape();
|
||||
ShapeHistory hist = buildHistory(mkRefine, TopAbs_FACE, resShape, oldShape);
|
||||
for (std::vector<ShapeHistory>::iterator jt = history.begin(); jt != history.end(); ++jt)
|
||||
*jt = joinHistory(*jt, hist);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
this->Shape.setValue(resShape);
|
||||
|
||||
@@ -164,12 +164,17 @@ App::DocumentObjectExecReturn *MultiFuse::execute(void)
|
||||
}
|
||||
}
|
||||
if (hGrp->GetBool("RefineModel", false)) {
|
||||
TopoDS_Shape oldShape = resShape;
|
||||
BRepBuilderAPI_RefineModel mkRefine(oldShape);
|
||||
resShape = mkRefine.Shape();
|
||||
ShapeHistory hist = buildHistory(mkRefine, TopAbs_FACE, resShape, oldShape);
|
||||
for (std::vector<ShapeHistory>::iterator jt = history.begin(); jt != history.end(); ++jt)
|
||||
*jt = joinHistory(*jt, hist);
|
||||
try {
|
||||
TopoDS_Shape oldShape = resShape;
|
||||
BRepBuilderAPI_RefineModel mkRefine(oldShape);
|
||||
resShape = mkRefine.Shape();
|
||||
ShapeHistory hist = buildHistory(mkRefine, TopAbs_FACE, resShape, oldShape);
|
||||
for (std::vector<ShapeHistory>::iterator jt = history.begin(); jt != history.end(); ++jt)
|
||||
*jt = joinHistory(*jt, hist);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
this->Shape.setValue(resShape);
|
||||
|
||||
@@ -75,9 +75,14 @@ TopoDS_Shape FeaturePrimitive::refineShapeIfActive(const TopoDS_Shape& oldShape)
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/PartDesign");
|
||||
if (hGrp->GetBool("RefineModel", false)) {
|
||||
Part::BRepBuilderAPI_RefineModel mkRefine(oldShape);
|
||||
TopoDS_Shape resShape = mkRefine.Shape();
|
||||
return resShape;
|
||||
try {
|
||||
Part::BRepBuilderAPI_RefineModel mkRefine(oldShape);
|
||||
TopoDS_Shape resShape = mkRefine.Shape();
|
||||
return resShape;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
return oldShape;
|
||||
}
|
||||
}
|
||||
|
||||
return oldShape;
|
||||
|
||||
@@ -1024,9 +1024,14 @@ TopoDS_Shape ProfileBased::refineShapeIfActive(const TopoDS_Shape& oldShape) con
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/PartDesign");
|
||||
if (hGrp->GetBool("RefineModel", false)) {
|
||||
Part::BRepBuilderAPI_RefineModel mkRefine(oldShape);
|
||||
TopoDS_Shape resShape = mkRefine.Shape();
|
||||
return resShape;
|
||||
try {
|
||||
Part::BRepBuilderAPI_RefineModel mkRefine(oldShape);
|
||||
TopoDS_Shape resShape = mkRefine.Shape();
|
||||
return resShape;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
return oldShape;
|
||||
}
|
||||
}
|
||||
|
||||
return oldShape;
|
||||
|
||||
@@ -377,9 +377,14 @@ TopoDS_Shape Transformed::refineShapeIfActive(const TopoDS_Shape& oldShape) cons
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/PartDesign");
|
||||
if (hGrp->GetBool("RefineModel", false)) {
|
||||
Part::BRepBuilderAPI_RefineModel mkRefine(oldShape);
|
||||
TopoDS_Shape resShape = mkRefine.Shape();
|
||||
return resShape;
|
||||
try {
|
||||
Part::BRepBuilderAPI_RefineModel mkRefine(oldShape);
|
||||
TopoDS_Shape resShape = mkRefine.Shape();
|
||||
return resShape;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
return oldShape;
|
||||
}
|
||||
}
|
||||
|
||||
return oldShape;
|
||||
|
||||
Reference in New Issue
Block a user