Replace Base::Exception with appropriate subclass
This commit is contained in:
@@ -622,8 +622,7 @@ void Geom2dConic::setLocation(const Base::Vector2d& Center)
|
||||
conic->SetLocation(p1);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -702,8 +701,7 @@ void Geom2dArcOfConic::setLocation(const Base::Vector2d& Center)
|
||||
conic->SetLocation(p1);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -766,8 +764,7 @@ void Geom2dArcOfConic::setRange(double u, double v)
|
||||
curve->SetTrim(u, v);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -854,8 +851,7 @@ void Geom2dCircle::setRadius(double Radius)
|
||||
circle->SetCirc2d(c);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -898,13 +894,12 @@ void Geom2dCircle::Restore(Base::XMLReader& reader)
|
||||
try {
|
||||
GCE2d_MakeCircle mc(axis, Radius);
|
||||
if (!mc.IsDone())
|
||||
throw Base::Exception(gce_ErrorStatusText(mc.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(mc.Status()));
|
||||
|
||||
this->myCurve = mc.Value();
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -968,8 +963,7 @@ void Geom2dArcOfCircle::setRadius(double Radius)
|
||||
circle->SetCirc2d(c);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1015,10 +1009,10 @@ void Geom2dArcOfCircle::Restore(Base::XMLReader &reader)
|
||||
try {
|
||||
GCE2d_MakeCircle mc(axis, Radius);
|
||||
if (!mc.IsDone())
|
||||
throw Base::Exception(gce_ErrorStatusText(mc.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(mc.Status()));
|
||||
GCE2d_MakeArcOfCircle ma(mc.Value()->Circ2d(), u, v);
|
||||
if (!ma.IsDone())
|
||||
throw Base::Exception(gce_ErrorStatusText(ma.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(ma.Status()));
|
||||
|
||||
Handle(Geom2d_TrimmedCurve) tmpcurve = ma.Value();
|
||||
Handle(Geom2d_Circle) tmpcircle = Handle(Geom2d_Circle)::DownCast(tmpcurve->BasisCurve());
|
||||
@@ -1028,8 +1022,7 @@ void Geom2dArcOfCircle::Restore(Base::XMLReader &reader)
|
||||
this->myCurve->SetTrim(tmpcurve->FirstParameter(), tmpcurve->LastParameter());
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1082,8 +1075,7 @@ void Geom2dEllipse::setMajorRadius(double Radius)
|
||||
ellipse->SetMajorRadius(Radius);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1101,8 +1093,7 @@ void Geom2dEllipse::setMinorRadius(double Radius)
|
||||
ellipse->SetMinorRadius(Radius);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1137,8 +1128,7 @@ void Geom2dEllipse::setMajorAxisDir(Base::Vector2d newdir)
|
||||
myCurve->SetElips2d(e);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1182,13 +1172,12 @@ void Geom2dEllipse::Restore(Base::XMLReader& reader)
|
||||
try {
|
||||
GCE2d_MakeEllipse mc(axis, MajorRadius, MinorRadius);
|
||||
if (!mc.IsDone())
|
||||
throw Base::Exception(gce_ErrorStatusText(mc.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(mc.Status()));
|
||||
|
||||
this->myCurve = mc.Value();
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1255,8 +1244,7 @@ void Geom2dArcOfEllipse::setMajorRadius(double Radius)
|
||||
ellipse->SetMajorRadius(Radius);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1274,8 +1262,7 @@ void Geom2dArcOfEllipse::setMinorRadius(double Radius)
|
||||
ellipse->SetMinorRadius(Radius);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1314,8 +1301,7 @@ void Geom2dArcOfEllipse::setMajorAxisDir(Base::Vector2d newdir)
|
||||
c->SetElips2d(e);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1363,11 +1349,11 @@ void Geom2dArcOfEllipse::Restore(Base::XMLReader &reader)
|
||||
try {
|
||||
GCE2d_MakeEllipse mc(axis, MajorRadius, MinorRadius);
|
||||
if (!mc.IsDone())
|
||||
throw Base::Exception(gce_ErrorStatusText(mc.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(mc.Status()));
|
||||
|
||||
GCE2d_MakeArcOfEllipse ma(mc.Value()->Elips2d(), u, v);
|
||||
if (!ma.IsDone())
|
||||
throw Base::Exception(gce_ErrorStatusText(ma.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(ma.Status()));
|
||||
|
||||
Handle(Geom2d_TrimmedCurve) tmpcurve = ma.Value();
|
||||
Handle(Geom2d_Ellipse) tmpellipse = Handle(Geom2d_Ellipse)::DownCast(tmpcurve->BasisCurve());
|
||||
@@ -1377,8 +1363,7 @@ void Geom2dArcOfEllipse::Restore(Base::XMLReader &reader)
|
||||
this->myCurve->SetTrim(tmpcurve->FirstParameter(), tmpcurve->LastParameter());
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1431,8 +1416,7 @@ void Geom2dHyperbola::setMajorRadius(double Radius)
|
||||
h->SetMajorRadius(Radius);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1450,8 +1434,7 @@ void Geom2dHyperbola::setMinorRadius(double Radius)
|
||||
h->SetMinorRadius(Radius);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1495,13 +1478,12 @@ void Geom2dHyperbola::Restore(Base::XMLReader& reader)
|
||||
try {
|
||||
GCE2d_MakeHyperbola mc(axis, MajorRadius, MinorRadius);
|
||||
if (!mc.IsDone())
|
||||
throw Base::Exception(gce_ErrorStatusText(mc.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(mc.Status()));
|
||||
|
||||
this->myCurve = mc.Value();
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1563,8 +1545,7 @@ void Geom2dArcOfHyperbola::setMajorRadius(double Radius)
|
||||
h->SetMajorRadius(Radius);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1582,8 +1563,7 @@ void Geom2dArcOfHyperbola::setMinorRadius(double Radius)
|
||||
h->SetMinorRadius(Radius);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1631,11 +1611,11 @@ void Geom2dArcOfHyperbola::Restore(Base::XMLReader &reader)
|
||||
try {
|
||||
GCE2d_MakeHyperbola mc(axis, MajorRadius, MinorRadius);
|
||||
if (!mc.IsDone())
|
||||
throw Base::Exception(gce_ErrorStatusText(mc.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(mc.Status()));
|
||||
|
||||
GCE2d_MakeArcOfHyperbola ma(mc.Value()->Hypr2d(), u, v);
|
||||
if (!ma.IsDone())
|
||||
throw Base::Exception(gce_ErrorStatusText(ma.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(ma.Status()));
|
||||
|
||||
Handle(Geom2d_TrimmedCurve) tmpcurve = ma.Value();
|
||||
Handle(Geom2d_Hyperbola) tmphyperbola = Handle(Geom2d_Hyperbola)::DownCast(tmpcurve->BasisCurve());
|
||||
@@ -1645,8 +1625,7 @@ void Geom2dArcOfHyperbola::Restore(Base::XMLReader &reader)
|
||||
this->myCurve->SetTrim(tmpcurve->FirstParameter(), tmpcurve->LastParameter());
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1699,8 +1678,7 @@ void Geom2dParabola::setFocal(double length)
|
||||
p->SetFocal(length);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1743,13 +1721,12 @@ void Geom2dParabola::Restore(Base::XMLReader& reader)
|
||||
try {
|
||||
GCE2d_MakeParabola mc(axis, Focal);
|
||||
if (!mc.IsDone())
|
||||
throw Base::Exception(gce_ErrorStatusText(mc.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(mc.Status()));
|
||||
|
||||
this->myCurve = mc.Value();
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1811,8 +1788,7 @@ void Geom2dArcOfParabola::setFocal(double length)
|
||||
p->SetFocal(length);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1858,11 +1834,11 @@ void Geom2dArcOfParabola::Restore(Base::XMLReader &reader)
|
||||
try {
|
||||
GCE2d_MakeParabola mc(axis, Focal);
|
||||
if (!mc.IsDone())
|
||||
throw Base::Exception(gce_ErrorStatusText(mc.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(mc.Status()));
|
||||
|
||||
GCE2d_MakeArcOfParabola ma(mc.Value()->Parab2d(), u, v);
|
||||
if (!ma.IsDone())
|
||||
throw Base::Exception(gce_ErrorStatusText(ma.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(ma.Status()));
|
||||
|
||||
Handle(Geom2d_TrimmedCurve) tmpcurve = ma.Value();
|
||||
Handle(Geom2d_Parabola) tmpparabola = Handle(Geom2d_Parabola)::DownCast(tmpcurve->BasisCurve());
|
||||
@@ -1872,8 +1848,7 @@ void Geom2dArcOfParabola::Restore(Base::XMLReader &reader)
|
||||
this->myCurve->SetTrim(tmpcurve->FirstParameter(), tmpcurve->LastParameter());
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1977,13 +1952,12 @@ void Geom2dLine::Restore(Base::XMLReader &reader)
|
||||
try {
|
||||
GCE2d_MakeLine mc(pnt, dir);
|
||||
if (!mc.IsDone())
|
||||
throw Base::Exception(gce_ErrorStatusText(mc.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(mc.Status()));
|
||||
|
||||
this->myCurve = mc.Value();
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2054,7 +2028,7 @@ void Geom2dLineSegment::setPoints(const Base::Vector2d& Start, const Base::Vecto
|
||||
Standard_Failure::Raise("Both points are equal");
|
||||
GCE2d_MakeSegment ms(p1, p2);
|
||||
if (!ms.IsDone()) {
|
||||
throw Base::Exception(gce_ErrorStatusText(ms.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(ms.Status()));
|
||||
}
|
||||
|
||||
// get Geom_Line of line segment
|
||||
@@ -2066,8 +2040,7 @@ void Geom2dLineSegment::setPoints(const Base::Vector2d& Start, const Base::Vecto
|
||||
this_curv->SetTrim(that_curv->FirstParameter(), that_curv->LastParameter());
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2114,13 +2087,12 @@ void Geom2dLineSegment::Restore(Base::XMLReader &reader)
|
||||
try {
|
||||
GCE2d_MakeSegment mc(p1, p2);
|
||||
if (!mc.IsDone())
|
||||
throw Base::Exception(gce_ErrorStatusText(mc.Status()));
|
||||
throw Base::CADKernelError(gce_ErrorStatusText(mc.Status()));
|
||||
|
||||
this->myCurve = mc.Value();
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Base::Exception(e.GetMessageString());
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user