1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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

@@ -132,7 +132,7 @@ Convert_CircleToBSplineCurve::Convert_CircleToBSplineCurve
Standard_Real Eps = Precision::PConfusion();
if ( (delta > (2*M_PI + Eps)) || (delta <= 0.0e0) ) {
Standard_DomainError::Raise( "Convert_CircleToBSplineCurve");
throw Standard_DomainError( "Convert_CircleToBSplineCurve");
}
Standard_Integer ii;

View File

@@ -60,8 +60,8 @@ Convert_CompPolynomialToPoles::Convert_CompPolynomialToPoles(
MaxDegree <= 0 ||
Dimension <= 0 ||
PolynomialIntervals->RowLength() != 2) {
Standard_ConstructionError::
Raise("Convert_CompPolynomialToPoles:bad arguments");
throw Standard_ConstructionError
("Convert_CompPolynomialToPoles:bad arguments");
}
myDegree = 0 ;
@@ -72,8 +72,8 @@ Convert_CompPolynomialToPoles::Convert_CompPolynomialToPoles(
myDegree = Max(NumCoeffPerCurve->Value(ii)-1,myDegree) ;
}
if ((Continuity > myDegree)&& (NumCurves>1)) {
Standard_ConstructionError::
Raise("Convert_CompPolynomialToPoles:Continuity is too great");
throw Standard_ConstructionError
("Convert_CompPolynomialToPoles:Continuity is too great");
}
//
// prepare output
@@ -117,8 +117,8 @@ Convert_CompPolynomialToPoles(const Standard_Integer NumCurves,
MaxDegree <= 0 ||
Dimension <= 0 ||
PolynomialIntervals.RowLength() != 2) {
Standard_ConstructionError::
Raise("Convert_CompPolynomialToPoles:bad arguments");
throw Standard_ConstructionError
("Convert_CompPolynomialToPoles:bad arguments");
}
myDegree = 0 ;
@@ -144,8 +144,8 @@ Convert_CompPolynomialToPoles(const Standard_Integer NumCurves,
new TColStd_HArray1OfInteger(1, NumCurves + 1) ;
for (ii = 2 ; ii < NumCurves + 1 ; ii++) {
if ((Continuity(ii) > myDegree)&& (NumCurves>1)) {
Standard_ConstructionError::
Raise("Convert_CompPolynomialToPoles:Continuity is too great");
throw Standard_ConstructionError
("Convert_CompPolynomialToPoles:Continuity is too great");
}
myMults -> SetValue(ii, myDegree-Continuity(ii) );
@@ -174,8 +174,8 @@ Convert_CompPolynomialToPoles(const Standard_Integer Dimension,
Dimension <= 0 ||
PolynomialIntervals.Length() != 2)
{
Standard_ConstructionError::
Raise("Convert_CompPolynomialToPoles:bad arguments");
throw Standard_ConstructionError
("Convert_CompPolynomialToPoles:bad arguments");
}
TColStd_Array2OfReal ThePolynomialIntervals(1,1,1,2);
@@ -293,8 +293,8 @@ Perform(const Standard_Integer NumCurves,
poles_array[0],
inversion_problem) ;
if (inversion_problem != 0) {
Standard_ConstructionError::
Raise("Convert_CompPolynomialToPoles:inversion_problem");
throw Standard_ConstructionError
("Convert_CompPolynomialToPoles:inversion_problem");
}
myDone = Standard_True ;
}

View File

@@ -107,7 +107,7 @@ gp_Pnt2d Convert_ConicToBSplineCurve::Pole
(const Standard_Integer Index) const
{
if (Index < 1 || Index > nbPoles)
Standard_OutOfRange::Raise(" ");
throw Standard_OutOfRange(" ");
return poles->Value (Index);
}
@@ -121,7 +121,7 @@ Standard_Real Convert_ConicToBSplineCurve::Weight
(const Standard_Integer Index) const
{
if (Index < 1 || Index > nbPoles)
Standard_OutOfRange::Raise(" ");
throw Standard_OutOfRange(" ");
return weights->Value (Index);
}
@@ -135,7 +135,7 @@ Standard_Real Convert_ConicToBSplineCurve::Knot
(const Standard_Integer Index) const
{
if (Index < 1 || Index > nbKnots)
Standard_OutOfRange::Raise(" ");
throw Standard_OutOfRange(" ");
return knots->Value (Index);
}
@@ -149,7 +149,7 @@ Standard_Integer Convert_ConicToBSplineCurve::Multiplicity
(const Standard_Integer Index) const
{
if (Index < 1 || Index > nbKnots)
Standard_OutOfRange::Raise(" ");
throw Standard_OutOfRange(" ");
return mults->Value (Index);
}
//=======================================================================
@@ -269,7 +269,7 @@ void AlgorithmicCosAndSin(Standard_Integer Degree,
if (num_poles != CosNumerator.Length() ||
num_poles != SinNumerator.Length() ||
num_poles != Denominator.Length() ) {
Standard_ConstructionError::Raise();
throw Standard_ConstructionError();
}
TColStd_Array1OfReal parameters(1,num_poles) ;
TColgp_Array1OfPnt poles_array(1,num_poles) ;
@@ -366,14 +366,14 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin(
case Convert_TgtThetaOver2_1:
num_spans = 1 ;
if (delta > 0.9999 * M_PI) {
Standard_ConstructionError::Raise() ;
throw Standard_ConstructionError() ;
}
tgt_theta_flag = 1 ;
break ;
case Convert_TgtThetaOver2_2:
num_spans = 2 ;
if (delta > 1.9999 * M_PI) {
Standard_ConstructionError::Raise() ;
throw Standard_ConstructionError() ;
}
tgt_theta_flag = 1 ;
break ;
@@ -637,7 +637,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin(
if (Parameterisation != Convert_TgtThetaOver2 &&
Parameterisation != Convert_RationalC1) {
Standard_ConstructionError::Raise() ;
throw Standard_ConstructionError() ;
}
Handle(TColStd_HArray1OfReal) temp_cos_ptr,
temp_sin_ptr,

View File

@@ -40,12 +40,12 @@ Convert_GridPolynomialToPoles(
if ((NumCoeffPerSurface->Lower()!=1 ) ||
(NumCoeffPerSurface->Upper()!= 2) )
{
Standard_DomainError::Raise("Convert : Wrong Coefficients");
throw Standard_DomainError("Convert : Wrong Coefficients");
}
if ((Coefficients->Lower()!=1 ) ||
(Coefficients->Upper()!= 3*(MaxUDegree+1)*(MaxVDegree+1)))
{
Standard_DomainError::Raise("Convert : Wrong Coefficients");
throw Standard_DomainError("Convert : Wrong Coefficients");
}
// Les Degres
@@ -53,11 +53,9 @@ Convert_GridPolynomialToPoles(
myVDegree = NumCoeffPerSurface->Value(2)-1;
if (myUDegree > MaxUDegree)
Standard_DomainError::Raise
("Convert : Incoherence beetween NumCoeffPerSurface and MaxUDegree");
throw Standard_DomainError("Convert : Incoherence beetween NumCoeffPerSurface and MaxUDegree");
if (myVDegree > MaxVDegree)
Standard_DomainError::Raise
("Convert : Incoherence beetween NumCoeffPerSurface and MaxVDegree");
throw Standard_DomainError("Convert : Incoherence beetween NumCoeffPerSurface and MaxVDegree");
Handle(TColStd_HArray2OfInteger) NumCoeff =
new (TColStd_HArray2OfInteger)(1, 1, 1, 2);
@@ -102,14 +100,14 @@ Convert_GridPolynomialToPoles(
(NumCoeffPerSurface->LowerCol()!=1) ||
(NumCoeffPerSurface->UpperCol()!=2) )
{
Standard_DomainError::Raise("Convert : Wrong NumCoeffPerSurface");
throw Standard_DomainError("Convert : Wrong NumCoeffPerSurface");
}
if ((Coefficients->Lower()!=1 ) ||
(Coefficients->Upper()!= 3*NbUSurfaces*NbVSurfaces*
(RealUDegree + 1) * (RealVDegree + 1)) )
{
Standard_DomainError::Raise("Convert : Wrong Coefficients");
throw Standard_DomainError("Convert : Wrong Coefficients");
}
// Calcul des degree
@@ -121,11 +119,9 @@ Convert_GridPolynomialToPoles(
}
if (myUDegree > RealUDegree)
Standard_DomainError::Raise
("Convert : Incoherence beetween NumCoeffPerSurface and MaxUDegree");
throw Standard_DomainError("Convert : Incoherence beetween NumCoeffPerSurface and MaxUDegree");
if (myVDegree > RealVDegree)
Standard_DomainError::Raise
("Convert : Incoherence beetween NumCoeffPerSurface and MaxVDegree");
throw Standard_DomainError("Convert : Incoherence beetween NumCoeffPerSurface and MaxVDegree");
Perform (UContinuity, VContinuity,
RealUDegree, RealVDegree,

View File

@@ -206,7 +206,7 @@ void BuildHermitePolynomialCosAndSin
{
if (num_poles%2 != 0) {
Standard_ConstructionError::Raise();
throw Standard_ConstructionError();
}
Standard_Integer ii;
Standard_Integer ordre_deriv = num_poles/2;
@@ -286,7 +286,7 @@ void BuildHermitePolynomialCosAndSin
ContactOrderArray,Poles,InversionPb);
if (InversionPb !=0) {
Standard_ConstructionError::Raise();
throw Standard_ConstructionError();
}
for (ii=1; ii<=num_poles; ii++) {
CosNumeratorPtr->SetValue(ii,Poles(ii).X());