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

@@ -81,9 +81,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setFrenetMode(PyObject *args)
this->getBRepOffsetAPI_MakePipeShellPtr()->SetMode(PyObject_IsTrue(obj) ? Standard_True : Standard_False);
Py_Return;
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -101,9 +100,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setTrihedronMode(PyObject *args)
this->getBRepOffsetAPI_MakePipeShellPtr()->SetMode(gp_Ax2(p,d));
Py_Return;
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -119,9 +117,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setBiNormalMode(PyObject *args)
this->getBRepOffsetAPI_MakePipeShellPtr()->SetMode(d);
Py_Return;
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -137,9 +134,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setSpineSupport(PyObject *args)
Standard_Boolean ok = this->getBRepOffsetAPI_MakePipeShellPtr()->SetMode(s);
return Py::new_reference_to(Py::Boolean(ok ? true : false));
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -178,9 +174,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setAuxiliarySpine(PyObject *args)
typeOfCantact);
Py_Return;
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
#else
@@ -203,9 +198,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setAuxiliarySpine(PyObject *args)
PyObject_IsTrue(keep) ? Standard_True : Standard_False);
Py_Return;
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
#endif
@@ -226,9 +220,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::add(PyObject *args, PyObject *kwds)
PyObject_IsTrue(keep) ? Standard_True : Standard_False);
Py_Return;
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -249,9 +242,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::add(PyObject *args, PyObject *kwds)
PyObject_IsTrue(keep) ? Standard_True : Standard_False);
Py_Return;
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -274,9 +266,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::remove(PyObject *args)
this->getBRepOffsetAPI_MakePipeShellPtr()->Delete(s);
Py_Return;
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -290,9 +281,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::isReady(PyObject *args)
Standard_Boolean ok = this->getBRepOffsetAPI_MakePipeShellPtr()->IsReady();
return Py::new_reference_to(Py::Boolean(ok ? true : false));
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -306,9 +296,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::getStatus(PyObject *args)
Standard_Integer val = this->getBRepOffsetAPI_MakePipeShellPtr()->GetStatus();
return Py::new_reference_to(Py::Long(val));
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -322,9 +311,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::makeSolid(PyObject *args)
Standard_Boolean ok = this->getBRepOffsetAPI_MakePipeShellPtr()->MakeSolid();
return Py::new_reference_to(Py::Boolean(ok ? true : false));
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -338,9 +326,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::build(PyObject *args)
this->getBRepOffsetAPI_MakePipeShellPtr()->Build();
Py_Return;
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -354,9 +341,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::shape(PyObject *args)
const TopoDS_Shape& shape = this->getBRepOffsetAPI_MakePipeShellPtr()->Shape();
return new TopoShapePy(new TopoShape(shape));
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -370,9 +356,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::firstShape(PyObject *args)
TopoDS_Shape shape = this->getBRepOffsetAPI_MakePipeShellPtr()->FirstShape();
return new TopoShapePy(new TopoShape(shape));
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -386,9 +371,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::lastShape(PyObject *args)
TopoDS_Shape shape = this->getBRepOffsetAPI_MakePipeShellPtr()->LastShape();
return new TopoShapePy(new TopoShape(shape));
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -411,9 +395,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::generated(PyObject *args)
}
return Py::new_reference_to(shapes);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -428,9 +411,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setTolerance(PyObject *args)
this->getBRepOffsetAPI_MakePipeShellPtr()->SetTolerance(tol3d, boundTol, tolAngular);
Py_Return;
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -445,9 +427,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setTransitionMode(PyObject *args)
this->getBRepOffsetAPI_MakePipeShellPtr()->SetTransitionMode(BRepBuilderAPI_TransitionMode(mode));
Py_Return;
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -468,9 +449,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setMaxDegree(PyObject *args)
return 0;
#endif
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -491,9 +471,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setMaxSegments(PyObject *args)
return 0;
#endif
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}
@@ -513,9 +492,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setForceApproxC1(PyObject *args)
return 0;
#endif
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
}
}