1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

0025699: Crash while importing STeP file

1) Try-catch block was added on a StepToTopoDS_TranslateEdgeLoop::Init() to
catch Standard_ConstructionError during the Curve conversion.

2) Checks of BSpline curve degree added to prevent construction error when converting edges to BSpline_Curve.
3) Warning message was added in case of incorrect curve definition.

Correct of the test cases according to the new error message added with fix

Conflicts:
	tests/de/step_1/R9

Modified test cases according to new reference data
This commit is contained in:
akz
2015-02-13 16:34:08 +03:00
committed by bugmaster
parent 2c7b466ce6
commit d088c9c2a1
6 changed files with 53 additions and 22 deletions

View File

@@ -89,6 +89,7 @@
#include <XSAlgo.hxx>
#include <XSAlgo_AlgoContainer.hxx>
#include <ElCLib.hxx>
#include <Standard_ErrorHandler.hxx>
// ============================================================================
// Method : RemoveSinglePCurve
@@ -319,10 +320,24 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
// }
Handle(Geom_Curve) C1;
if (!C.IsNull()) {
C1 = Handle(Geom_Curve)::DownCast (TP->FindTransient(C));
if (C1.IsNull()) {
if (StepToGeom_MakeCurve::Convert(C,C1))
TP->BindTransient (C,C1);
try
{
OCC_CATCH_SIGNALS
C1 = Handle(Geom_Curve)::DownCast (TP->FindTransient(C));
if (C1.IsNull()) {
if (StepToGeom_MakeCurve::Convert(C,C1))
TP->BindTransient (C,C1);
else
TP->AddWarning(C,"Could not convert a curve. Curve definition is incorrect");
}
}
catch (Standard_Failure)
{
TP->AddFail(C,"Exeption was raised. Curve geometry definition is incorrect");
#ifdef OCCT_DEBUG
cout << "Warning: StepToTopoDS_TranslateEdgeLoop: Exception: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
#endif
}
}