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

@@ -142,7 +142,7 @@ void FEmTool_Assembly::AddMatrix(const Standard_Integer Element,
{
if(myDepTable(Dimension1, Dimension2) == 0)
Standard_DomainError::Raise("FEmTool_Assembly::AddMatrix");
throw Standard_DomainError("FEmTool_Assembly::AddMatrix");
const TColStd_Array1OfInteger & T1 = myRefTable->Value(Dimension1,Element)->Array1();
const TColStd_Array1OfInteger & T2 = myRefTable->Value(Dimension2,Element)->Array1();
@@ -362,7 +362,7 @@ Standard_Boolean FEmTool_Assembly::Solve()
//=======================================================================
void FEmTool_Assembly::Solution(math_Vector& Solution) const
{
if(!IsSolved) StdFail_NotDone::Raise("FEmTool_Assembly::Solution");
if(!IsSolved) throw StdFail_NotDone("FEmTool_Assembly::Solution");
if(G.IsEmpty()) H->Solve(B, Solution);
else {

View File

@@ -69,7 +69,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension,
const TColStd_Array2OfReal& Coeffs)
{
Standard_Integer i, j, degBase, deg;
if (IndexOfElement > myNbElements || IndexOfElement < 1) Standard_OutOfRange::Raise();
if (IndexOfElement > myNbElements || IndexOfElement < 1) throw Standard_OutOfRange();
degBase = myBase->WorkDegree();
deg = myDegree(IndexOfElement);
Standard_Integer iBase = (IndexOfElement - 1)*(degBase + 1)*myDimension,
@@ -108,7 +108,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension,
void FEmTool_Curve::GetElement(const Standard_Integer IndexOfElement, TColStd_Array2OfReal& Coeffs)
{
Standard_Integer i, j, degBase, deg;
if (IndexOfElement > myNbElements || IndexOfElement < 1) Standard_OutOfRange::Raise();
if (IndexOfElement > myNbElements || IndexOfElement < 1) throw Standard_OutOfRange();
degBase = myBase->WorkDegree();
deg = myDegree(IndexOfElement);
Standard_Integer iBase = (IndexOfElement - 1)*(degBase + 1)*myDimension,
@@ -286,7 +286,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension,
Standard_Real& Length)
{
Standard_Integer Low, High, deg, degBase, i, Ptr;
if(FirstU > LastU) Standard_OutOfRange::Raise("FEmTool_Curve::Length");
if(FirstU > LastU) throw Standard_OutOfRange("FEmTool_Curve::Length");
if(myKnots->Value(1) > FirstU) Low = 1;
else
@@ -403,7 +403,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension,
HasPoly(IndexOfElement) = HasDeri(IndexOfElement) = HasSecn(IndexOfElement) = 0;
myLength(IndexOfElement) = -1;
}
else if(Degree > myBase->WorkDegree()) Standard_OutOfRange::Raise("FEmTool_Curve::SetDegree");
else if(Degree > myBase->WorkDegree()) throw Standard_OutOfRange("FEmTool_Curve::SetDegree");
}

View File

@@ -25,7 +25,7 @@ FEmTool_ElementsOfRefMatrix::FEmTool_ElementsOfRefMatrix(const Handle(PLib_Base)
myBase(TheBase)
{
if(DerOrder < 0 || DerOrder > 3)
Standard_ConstructionError::Raise("FEmTool_ElementsOfRefMatrix");
throw Standard_ConstructionError("FEmTool_ElementsOfRefMatrix");
myDerOrder = DerOrder;
myNbEquations = (myBase->WorkDegree()+2)*(myBase->WorkDegree()+1)/2;
@@ -44,7 +44,7 @@ Standard_Integer FEmTool_ElementsOfRefMatrix::NbEquations() const
Standard_Boolean FEmTool_ElementsOfRefMatrix::Value(const math_Vector& X, math_Vector& F)
{
if(F.Length() < myNbEquations) Standard_OutOfRange::Raise("FEmTool_ElementsOfRefMatrix::Value");
if(F.Length() < myNbEquations) throw Standard_OutOfRange("FEmTool_ElementsOfRefMatrix::Value");
Standard_Real u = X(X.Lower());
TColStd_Array1OfReal Basis(0,myBase->WorkDegree()), Aux(0,myBase->WorkDegree());

View File

@@ -49,7 +49,7 @@ FEmTool_LinearFlexion::FEmTool_LinearFlexion(const Standard_Integer WorkDegree,
if (myOrder != Order) {
//Calculating RefMatrix
if (WorkDegree > WDeg) Standard_ConstructionError::Raise("Degree too high");
if (WorkDegree > WDeg) throw Standard_ConstructionError("Degree too high");
Order = myOrder;
Standard_Integer DerOrder = 2;
Handle(PLib_HermitJacobi) theBase = new PLib_HermitJacobi(WDeg, ConstraintOrder);
@@ -78,7 +78,7 @@ FEmTool_LinearFlexion::FEmTool_LinearFlexion(const Standard_Integer WorkDegree,
//=======================================================================
Handle(TColStd_HArray2OfInteger) FEmTool_LinearFlexion::DependenceTable() const
{
if(myCoeff.IsNull()) Standard_DomainError::Raise("FEmTool_LinearFlexion::DependenceTable");
if(myCoeff.IsNull()) throw Standard_DomainError("FEmTool_LinearFlexion::DependenceTable");
Handle(TColStd_HArray2OfInteger) DepTab =
new TColStd_HArray2OfInteger(myCoeff->LowerCol(), myCoeff->UpperCol(),
@@ -149,10 +149,10 @@ void FEmTool_LinearFlexion::Hessian(const Standard_Integer Dimension1,
if(Dimension1 < DepTab->LowerRow() || Dimension1 > DepTab->UpperRow() ||
Dimension2 < DepTab->LowerCol() || Dimension2 > DepTab->UpperCol())
Standard_OutOfRange::Raise("FEmTool_LinearJerk::Hessian");
throw Standard_OutOfRange("FEmTool_LinearJerk::Hessian");
if(DepTab->Value(Dimension1,Dimension2) == 0)
Standard_DomainError::Raise("FEmTool_LinearJerk::Hessian");
throw Standard_DomainError("FEmTool_LinearJerk::Hessian");
Standard_Integer deg = Min(RefMatrix.UpperRow(), H.RowNumber() - 1), degH = Min(2*myOrder+1, deg);
@@ -193,7 +193,7 @@ void FEmTool_LinearFlexion::Hessian(const Standard_Integer Dimension1,
void FEmTool_LinearFlexion::Gradient(const Standard_Integer Dimension,math_Vector& G)
{
if(Dimension < myCoeff->LowerCol() || Dimension > myCoeff->UpperCol())
Standard_OutOfRange::Raise("FEmTool_LinearFlexion::Gradient");
throw Standard_OutOfRange("FEmTool_LinearFlexion::Gradient");
Standard_Integer deg = Min(G.Length() - 1, myCoeff->ColLength() - 1);

View File

@@ -46,7 +46,7 @@ FEmTool_LinearJerk::FEmTool_LinearJerk(const Standard_Integer WorkDegree,
//Calculating RefMatrix
if (myOrder != Order) {
if (WorkDegree > WDeg) Standard_ConstructionError::Raise("Degree too high");
if (WorkDegree > WDeg) throw Standard_ConstructionError("Degree too high");
Order = myOrder;
Standard_Integer DerOrder = 3;
@@ -76,7 +76,7 @@ FEmTool_LinearJerk::FEmTool_LinearJerk(const Standard_Integer WorkDegree,
Handle(TColStd_HArray2OfInteger) FEmTool_LinearJerk::DependenceTable() const
{
if(myCoeff.IsNull()) Standard_DomainError::Raise("FEmTool_LinearJerk::DependenceTable");
if(myCoeff.IsNull()) throw Standard_DomainError("FEmTool_LinearJerk::DependenceTable");
Handle(TColStd_HArray2OfInteger) DepTab =
new TColStd_HArray2OfInteger(myCoeff->LowerCol(), myCoeff->UpperCol(),
@@ -141,10 +141,10 @@ void FEmTool_LinearJerk::Hessian(const Standard_Integer Dimension1,
if(Dimension1 < DepTab->LowerRow() || Dimension1 > DepTab->UpperRow() ||
Dimension2 < DepTab->LowerCol() || Dimension2 > DepTab->UpperCol())
Standard_OutOfRange::Raise("FEmTool_LinearJerk::Hessian");
throw Standard_OutOfRange("FEmTool_LinearJerk::Hessian");
if(DepTab->Value(Dimension1,Dimension2) == 0)
Standard_DomainError::Raise("FEmTool_LinearJerk::Hessian");
throw Standard_DomainError("FEmTool_LinearJerk::Hessian");
Standard_Integer deg = Min(RefMatrix.UpperRow(), H.RowNumber() - 1), degH = Min(2*myOrder+1, deg);
@@ -193,7 +193,7 @@ void FEmTool_LinearJerk::Hessian(const Standard_Integer Dimension1,
void FEmTool_LinearJerk::Gradient(const Standard_Integer Dimension,math_Vector& G)
{
if(Dimension < myCoeff->LowerCol() || Dimension > myCoeff->UpperCol())
Standard_OutOfRange::Raise("FEmTool_LinearJerk::Gradient");
throw Standard_OutOfRange("FEmTool_LinearJerk::Gradient");
Standard_Integer deg = Min(G.Length() - 1, myCoeff->ColLength() - 1);

View File

@@ -46,7 +46,7 @@ FEmTool_LinearTension::FEmTool_LinearTension(const Standard_Integer WorkDegree,
if (myOrder != Order) {
//Calculating RefMatrix
if (WorkDegree > WDeg) Standard_ConstructionError::Raise("Degree too high");
if (WorkDegree > WDeg) throw Standard_ConstructionError("Degree too high");
Order = myOrder;
Standard_Integer DerOrder = 1;
Handle(PLib_HermitJacobi) theBase = new PLib_HermitJacobi(WDeg, ConstraintOrder);
@@ -72,7 +72,7 @@ FEmTool_LinearTension::FEmTool_LinearTension(const Standard_Integer WorkDegree,
Handle(TColStd_HArray2OfInteger) FEmTool_LinearTension::DependenceTable() const
{
if(myCoeff.IsNull()) Standard_DomainError::Raise("FEmTool_LinearTension::DependenceTable");
if(myCoeff.IsNull()) throw Standard_DomainError("FEmTool_LinearTension::DependenceTable");
Handle(TColStd_HArray2OfInteger) DepTab =
new TColStd_HArray2OfInteger(myCoeff->LowerCol(), myCoeff->UpperCol(),
@@ -139,10 +139,10 @@ void FEmTool_LinearTension::Hessian(const Standard_Integer Dimension1,
if(Dimension1 < DepTab->LowerRow() || Dimension1 > DepTab->UpperRow() ||
Dimension2 < DepTab->LowerCol() || Dimension2 > DepTab->UpperCol())
Standard_OutOfRange::Raise("FEmTool_LinearTension::Hessian");
throw Standard_OutOfRange("FEmTool_LinearTension::Hessian");
if(DepTab->Value(Dimension1,Dimension2) == 0)
Standard_DomainError::Raise("FEmTool_LinearTension::Hessian");
throw Standard_DomainError("FEmTool_LinearTension::Hessian");
Standard_Integer deg = Min(RefMatrix.UpperRow(), H.RowNumber() - 1), degH = Min(2*myOrder+1, deg);
@@ -191,7 +191,7 @@ void FEmTool_LinearTension::Hessian(const Standard_Integer Dimension1,
void FEmTool_LinearTension::Gradient(const Standard_Integer Dimension, math_Vector& G)
{
if(Dimension < myCoeff->LowerCol() || Dimension > myCoeff->UpperCol())
Standard_OutOfRange::Raise("FEmTool_LinearTension::Gradient");
throw Standard_OutOfRange("FEmTool_LinearTension::Gradient");
Standard_Integer deg = Min(G.Length() - 1, myCoeff->ColLength() - 1);

View File

@@ -148,7 +148,7 @@ FEmTool_ProfileMatrix::FEmTool_ProfileMatrix(const TColStd_Array1OfInteger& Firs
//=======================================================================
void FEmTool_ProfileMatrix::Solve(const math_Vector& B,math_Vector& X) const
{
if (!IsDecomp) StdFail_NotDone::Raise("Decomposition must be done");
if (!IsDecomp) throw StdFail_NotDone("Decomposition must be done");
Standard_Integer i, j, jj,DiagAddr, CurrAddr;
Standard_Real Sum;
@@ -188,14 +188,13 @@ FEmTool_ProfileMatrix::FEmTool_ProfileMatrix(const TColStd_Array1OfInteger& Firs
Standard_Boolean FEmTool_ProfileMatrix::Prepare()
{
Standard_NotImplemented::Raise("FEmTool_ProfileMatrix::Prepare");
return Standard_False;
throw Standard_NotImplemented("FEmTool_ProfileMatrix::Prepare");
}
// void FEmTool_ProfileMatrix::Solve(const math_Vector& B,const math_Vector& Init,math_Vector& X,math_Vector& Residual,const Standard_Real Tolerance,const Standard_Integer NbIterations) const
void FEmTool_ProfileMatrix::Solve(const math_Vector& ,const math_Vector& ,math_Vector& ,math_Vector& ,const Standard_Real ,const Standard_Integer ) const
{
Standard_NotImplemented::Raise("FEmTool_ProfileMatrix::Solve");
throw Standard_NotImplemented("FEmTool_ProfileMatrix::Solve");
}