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

0026937: Eliminate NO_CXX_EXCEPTION macro support

Macro NO_CXX_EXCEPTION was removed from code.
Method Raise() was replaced by explicit throw statement.
Method Standard_Failure::Caught() was replaced by normal C++mechanism of exception transfer.
Method Standard_Failure::Caught() is deprecated now.
Eliminated empty constructors.
Updated samples.
Eliminate empty method ChangeValue from NCollection_Map class.
Removed not operable methods from NCollection classes.
This commit is contained in:
ski
2017-02-02 16:35:21 +03:00
committed by apn
parent 0c63f2f8b9
commit 9775fa6110
1146 changed files with 4860 additions and 6183 deletions

View File

@@ -88,11 +88,12 @@ Handle(Geom_BSplineCurve) ShapeConstruct::ConvertCurveToBSpline(const Handle(Geo
else
aBSpline = GeomConvert::CurveToBSplineCurve(C3D,Convert_QuasiAngular);
}
catch (Standard_Failure) {
catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: GeomConvert_ApproxSurface Exception: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
anException.Print(cout); cout << endl;
#endif
(void)anException;
aBSpline = GeomConvert::CurveToBSplineCurve(C3D,Convert_QuasiAngular);
}
}
@@ -256,11 +257,12 @@ Handle(Geom_BSplineSurface) ShapeConstruct::ConvertSurfaceToBSpline(const Handle
}
}
catch (Standard_Failure) {
catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: GeomConvert_ApproxSurface Exception: try to decrease continuity ";
Standard_Failure::Caught()->Print(cout); cout << endl;
anException.Print(cout); cout << endl;
#endif
(void)anException;
if(cnt > 0) cnt--;
continue;
}
@@ -360,11 +362,12 @@ Standard_Boolean ShapeConstruct::JoinPCurves(const Handle(TopTools_HSequenceOfSh
B.SameParameter(theEdge,Standard_False);
return (i <= edges->Length());
}
catch ( Standard_Failure ) {
catch ( Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"Error: ShapeConstruct::JoinPCurves Exception in GeomConvert_CompCurveToBSplineCurve: ";
Standard_Failure::Caught()->Print(cout); cout<<endl;
anException.Print(cout); cout<<endl;
#endif
(void)anException;
}
return Standard_False;
}

View File

@@ -153,11 +153,12 @@ Handle(Geom_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle(G
OCC_CATCH_SIGNALS
bspl = GeomConvert::CurveToBSplineCurve(tc);
}
catch ( Standard_Failure ) {
catch ( Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in GeomConvert: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
anException.Print(cout); cout << endl;
#endif
(void)anException;
}
}
@@ -174,11 +175,12 @@ Handle(Geom_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle(G
bspl->Segment ( fbsp, lbsp );
return bspl;
}
catch ( Standard_Failure ) {
catch ( Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Segment: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
anException.Print(cout); cout << endl;
#endif
(void)anException;
}
}
@@ -192,11 +194,12 @@ Handle(Geom_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle(G
if ( Conv.IsDone() || Conv.HasResult() )
bspl = Conv.Curve();
}
catch ( Standard_Failure ) {
catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Approx_Curve3d: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
anException.Print(cout); cout << endl;
#endif
(void)anException;
}
return bspl;
}
@@ -223,11 +226,12 @@ Handle(Geom2d_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle
OCC_CATCH_SIGNALS
bspl = Geom2dConvert::CurveToBSplineCurve(tc);
}
catch ( Standard_Failure ) {
catch ( Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Geom2dConvert: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
anException.Print(cout); cout << endl;
#endif
(void)anException;
}
}
@@ -244,11 +248,12 @@ Handle(Geom2d_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle
bspl->Segment ( fbsp, lbsp );
return bspl;
}
catch ( Standard_Failure ) {
catch ( Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Segment: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
anException.Print(cout); cout << endl;
#endif
(void)anException;
}
}
@@ -263,11 +268,12 @@ Handle(Geom2d_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle
if ( Conv.IsDone() || Conv.HasResult() )
bspl = Conv.Curve();
}
catch ( Standard_Failure ) {
catch ( Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Approx_Curve3d: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
anException.Print(cout); cout << endl;
#endif
(void)anException;
}
return bspl;
}

View File

@@ -471,12 +471,12 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G
}
}
catch(Standard_Failure)
{
catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(): Exception: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
anException.Print(cout); cout << endl;
#endif
(void)anException;
myStatus = ShapeExtend::EncodeStatus (ShapeExtend_FAIL3);
c2d.Nullify();
}
@@ -1480,13 +1480,14 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::ApproximatePCurve(con
C2d = new Geom2d_BSplineCurve ( poles2d, weights, knots, multiplicities, crv3d->Degree(), crv3d->IsPeriodic());
return C2d;
}
catch(Standard_Failure) {
#ifdef OCCT_DEBUG //:s5
catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
//:s5
// debug ...
Standard_Integer nbp = params->Length();
Standard_Integer nb2 = points2d->Length();
cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::ApproximatePCurve(): Exception: ";
Standard_Failure::Caught()->Print(cout);
anException.Print(cout);
cout<<"Pb Geom2dAPI_Approximate, tol2d="<<theTolerance2d<<" NbParams="<<nbp<<" NbPnts="<<nb2<<endl;
// if (nb2 > nbp) nb2 = nbp;
// Standard_Real rbp,rb2; rbp = nbp; rb2 = nb2;
@@ -1497,6 +1498,7 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::ApproximatePCurve(con
// dbl.AddXYZ (quoi);
// }
#endif
(void)anException;
C2d.Nullify();
}
return C2d;
@@ -1524,13 +1526,14 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::ApproximatePCurve(con
myInterPol2d.Perform();
if (myInterPol2d.IsDone()) C2d = myInterPol2d.Curve();
}
catch(Standard_Failure) {
#ifdef OCCT_DEBUG //:s5
catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
//:s5
// // debug ...
Standard_Integer nbp = params->Length();
Standard_Integer nb2 = points2d->Length();
cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::InterpolatePCurve(): Exception: ";
Standard_Failure::Caught()->Print(cout);
anException.Print(cout);
cout<<"Pb Geom2dAPI_Interpolate, tol2d="<<theTolerance2d<<" NbParams="<<nbp<<" NbPnts="<<nb2<<endl;
// if (nb2 > nbp) nb2 = nbp;
// Standard_Real rbp,rb2; rbp = nbp; rb2 = nb2;
@@ -1541,6 +1544,7 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::ApproximatePCurve(con
// dbl.AddXYZ (quoi);
// }
#endif
(void)anException;
C2d.Nullify();
}
return C2d;
@@ -1565,12 +1569,14 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons
myInterPol.Perform();
if (myInterPol.IsDone()) C3d = myInterPol.Curve();
}
catch(Standard_Failure) {
C3d.Nullify();
#ifdef OCCT_DEBUG //:s5
catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
//:s5
cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(): Exception: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
anException.Print(cout); cout << endl;
#endif
(void)anException;
C3d.Nullify();
}
return C3d;
}
@@ -1965,18 +1971,17 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons
} */
return isoParam;
} // RAJOUT
catch(Standard_Failure) {
// pb : on affiche ce qu on peut
catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
// pb : on affiche ce qu on peut
for (Standard_Integer numpnt = 1; numpnt <= nbrPnt; numpnt ++) {
cout<<"["<<numpnt<<"]param="<<params(numpnt)<<" point=("<<
points(numpnt).X()<<" "<<points(numpnt).Y()<<" "<<points(numpnt).Z()<<")"<<endl;
}
#endif
#ifdef OCCT_DEBUG //:s5
cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::IsAnIsoparametric(): Exception: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
anException.Print(cout); cout << endl;
#endif
(void)anException;
return Standard_False;
}
}