Skip to content

Commit

Permalink
Part: ModelRefine: catch bspline isEqual exception
Browse files Browse the repository at this point in the history
  • Loading branch information
blobfish authored and wwmayer committed Mar 22, 2015
1 parent 5ff38ba commit eba335c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Mod/Part/App/modelRefine.cpp
Expand Up @@ -61,6 +61,7 @@
#include <BRepAdaptor_Curve.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <Base/Console.h>
#include "modelRefine.h"

using namespace ModelRefine;
Expand Down Expand Up @@ -767,6 +768,8 @@ FaceTypedBSpline::FaceTypedBSpline() : FaceTypedBase(GeomAbs_BSplineSurface)

bool FaceTypedBSpline::isEqual(const TopoDS_Face &faceOne, const TopoDS_Face &faceTwo) const
{
try
{
Handle(Geom_BSplineSurface) surfaceOne = Handle(Geom_BSplineSurface)::DownCast(BRep_Tool::Surface(faceOne));
Handle(Geom_BSplineSurface) surfaceTwo = Handle(Geom_BSplineSurface)::DownCast(BRep_Tool::Surface(faceTwo));

Expand Down Expand Up @@ -849,6 +852,22 @@ bool FaceTypedBSpline::isEqual(const TopoDS_Face &faceOne, const TopoDS_Face &fa
if (vKnotSequenceOne.Value(indexV) != vKnotSequenceTwo.Value(indexV))
return false;
return true;
}
catch (Standard_Failure)
{
Handle(Standard_Failure) e = Standard_Failure::Caught();
std::ostringstream stream;
stream << "FaceTypedBSpline::isEqual: OCC Error: " << e->GetMessageString() << std::endl;
Base::Console().Message(stream.str().c_str());
}
catch (...)
{
std::ostringstream stream;
stream << "FaceTypedBSpline::isEqual: Unknown Error" << std::endl;
Base::Console().Message(stream.str().c_str());
}

return false;
}

GeomAbs_SurfaceType FaceTypedBSpline::getType() const
Expand Down

0 comments on commit eba335c

Please sign in to comment.