Port to occ7.2:

+ Standard_Failure::Caught() is now marked as deprecated and should be replaced with standard C++ exception handling
This commit is contained in:
wmayer
2017-09-01 14:16:24 +02:00
parent 5aa60a4d3b
commit 949c86d364
96 changed files with 1497 additions and 1714 deletions

View File

@@ -294,9 +294,9 @@ bool Geom2dCurve::closestParameter(const Base::Vector2d& point, double &u) const
return true;
}
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
std::cout << e->GetMessageString() << std::endl;
catch (Standard_Failure& e) {
std::cout << e.GetMessageString() << std::endl;
return false;
}
@@ -318,9 +318,9 @@ bool Geom2dCurve::closestParameterToBasicCurve(const Base::Vector2d& point, doub
return true;
}
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
std::cout << e->GetMessageString() << std::endl;
catch (Standard_Failure& e) {
std::cout << e.GetMessageString() << std::endl;
return false;
}
@@ -450,9 +450,9 @@ void Geom2dBSplineCurve::setPole(int index, const Base::Vector2d& pole, double w
else
myCurve->SetPole(index+1,pnt,weight);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
std::cout << e->GetMessageString() << std::endl;
catch (Standard_Failure& e) {
std::cout << e.GetMessageString() << std::endl;
}
}
@@ -621,9 +621,9 @@ void Geom2dConic::setLocation(const Base::Vector2d& Center)
try {
conic->SetLocation(p1);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -701,9 +701,9 @@ void Geom2dArcOfConic::setLocation(const Base::Vector2d& Center)
try {
conic->SetLocation(p1);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -765,9 +765,9 @@ void Geom2dArcOfConic::setRange(double u, double v)
Handle(Geom2d_TrimmedCurve) curve = Handle(Geom2d_TrimmedCurve)::DownCast(handle());
curve->SetTrim(u, v);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -853,9 +853,9 @@ void Geom2dCircle::setRadius(double Radius)
c.SetRadius(Radius);
circle->SetCirc2d(c);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -902,9 +902,9 @@ void Geom2dCircle::Restore(Base::XMLReader& reader)
this->myCurve = mc.Value();
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -967,9 +967,9 @@ void Geom2dArcOfCircle::setRadius(double Radius)
c.SetRadius(Radius);
circle->SetCirc2d(c);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1027,9 +1027,9 @@ void Geom2dArcOfCircle::Restore(Base::XMLReader &reader)
circle->SetCirc2d(tmpcircle->Circ2d());
this->myCurve->SetTrim(tmpcurve->FirstParameter(), tmpcurve->LastParameter());
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1081,9 +1081,9 @@ void Geom2dEllipse::setMajorRadius(double Radius)
try {
ellipse->SetMajorRadius(Radius);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1100,9 +1100,9 @@ void Geom2dEllipse::setMinorRadius(double Radius)
try {
ellipse->SetMinorRadius(Radius);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1136,9 +1136,9 @@ void Geom2dEllipse::setMajorAxisDir(Base::Vector2d newdir)
e.SetAxis(pos);
myCurve->SetElips2d(e);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1186,9 +1186,9 @@ void Geom2dEllipse::Restore(Base::XMLReader& reader)
this->myCurve = mc.Value();
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1254,9 +1254,9 @@ void Geom2dArcOfEllipse::setMajorRadius(double Radius)
try {
ellipse->SetMajorRadius(Radius);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1273,9 +1273,9 @@ void Geom2dArcOfEllipse::setMinorRadius(double Radius)
try {
ellipse->SetMinorRadius(Radius);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1313,9 +1313,9 @@ void Geom2dArcOfEllipse::setMajorAxisDir(Base::Vector2d newdir)
e.SetAxis(pos);
c->SetElips2d(e);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1376,9 +1376,9 @@ void Geom2dArcOfEllipse::Restore(Base::XMLReader &reader)
ellipse->SetElips2d(tmpellipse->Elips2d());
this->myCurve->SetTrim(tmpcurve->FirstParameter(), tmpcurve->LastParameter());
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1430,9 +1430,9 @@ void Geom2dHyperbola::setMajorRadius(double Radius)
try {
h->SetMajorRadius(Radius);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1449,9 +1449,9 @@ void Geom2dHyperbola::setMinorRadius(double Radius)
try {
h->SetMinorRadius(Radius);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1499,9 +1499,9 @@ void Geom2dHyperbola::Restore(Base::XMLReader& reader)
this->myCurve = mc.Value();
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1562,9 +1562,9 @@ void Geom2dArcOfHyperbola::setMajorRadius(double Radius)
try {
h->SetMajorRadius(Radius);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1581,9 +1581,9 @@ void Geom2dArcOfHyperbola::setMinorRadius(double Radius)
try {
h->SetMinorRadius(Radius);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1644,9 +1644,9 @@ void Geom2dArcOfHyperbola::Restore(Base::XMLReader &reader)
hyperbola->SetHypr2d(tmphyperbola->Hypr2d());
this->myCurve->SetTrim(tmpcurve->FirstParameter(), tmpcurve->LastParameter());
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1698,9 +1698,9 @@ void Geom2dParabola::setFocal(double length)
try {
p->SetFocal(length);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1747,9 +1747,9 @@ void Geom2dParabola::Restore(Base::XMLReader& reader)
this->myCurve = mc.Value();
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1810,9 +1810,9 @@ void Geom2dArcOfParabola::setFocal(double length)
try {
p->SetFocal(length);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1871,9 +1871,9 @@ void Geom2dArcOfParabola::Restore(Base::XMLReader &reader)
parabola->SetParab2d(tmpparabola->Parab2d());
this->myCurve->SetTrim(tmpcurve->FirstParameter(), tmpcurve->LastParameter());
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -1981,9 +1981,9 @@ void Geom2dLine::Restore(Base::XMLReader &reader)
this->myCurve = mc.Value();
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -2065,9 +2065,9 @@ void Geom2dLineSegment::setPoints(const Base::Vector2d& Start, const Base::Vecto
this_line->SetLin2d(that_line->Lin2d());
this_curv->SetTrim(that_curv->FirstParameter(), that_curv->LastParameter());
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}
@@ -2118,9 +2118,9 @@ void Geom2dLineSegment::Restore(Base::XMLReader &reader)
this->myCurve = mc.Value();
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString());
catch (Standard_Failure& e) {
throw Base::Exception(e.GetMessageString());
}
}