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

@@ -79,13 +79,13 @@ inline Standard_Boolean IntPatch_ALine::HasLastPoint () const
inline const IntPatch_Point& IntPatch_ALine::FirstPoint () const
{
if (!fipt) {Standard_DomainError::Raise();}
if (!fipt) {throw Standard_DomainError();}
return svtx(indf);
}
inline const IntPatch_Point& IntPatch_ALine::LastPoint () const
{
if (!lapt) {Standard_DomainError::Raise();}
if (!lapt) {throw Standard_DomainError();}
return svtx(indl);
}

View File

@@ -41,35 +41,35 @@ inline void IntPatch_GLine::SetLastPoint (const Standard_Integer IndLast)
inline gp_Lin IntPatch_GLine::Line () const
{
if (typ != IntPatch_Lin) {Standard_DomainError::Raise();}
if (typ != IntPatch_Lin) {throw Standard_DomainError();}
return gp_Lin(pos.Axis());
}
inline gp_Circ IntPatch_GLine::Circle () const
{
if (typ != IntPatch_Circle) {Standard_DomainError::Raise();}
if (typ != IntPatch_Circle) {throw Standard_DomainError();}
return gp_Circ(pos,par1);
}
inline gp_Elips IntPatch_GLine::Ellipse () const
{
if (typ != IntPatch_Ellipse) {Standard_DomainError::Raise();}
if (typ != IntPatch_Ellipse) {throw Standard_DomainError();}
return gp_Elips(pos,par1,par2);
}
inline gp_Parab IntPatch_GLine::Parabola () const
{
if (typ != IntPatch_Parabola) {Standard_DomainError::Raise();}
if (typ != IntPatch_Parabola) {throw Standard_DomainError();}
return gp_Parab(pos,par1);
}
inline gp_Hypr IntPatch_GLine::Hyperbola () const
{
if (typ != IntPatch_Hyperbola) {Standard_DomainError::Raise();}
if (typ != IntPatch_Hyperbola) {throw Standard_DomainError();}
return gp_Hypr(pos,par1,par2);
}
@@ -88,14 +88,14 @@ inline Standard_Boolean IntPatch_GLine::HasLastPoint () const
inline const IntPatch_Point& IntPatch_GLine::FirstPoint () const
{
if (!fipt) {Standard_DomainError::Raise();}
if (!fipt) {throw Standard_DomainError();}
return svtx(indf);
}
inline const IntPatch_Point& IntPatch_GLine::LastPoint () const
{
if (!lapt) {Standard_DomainError::Raise();}
if (!lapt) {throw Standard_DomainError();}
return svtx(indl);
}

View File

@@ -289,7 +289,7 @@ void IntPatch_HInterTool::Value(const Handle(Adaptor2d_HCurve2d)&,
Standard_Real&,
Standard_Real&)
{
Standard_OutOfRange::Raise();
throw Standard_OutOfRange();
}
Standard_Boolean IntPatch_HInterTool::IsVertex(const Handle(Adaptor2d_HCurve2d)&,
@@ -302,7 +302,7 @@ void IntPatch_HInterTool::Vertex(const Handle(Adaptor2d_HCurve2d)&,
const Standard_Integer,
Handle(Adaptor3d_HVertex)&)
{
Standard_OutOfRange::Raise();
throw Standard_OutOfRange();
}
Standard_Integer IntPatch_HInterTool::NbSegments(const Handle(Adaptor2d_HCurve2d)&)
@@ -314,16 +314,14 @@ Standard_Boolean IntPatch_HInterTool::HasFirstPoint (const Handle(Adaptor2d_HCur
const Standard_Integer,
Standard_Integer&)
{
Standard_OutOfRange::Raise();
return Standard_False;
throw Standard_OutOfRange();
}
Standard_Boolean IntPatch_HInterTool::HasLastPoint (const Handle(Adaptor2d_HCurve2d)&,
const Standard_Integer,
Standard_Integer&)
{
Standard_OutOfRange::Raise();
return Standard_False;
throw Standard_OutOfRange();
}
Standard_Boolean IntPatch_HInterTool::IsAllSolution (const Handle(Adaptor2d_HCurve2d)&)

View File

@@ -31,43 +31,43 @@ inline IntPatch_ImpImpIntersection::IntStatus
inline Standard_Boolean IntPatch_ImpImpIntersection::IsEmpty () const
{
if (!IsDone ()) { StdFail_NotDone::Raise(); }
if (!IsDone ()) { throw StdFail_NotDone(); }
return empt;
}
inline Standard_Boolean IntPatch_ImpImpIntersection::TangentFaces () const
{
if (!IsDone ()) { StdFail_NotDone::Raise(); }
if (!IsDone ()) { throw StdFail_NotDone(); }
return tgte;
}
inline Standard_Boolean IntPatch_ImpImpIntersection::OppositeFaces () const
{
if (!IsDone ()) { StdFail_NotDone::Raise(); }
if (!tgte) {Standard_DomainError::Raise();}
if (!IsDone ()) { throw StdFail_NotDone(); }
if (!tgte) {throw Standard_DomainError();}
return oppo;
}
inline Standard_Integer IntPatch_ImpImpIntersection::NbPnts () const
{
if (!IsDone ()) { StdFail_NotDone::Raise(); }
if (!IsDone ()) { throw StdFail_NotDone(); }
return spnt.Length();
}
inline const IntPatch_Point& IntPatch_ImpImpIntersection::Point (const Standard_Integer Index) const
{
if (!IsDone ()) { StdFail_NotDone::Raise(); }
if (!IsDone ()) { throw StdFail_NotDone(); }
return spnt(Index);
}
inline Standard_Integer IntPatch_ImpImpIntersection::NbLines () const
{
if (!IsDone ()) { StdFail_NotDone::Raise(); }
if (!IsDone ()) { throw StdFail_NotDone(); }
return slin.Length();
}
inline const Handle(IntPatch_Line)& IntPatch_ImpImpIntersection::Line (const Standard_Integer Index) const
{
if (!IsDone ()) { StdFail_NotDone::Raise(); }
if (!IsDone ()) { throw StdFail_NotDone(); }
return slin(Index);
}

View File

@@ -90,7 +90,7 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
const Standard_Integer iT2 = SetQuad(S2, typs2, quad2);
//
if (!iT1 || !iT2) {
Standard_ConstructionError::Raise();
throw Standard_ConstructionError();
return;
}
//
@@ -298,7 +298,7 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
}
//
default: {
Standard_ConstructionError::Raise();
throw Standard_ConstructionError();
break;
}
}

View File

@@ -222,7 +222,7 @@ ComputationMethods::stCoeffsValue::stCoeffsValue(const gp_Cylinder& theCyl1,
// AxeOperator::AxeOperator(...) in IntAna_QuadQuadGeo.cxx file).
if(Abs(aDetV1V2) < Precision::Angular())
{
Standard_Failure::Raise("Error. Exception in divide by zerro (IntCyCyTrim)!!!!");
throw Standard_Failure("Error. Exception in divide by zerro (IntCyCyTrim)!!!!");
}
switch(aFoundCouple)
@@ -1276,7 +1276,7 @@ Standard_Boolean CyCyAnalyticalIntersect( const IntSurf_Quadric& Quad1,
case IntAna_Parabola:
case IntAna_Hyperbola:
Standard_Failure::Raise("IntCyCy(): Wrong intersection type!");
throw Standard_Failure("IntCyCy(): Wrong intersection type!");
case IntAna_Circle:
// Circle is useful when we will work with trimmed surfaces
@@ -1388,7 +1388,7 @@ Standard_Boolean ComputationMethods::CylCylMonotonicity(const Standard_Real theU
isPlus = Standard_False;
break;
default:
//Standard_Failure::Raise("Error. Range Error!!!!");
//throw Standard_Failure("Error. Range Error!!!!");
return Standard_False;
}

View File

@@ -549,7 +549,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
break;
default:
{
Standard_ConstructionError::Raise();
throw Standard_ConstructionError();
break;
}
}

View File

@@ -24,30 +24,30 @@ inline Standard_Boolean IntPatch_ImpPrmIntersection::IsDone () const
inline Standard_Boolean IntPatch_ImpPrmIntersection::IsEmpty () const
{
if (!done) {StdFail_NotDone::Raise();}
if (!done) {throw StdFail_NotDone();}
return empt;
}
inline Standard_Integer IntPatch_ImpPrmIntersection::NbPnts () const
{
if (!done) {StdFail_NotDone::Raise();}
if (!done) {throw StdFail_NotDone();}
return spnt.Length();
}
inline const IntPatch_Point& IntPatch_ImpPrmIntersection::Point (const Standard_Integer Index) const
{
if (!done) {StdFail_NotDone::Raise();}
if (!done) {throw StdFail_NotDone();}
return spnt(Index);
}
inline Standard_Integer IntPatch_ImpPrmIntersection::NbLines () const
{
if (!done) {StdFail_NotDone::Raise();}
if (!done) {throw StdFail_NotDone();}
return slin.Length();
}
inline const Handle(IntPatch_Line)& IntPatch_ImpPrmIntersection::Line (const Standard_Integer Index) const
{
if (!done) {StdFail_NotDone::Raise();}
if (!done) {throw StdFail_NotDone();}
return slin(Index);
}

View File

@@ -24,43 +24,43 @@ inline Standard_Boolean IntPatch_Intersection::IsDone () const
inline Standard_Boolean IntPatch_Intersection::IsEmpty () const
{
if (!done) {StdFail_NotDone::Raise();}
if (!done) {throw StdFail_NotDone();}
return empt;
}
inline Standard_Boolean IntPatch_Intersection::TangentFaces () const
{
if (!done) {StdFail_NotDone::Raise();}
if (!done) {throw StdFail_NotDone();}
return tgte;
}
inline Standard_Boolean IntPatch_Intersection::OppositeFaces () const
{
if (!done) {StdFail_NotDone::Raise();}
if (!tgte) {Standard_DomainError::Raise();}
if (!done) {throw StdFail_NotDone();}
if (!tgte) {throw Standard_DomainError();}
return oppo;
}
inline Standard_Integer IntPatch_Intersection::NbPnts () const
{
if (!done) {StdFail_NotDone::Raise();}
if (!done) {throw StdFail_NotDone();}
return spnt.Length();
}
inline const IntPatch_Point& IntPatch_Intersection::Point (const Standard_Integer Index) const
{
if (!done) {StdFail_NotDone::Raise();}
if (!done) {throw StdFail_NotDone();}
return spnt(Index);
}
inline Standard_Integer IntPatch_Intersection::NbLines () const
{
if (!done) {StdFail_NotDone::Raise();}
if (!done) {throw StdFail_NotDone();}
return slin.Length();
}
inline const Handle(IntPatch_Line)& IntPatch_Intersection::Line (const Standard_Integer Index) const
{
if (!done) {StdFail_NotDone::Raise();}
if (!done) {throw StdFail_NotDone();}
return slin(Index);
}

View File

@@ -50,14 +50,14 @@ inline IntSurf_TypeTrans IntPatch_Line::TransitionOnS2 () const {
inline IntSurf_Situation IntPatch_Line::SituationS1 () const {
if (tS1 != IntSurf_Touch) {Standard_DomainError::Raise();}
if (tS1 != IntSurf_Touch) {throw Standard_DomainError();}
return sit1;
}
inline IntSurf_Situation IntPatch_Line::SituationS2 () const {
if (tS2 != IntSurf_Touch) {Standard_DomainError::Raise();}
if (tS2 != IntSurf_Touch) {throw Standard_DomainError();}
return sit2;
}

View File

@@ -163,7 +163,7 @@ static void Parameters(const Handle(Adaptor3d_HSurface)& myHS1,
quad1.SetValue(myHS1->Surface().Torus());
break;
default:
Standard_ConstructionError::Raise("IntPatch_IntSS::MakeCurve");
throw Standard_ConstructionError("IntPatch_IntSS::MakeCurve");
}
typs = myHS2->Surface().GetType();
@@ -184,7 +184,7 @@ static void Parameters(const Handle(Adaptor3d_HSurface)& myHS1,
quad2.SetValue(myHS2->Surface().Torus());
break;
default:
Standard_ConstructionError::Raise("IntPatch_IntSS::MakeCurve");
throw Standard_ConstructionError("IntPatch_IntSS::MakeCurve");
}
quad1.Parameters(Ptref,U1,V1);
quad2.Parameters(Ptref,U2,V2);
@@ -728,7 +728,7 @@ static void AddLine(const Handle(IntPatch_Line)& L,
break;
}
default: {
Standard_ConstructionError::Raise("IntPatch_LineConstructor::AddLine");
throw Standard_ConstructionError("IntPatch_LineConstructor::AddLine");
}
break;
}

View File

@@ -119,35 +119,35 @@ inline Standard_Boolean IntPatch_Point::IsVertexOnS1 () const
inline const Handle(Adaptor3d_HVertex)& IntPatch_Point::VertexOnS1 () const
{
if (!vtxonS1) {Standard_DomainError::Raise();}
if (!vtxonS1) {throw Standard_DomainError();}
return vS1;
}
inline const Handle(Adaptor2d_HCurve2d)& IntPatch_Point::ArcOnS1 () const
{
if (!onS1) {Standard_DomainError::Raise();}
if (!onS1) {throw Standard_DomainError();}
return arcS1;
}
inline const IntSurf_Transition& IntPatch_Point::TransitionLineArc1 () const
{
if (!onS1) {Standard_DomainError::Raise();}
if (!onS1) {throw Standard_DomainError();}
return traline1;
}
inline const IntSurf_Transition& IntPatch_Point::TransitionOnS1 () const
{
if (!onS1) {Standard_DomainError::Raise();}
if (!onS1) {throw Standard_DomainError();}
return tra1;
}
inline Standard_Real IntPatch_Point::ParameterOnArc1 () const
{
if (!onS1) {Standard_DomainError::Raise();}
if (!onS1) {throw Standard_DomainError();}
return prm1;
}
@@ -166,35 +166,35 @@ inline Standard_Boolean IntPatch_Point::IsVertexOnS2 () const
inline const Handle(Adaptor3d_HVertex)& IntPatch_Point::VertexOnS2 () const
{
if (!vtxonS2) {Standard_DomainError::Raise();}
if (!vtxonS2) {throw Standard_DomainError();}
return vS2;
}
inline const Handle(Adaptor2d_HCurve2d)& IntPatch_Point::ArcOnS2 () const
{
if (!onS2) {Standard_DomainError::Raise();}
if (!onS2) {throw Standard_DomainError();}
return arcS2;
}
inline const IntSurf_Transition& IntPatch_Point::TransitionLineArc2 () const
{
if (!onS2) {Standard_DomainError::Raise();}
if (!onS2) {throw Standard_DomainError();}
return traline2;
}
inline const IntSurf_Transition& IntPatch_Point::TransitionOnS2 () const
{
if (!onS2) {Standard_DomainError::Raise();}
if (!onS2) {throw Standard_DomainError();}
return tra2;
}
inline Standard_Real IntPatch_Point::ParameterOnArc2 () const
{
if (!onS2) {Standard_DomainError::Raise();}
if (!onS2) {throw Standard_DomainError();}
return prm2;
}

View File

@@ -47,7 +47,7 @@ IntPatch_PolyArc::IntPatch_PolyArc(const Handle(Adaptor2d_HCurve2d)& Line ,
gp_Pnt2d p2d;
if (Pdeb == RealFirst() || Pfin == RealLast() || NbSample <= 1) {
Standard_ConstructionError::Raise();
throw Standard_ConstructionError();
}
//----------------------------------------------------------------------
//-- On veut eviter les cas ou le present polygone est beaucoup plus

View File

@@ -1218,7 +1218,7 @@ Handle(IntPatch_Line) IntPatch_PrmPrmIntersection::NewLine (const Handle(Adaptor
{
Standard_Integer NbPnts = NbPntsToInsert + High - Low;
if(NumLine>NbLines() || NumLine<1 || Low>=High )
Standard_OutOfRange::Raise(" IntPatch_PrmPrmIntersection NewLine ");
throw Standard_OutOfRange(" IntPatch_PrmPrmIntersection NewLine ");
//------------------------------------------------------------------
//-- Indice : Low Low+1 I I+1 High --
//-- --

View File

@@ -26,7 +26,7 @@
//======================================================================
inline Standard_Integer IntPatch_PrmPrmIntersection::NbLines() const {
if(!done)
StdFail_NotDone::Raise(" IntPatch_PrmPrmIntersection ");
throw StdFail_NotDone(" IntPatch_PrmPrmIntersection ");
return(SLin.Length());
}
@@ -34,14 +34,14 @@ inline Standard_Integer IntPatch_PrmPrmIntersection::NbLines() const {
inline const Handle(IntPatch_Line)& IntPatch_PrmPrmIntersection::Line
(const Standard_Integer n) const {
if(!done)
StdFail_NotDone::Raise(" IntPatch_PrmPrmIntersection ");
throw StdFail_NotDone(" IntPatch_PrmPrmIntersection ");
return(SLin.Value(n));
}
//======================================================================
inline Standard_Boolean IntPatch_PrmPrmIntersection::IsEmpty() const {
if(!done)
StdFail_NotDone::Raise(" IntPatch_PrmPrmIntersection ");
throw StdFail_NotDone(" IntPatch_PrmPrmIntersection ");
return(empt);
}

View File

@@ -86,13 +86,13 @@ inline Standard_Boolean IntPatch_RLine::HasLastPoint () const
inline const IntPatch_Point& IntPatch_RLine::FirstPoint () const
{
if (!fipt) {Standard_DomainError::Raise();}
if (!fipt) {throw Standard_DomainError();}
return svtx(indf);
}
inline const IntPatch_Point& IntPatch_RLine::LastPoint () const
{
if (!lapt) {Standard_DomainError::Raise();}
if (!lapt) {throw Standard_DomainError();}
return svtx(indl);
}
@@ -114,7 +114,7 @@ inline IntPatch_Point& IntPatch_RLine::ChangeVertex (const Standard_Integer Inde
inline void IntPatch_RLine::RemoveVertex(const Standard_Integer theIndex)
{
if((theIndex < 1) || (theIndex > NbVertex()))
Standard_OutOfRange::Raise("Cannot delete not existing vertex");
throw Standard_OutOfRange("Cannot delete not existing vertex");
svtx.Remove(theIndex);
}
@@ -125,13 +125,13 @@ inline Standard_Boolean IntPatch_RLine::HasPolygon () const
inline Standard_Integer IntPatch_RLine::NbPnts () const
{
if (curv.IsNull()) {Standard_DomainError::Raise();}
if (curv.IsNull()) {throw Standard_DomainError();}
return curv->NbPoints();
}
inline const IntSurf_PntOn2S& IntPatch_RLine::Point (const Standard_Integer Index) const
{
if (curv.IsNull()) {Standard_DomainError::Raise();}
if (curv.IsNull()) {throw Standard_DomainError();}
return curv->Value(Index);
}

View File

@@ -382,7 +382,7 @@ static Standard_Boolean FindParameter(const Handle(IntPatch_Line)& L,
if (found) return Standard_True;
}
else {
Standard_DomainError::Raise();
throw Standard_DomainError();
}
return Standard_False;
}
@@ -499,7 +499,7 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L,
Nbptlin = rlin->NbPnts();
}
else {
Standard_DomainError::Raise();
throw Standard_DomainError();
}
if (!Domain->Has3d())
// don't use computed deflection in the mode of pure geometric intersection

View File

@@ -374,7 +374,7 @@ Standard_Boolean IntPatch_SpecialPoints::
}
else
{
Standard_TypeMismatch::Raise( "IntPatch_SpecialPoints::AddSingularPole(),"
throw Standard_TypeMismatch( "IntPatch_SpecialPoints::AddSingularPole(),"
"Unsupported quadric with Pole");
}

View File

@@ -68,26 +68,26 @@ inline Standard_Boolean IntPatch_WLine::HasLastPoint () const
inline const IntPatch_Point& IntPatch_WLine::FirstPoint () const
{
if (!fipt) {Standard_DomainError::Raise();}
if (!fipt) {throw Standard_DomainError();}
return svtx(indf);
}
inline const IntPatch_Point& IntPatch_WLine::LastPoint () const
{
if (!lapt) {Standard_DomainError::Raise();}
if (!lapt) {throw Standard_DomainError();}
return svtx(indl);
}
inline const IntPatch_Point& IntPatch_WLine::FirstPoint (Standard_Integer& Indfirst) const
{
if (!fipt) {Standard_DomainError::Raise();}
if (!fipt) {throw Standard_DomainError();}
Indfirst = indf;
return svtx(indf);
}
inline const IntPatch_Point& IntPatch_WLine::LastPoint (Standard_Integer& Indlast) const
{
if (!lapt) {Standard_DomainError::Raise();}
if (!lapt) {throw Standard_DomainError();}
Indlast = indl;
return svtx(indl);
}
@@ -115,7 +115,7 @@ inline void IntPatch_WLine::ClearVertexes()
inline void IntPatch_WLine::RemoveVertex(const Standard_Integer theIndex)
{
if((theIndex < 1) || (theIndex > NbVertex()))
Standard_OutOfRange::Raise("Cannot delete not existing vertex");
throw Standard_OutOfRange("Cannot delete not existing vertex");
svtx.Remove(theIndex);
}