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

@@ -148,7 +148,7 @@ static void BuildDomains(TopoDS_Face& myFace,
if (myFace.IsNull()) {
myFace = BRepBuilderAPI_MakeFace(TopoDS::Wire(WorkWires.First()),Standard_True);
if (myFace.IsNull())
StdFail_NotDone::Raise ("BRepOffsetAPI_MakeOffset : the wire is not planar");
throw StdFail_NotDone("BRepOffsetAPI_MakeOffset : the wire is not planar");
}
// Modified by Sergey KHROMOV - Thu Apr 26 16:04:43 2001 Begin
TopExp_Explorer anExp(myFace, TopAbs_WIRE);
@@ -189,7 +189,7 @@ static void BuildDomains(TopoDS_Face& myFace,
}
FR.Perform();
if (!FR.IsDone()) {
StdFail_NotDone::Raise ("BRepOffsetAPI_MakeOffset : Build Domains");
throw StdFail_NotDone("BRepOffsetAPI_MakeOffset : Build Domains");
}
TopTools_ListOfShape Faces;
#ifdef OCCT_DEBUG
@@ -354,13 +354,13 @@ void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset,
else
Done();
}
catch(Standard_Failure) //Every exception was caught.
{
catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"An exception was caught in BRepOffsetAPI_MakeOffset::Perform : ";
Standard_ConstructionError::Caught()->Print(cout);
anException.Print(cout);
cout<<endl;
#endif
(void)anException;
NotDone();
myShape.Nullify();
}

View File

@@ -277,7 +277,7 @@ void BRepOffsetAPI_MakePipeShell::SetMaxSegments(const Standard_Integer NewMaxSe
//=======================================================================
Standard_Boolean BRepOffsetAPI_MakePipeShell::MakeSolid()
{
if (!IsDone()) StdFail_NotDone::Raise("BRepOffsetAPI_MakePipeShell::MakeSolid");
if (!IsDone()) throw StdFail_NotDone("BRepOffsetAPI_MakePipeShell::MakeSolid");
Standard_Boolean Ok;
Ok = myPipe->MakeSolid();
if (Ok) myShape = myPipe->Shape();

View File

@@ -193,7 +193,7 @@ static TopoDS_Solid MakeSolid(TopoDS_Shell& shell, const TopoDS_Wire& wire1,
TopoDS_Face& face1, TopoDS_Face& face2)
{
if (shell.IsNull())
StdFail_NotDone::Raise("Thrusections is not build");
throw StdFail_NotDone("Thrusections is not build");
Standard_Boolean B = shell.Closed();
BRep_Builder BB;
@@ -346,7 +346,7 @@ void BRepOffsetAPI_ThruSections::Build()
wdeg = wdeg && (BRep_Tool::Degenerated(anEdge));
}
if (wdeg)
Standard_Failure::Raise("Wrong usage of punctual sections");
throw Standard_Failure("Wrong usage of punctual sections");
}
if (myWires.Length() <= 2)
{
@@ -358,7 +358,7 @@ void BRepOffsetAPI_ThruSections::Build()
wdeg = wdeg && (BRep_Tool::Degenerated(anEdge));
}
if (wdeg)
Standard_Failure::Raise("Wrong usage of punctual sections");
throw Standard_Failure("Wrong usage of punctual sections");
}
if (myWCheck) {
@@ -878,7 +878,7 @@ static Handle(Geom_BSplineCurve) EdgeToBSpline (const TopoDS_Edge& theEdge)
Standard_Real aFirst, aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve (theEdge, aLoc, aFirst, aLast);
if (aCurve.IsNull())
Standard_NullObject::Raise("Null 3D curve in edge");
throw Standard_NullObject("Null 3D curve in edge");
// convert its part used by edge to bspline; note that if edge curve is bspline,
// conversion made via trimmed curve is still needed -- it will copy it, segment
@@ -1106,7 +1106,7 @@ void BRepOffsetAPI_ThruSections::CriteriumWeight(Standard_Real& W1, Standard_Rea
void BRepOffsetAPI_ThruSections::SetCriteriumWeight(const Standard_Real W1, const Standard_Real W2, const Standard_Real W3)
{
if (W1 < 0 || W2 < 0 || W3 < 0 ) Standard_DomainError::Raise();
if (W1 < 0 || W2 < 0 || W3 < 0 ) throw Standard_DomainError();
myCritWeights[0] = W1;
myCritWeights[1] = W2;
myCritWeights[2] = W3;