prepare for PyCXX 7.0
This commit is contained in:
@@ -51,6 +51,11 @@
|
||||
|
||||
#include <typeinfo>
|
||||
#include "Exception.h"
|
||||
#if PY_MAJOR_VERSION > 2
|
||||
# ifndef PYCXX_PYTHON_2TO3
|
||||
# define PYCXX_PYTHON_2TO3
|
||||
# endif
|
||||
#endif
|
||||
#include <CXX/Objects.hxx>
|
||||
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ Py::Object ProgressIndicatorPy::next(const Py::Tuple& args)
|
||||
}
|
||||
catch (const Base::AbortException&) {
|
||||
_seq.reset();
|
||||
throw Py::Exception("abort progress indicator");
|
||||
throw Py::RuntimeError("abort progress indicator");
|
||||
}
|
||||
}
|
||||
return Py::None();
|
||||
|
||||
@@ -613,7 +613,7 @@ void VectorPy::setLength(Py::Float arg)
|
||||
VectorPy::PointerType ptr = reinterpret_cast<VectorPy::PointerType>(_pcTwinPointer);
|
||||
double len = ptr->Length();
|
||||
if (len < 1.0e-6) {
|
||||
throw Py::Exception(std::string("Cannot set length of null vector"));
|
||||
throw Py::RuntimeError(std::string("Cannot set length of null vector"));
|
||||
}
|
||||
|
||||
double val = (double)arg/len;
|
||||
|
||||
@@ -450,7 +450,7 @@ AbstractSplitViewPy::~AbstractSplitViewPy()
|
||||
void AbstractSplitViewPy::testExistence()
|
||||
{
|
||||
if (!(_view && _view->getViewer(0)))
|
||||
throw Py::Exception("Object already deleted");
|
||||
throw Py::RuntimeError("Object already deleted");
|
||||
}
|
||||
|
||||
Py::Object AbstractSplitViewPy::repr()
|
||||
@@ -473,13 +473,13 @@ Py::Object AbstractSplitViewPy::fitAll(const Py::Tuple& args)
|
||||
_view->onMsg("ViewFit", 0);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
return Py::None();
|
||||
}
|
||||
@@ -494,13 +494,13 @@ Py::Object AbstractSplitViewPy::viewBottom(const Py::Tuple& args)
|
||||
_view->onMsg("ViewBottom", 0);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -516,13 +516,13 @@ Py::Object AbstractSplitViewPy::viewFront(const Py::Tuple& args)
|
||||
_view->onMsg("ViewFront", 0);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -538,13 +538,13 @@ Py::Object AbstractSplitViewPy::viewLeft(const Py::Tuple& args)
|
||||
_view->onMsg("ViewLeft", 0);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -560,13 +560,13 @@ Py::Object AbstractSplitViewPy::viewRear(const Py::Tuple& args)
|
||||
_view->onMsg("ViewRear", 0);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -582,13 +582,13 @@ Py::Object AbstractSplitViewPy::viewRight(const Py::Tuple& args)
|
||||
_view->onMsg("ViewRight", 0);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -604,13 +604,13 @@ Py::Object AbstractSplitViewPy::viewTop(const Py::Tuple& args)
|
||||
_view->onMsg("ViewTop", 0);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -626,13 +626,13 @@ Py::Object AbstractSplitViewPy::viewAxometric(const Py::Tuple& args)
|
||||
_view->onMsg("ViewAxo", 0);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -652,13 +652,13 @@ Py::Object AbstractSplitViewPy::getViewer(const Py::Tuple& args)
|
||||
return Py::Object(view->getPyObject());
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ Py::Object ControlPy::showDialog(const Py::Tuple& args)
|
||||
{
|
||||
Gui::TaskView::TaskDialog* act = Gui::Control().activeDialog();
|
||||
if (act)
|
||||
throw Py::Exception("Active task dialog found");
|
||||
throw Py::RuntimeError("Active task dialog found");
|
||||
TaskDialogPython* dlg = new TaskDialogPython(args[0]);
|
||||
Gui::Control().showDialog(dlg);
|
||||
return Py::None();
|
||||
|
||||
@@ -211,13 +211,13 @@ PyObject *View3DInventorPy::method_varargs_ext_handler(PyObject *_self_and_name_
|
||||
return pycxx_handler(_self_and_name_tuple, _args);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,13 +275,13 @@ Py::Object View3DInventorPy::message(const Py::Tuple& args)
|
||||
_view->onMsg(psMsgStr,ppReturn);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
return Py::None();
|
||||
}
|
||||
@@ -296,13 +296,13 @@ Py::Object View3DInventorPy::fitAll(const Py::Tuple& args)
|
||||
_view->getViewer()->viewAll((float)factor);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
return Py::None();
|
||||
}
|
||||
@@ -329,13 +329,13 @@ Py::Object View3DInventorPy::viewBottom(const Py::Tuple& args)
|
||||
_view->getViewer()->setCameraOrientation(SbRotation(0, -1, 0, 0));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -351,13 +351,13 @@ Py::Object View3DInventorPy::viewFront(const Py::Tuple& args)
|
||||
_view->getViewer()->setCameraOrientation(SbRotation(-root, 0, 0, -root));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -372,13 +372,13 @@ Py::Object View3DInventorPy::viewLeft(const Py::Tuple& args)
|
||||
_view->getViewer()->setCameraOrientation(SbRotation(-0.5, 0.5, 0.5, -0.5));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -394,13 +394,13 @@ Py::Object View3DInventorPy::viewRear(const Py::Tuple& args)
|
||||
_view->getViewer()->setCameraOrientation(SbRotation(0, root, root, 0));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -415,13 +415,13 @@ Py::Object View3DInventorPy::viewRight(const Py::Tuple& args)
|
||||
_view->getViewer()->setCameraOrientation(SbRotation(0.5, 0.5, 0.5, 0.5));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -436,13 +436,13 @@ Py::Object View3DInventorPy::viewTop(const Py::Tuple& args)
|
||||
_view->getViewer()->setCameraOrientation(SbRotation(0, 0, 0, 1));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -471,13 +471,13 @@ Py::Object View3DInventorPy::viewAxonometric(const Py::Tuple& args)
|
||||
(0.424708f, 0.17592f, 0.339851f, 0.820473f));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -497,13 +497,13 @@ Py::Object View3DInventorPy::viewRotateLeft(const Py::Tuple& args)
|
||||
cam->orientation.setValue(rot*nrot);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -523,13 +523,13 @@ Py::Object View3DInventorPy::viewRotateRight(const Py::Tuple& args)
|
||||
cam->orientation.setValue(rot*nrot);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -544,13 +544,13 @@ Py::Object View3DInventorPy::zoomIn(const Py::Tuple& args)
|
||||
_view->getViewer()->navigationStyle()->zoomIn();
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -565,13 +565,13 @@ Py::Object View3DInventorPy::zoomOut(const Py::Tuple& args)
|
||||
_view->getViewer()->navigationStyle()->zoomOut();
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -607,13 +607,13 @@ Py::Object View3DInventorPy::setCameraOrientation(const Py::Tuple& args)
|
||||
throw; // re-throw
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -750,14 +750,14 @@ Py::Object View3DInventorPy::saveVectorGraphic(const Py::Tuple& args)
|
||||
vo = std::unique_ptr<SoVectorizeAction>(new SoFCVectorizeU3DAction());
|
||||
}
|
||||
else {
|
||||
throw Py::Exception("Not supported vector graphic");
|
||||
throw Py::RuntimeError("Not supported vector graphic");
|
||||
}
|
||||
|
||||
SoVectorOutput * out = vo->getOutput();
|
||||
if (!out || !out->openFile(filename)) {
|
||||
std::ostringstream a_out;
|
||||
a_out << "Cannot open file '" << filename << "'";
|
||||
throw Py::Exception(a_out.str());
|
||||
throw Py::RuntimeError(a_out.str());
|
||||
}
|
||||
|
||||
QColor bg;
|
||||
@@ -789,7 +789,7 @@ Py::Object View3DInventorPy::getCameraNode(const Py::Tuple& args)
|
||||
return Py::Object(proxy, true);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -810,13 +810,13 @@ Py::Object View3DInventorPy::getCamera(const Py::Tuple& args)
|
||||
return Py::String(buffer);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -829,13 +829,13 @@ Py::Object View3DInventorPy::getViewDirection(const Py::Tuple& args)
|
||||
return Py::Vector(Base::Vector3f(dvec[0], dvec[1], dvec[2]));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -863,13 +863,13 @@ Py::Object View3DInventorPy::setViewDirection(const Py::Tuple& args)
|
||||
throw; // re-throw
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -888,13 +888,13 @@ Py::Object View3DInventorPy::setCamera(const Py::Tuple& args)
|
||||
return Py::None();
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -908,7 +908,7 @@ Py::Object View3DInventorPy::getCameraType(const Py::Tuple& args)
|
||||
|
||||
SoCamera* cam = _view->getViewer()->getSoRenderManager()->getCamera();
|
||||
if (!cam) {
|
||||
throw Py::Exception("No camera set!");
|
||||
throw Py::RuntimeError("No camera set!");
|
||||
}
|
||||
else if (cam->getTypeId() == SoOrthographicCamera::getClassTypeId()) {
|
||||
return Py::String(CameraTypeEnums[0]);
|
||||
@@ -917,7 +917,7 @@ Py::Object View3DInventorPy::getCameraType(const Py::Tuple& args)
|
||||
return Py::String(CameraTypeEnums[1]);
|
||||
}
|
||||
else {
|
||||
throw Py::Exception("Unknown camera type");
|
||||
throw Py::TypeError("Unknown camera type");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -945,7 +945,7 @@ Py::Object View3DInventorPy::setCameraType(const Py::Tuple& args)
|
||||
}
|
||||
|
||||
if (cameratype < 0 || cameratype > 1)
|
||||
throw Py::Exception("Out of range");
|
||||
throw Py::IndexError("Out of range");
|
||||
if (cameratype==0)
|
||||
_view->getViewer()->setCameraType(SoOrthographicCamera::getClassTypeId());
|
||||
else
|
||||
@@ -966,13 +966,13 @@ Py::Object View3DInventorPy::listCameraTypes(const Py::Tuple& args)
|
||||
return list;
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -987,13 +987,13 @@ Py::Object View3DInventorPy::dump(const Py::Tuple& args)
|
||||
return Py::None();
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1008,7 +1008,7 @@ Py::Object View3DInventorPy::dumpNode(const Py::Tuple& args)
|
||||
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoNode *", object, &ptr, 0);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
SoNode* node = reinterpret_cast<SoNode*>(ptr);
|
||||
return Py::String(SoFCDB::writeNodesToString(node));
|
||||
@@ -1042,19 +1042,19 @@ Py::Object View3DInventorPy::setStereoType(const Py::Tuple& args)
|
||||
|
||||
try {
|
||||
if (stereomode < 0 || stereomode > 4)
|
||||
throw Py::Exception("Out of range");
|
||||
throw Py::IndexError("Out of range");
|
||||
Quarter::SoQTQuarterAdaptor::StereoMode mode = Quarter::SoQTQuarterAdaptor::StereoMode(stereomode);
|
||||
_view->getViewer()->setStereoMode(mode);
|
||||
return Py::None();
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1068,13 +1068,13 @@ Py::Object View3DInventorPy::getStereoType(const Py::Tuple& args)
|
||||
return Py::String(StereoTypeEnums[mode]);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1092,13 +1092,13 @@ Py::Object View3DInventorPy::listStereoTypes(const Py::Tuple& args)
|
||||
return list;
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1324,7 +1324,7 @@ Py::Object View3DInventorPy::getPoint(const Py::Tuple& args)
|
||||
return Py::Vector(Base::Vector3f(pt[0], pt[1], pt[2]));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const Py::Exception&) {
|
||||
throw;
|
||||
@@ -1344,7 +1344,7 @@ Py::Object View3DInventorPy::getPointOnScreen(const Py::Tuple& args)
|
||||
else {
|
||||
PyErr_Clear();
|
||||
if (!PyArg_ParseTuple(args.ptr(), "ddd", &vx,&vy,&vz)) {
|
||||
throw Py::Exception("Wrong argument, Vector or three floats expected expected");
|
||||
throw Py::TypeError("Wrong argument, Vector or three floats expected expected");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1374,7 +1374,7 @@ Py::Object View3DInventorPy::getPointOnScreen(const Py::Tuple& args)
|
||||
return tuple;
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const Py::Exception&) {
|
||||
throw;
|
||||
@@ -1771,14 +1771,14 @@ Py::Object View3DInventorPy::addEventCallback(const Py::Tuple& args)
|
||||
throw Py::Exception();
|
||||
try {
|
||||
if (PyCallable_Check(method) == 0) {
|
||||
throw Py::Exception("object is not callable");
|
||||
throw Py::TypeError("object is not callable");
|
||||
}
|
||||
SoType eventId = SoType::fromName(eventtype);
|
||||
if (eventId.isBad() || !eventId.isDerivedFrom(SoEvent::getClassTypeId())) {
|
||||
std::string s;
|
||||
std::ostringstream s_out;
|
||||
s_out << eventtype << " is not a valid event type";
|
||||
throw Py::Exception(s_out.str());
|
||||
throw Py::TypeError(s_out.str());
|
||||
}
|
||||
|
||||
_view->getViewer()->addEventCallback(eventId, View3DInventorPy::eventCallback, method);
|
||||
@@ -1799,14 +1799,14 @@ Py::Object View3DInventorPy::removeEventCallback(const Py::Tuple& args)
|
||||
throw Py::Exception();
|
||||
try {
|
||||
if (PyCallable_Check(method) == 0) {
|
||||
throw Py::Exception("object is not callable");
|
||||
throw Py::RuntimeError("object is not callable");
|
||||
}
|
||||
SoType eventId = SoType::fromName(eventtype);
|
||||
if (eventId.isBad() || !eventId.isDerivedFrom(SoEvent::getClassTypeId())) {
|
||||
std::string s;
|
||||
std::ostringstream s_out;
|
||||
s_out << eventtype << " is not a valid event type";
|
||||
throw Py::Exception(s_out.str());
|
||||
throw Py::TypeError(s_out.str());
|
||||
}
|
||||
|
||||
_view->getViewer()->removeEventCallback(eventId, View3DInventorPy::eventCallback, method);
|
||||
@@ -1831,7 +1831,7 @@ Py::Object View3DInventorPy::setAnnotation(const Py::Tuple& args)
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
delete view;
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
|
||||
_view->getGuiDocument()->setAnnotationViewProvider(psAnnoName, view);
|
||||
@@ -1870,7 +1870,7 @@ Py::Object View3DInventorPy::getSceneGraph(const Py::Tuple& args)
|
||||
return Py::Object(proxy, true);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1964,7 +1964,7 @@ Py::Object View3DInventorPy::addEventCallbackPivy(const Py::Tuple& args)
|
||||
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoType *", proxy, &ptr, 0);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
|
||||
SoType* eventId = reinterpret_cast<SoType*>(ptr);
|
||||
@@ -1972,12 +1972,12 @@ Py::Object View3DInventorPy::addEventCallbackPivy(const Py::Tuple& args)
|
||||
std::string s;
|
||||
std::ostringstream s_out;
|
||||
s_out << eventId->getName().getString() << "is not a valid event type";
|
||||
throw Py::Exception(s_out.str());
|
||||
throw Py::TypeError(s_out.str());
|
||||
}
|
||||
|
||||
try {
|
||||
if (PyCallable_Check(method) == 0) {
|
||||
throw Py::Exception("object is not callable");
|
||||
throw Py::TypeError("object is not callable");
|
||||
}
|
||||
|
||||
SoEventCallbackCB* callback = (ex == 1 ?
|
||||
@@ -2006,7 +2006,7 @@ Py::Object View3DInventorPy::removeEventCallbackPivy(const Py::Tuple& args)
|
||||
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoType *", proxy, &ptr, 0);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
|
||||
SoType* eventId = reinterpret_cast<SoType*>(ptr);
|
||||
@@ -2014,12 +2014,12 @@ Py::Object View3DInventorPy::removeEventCallbackPivy(const Py::Tuple& args)
|
||||
std::string s;
|
||||
std::ostringstream s_out;
|
||||
s_out << eventId->getName().getString() << "is not a valid event type";
|
||||
throw Py::Exception(s_out.str());
|
||||
throw Py::TypeError(s_out.str());
|
||||
}
|
||||
|
||||
try {
|
||||
if (PyCallable_Check(method) == 0) {
|
||||
throw Py::Exception("object is not callable");
|
||||
throw Py::TypeError("object is not callable");
|
||||
}
|
||||
|
||||
SoEventCallbackCB* callback = (ex == 1 ?
|
||||
@@ -2066,7 +2066,7 @@ void View3DInventorPy::draggerCallback(void * ud, SoDragger* n)
|
||||
method.apply(args);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const Py::Exception& e) {
|
||||
Py::Object o = Py::type(e);
|
||||
@@ -2098,13 +2098,13 @@ Py::Object View3DInventorPy::addDraggerCallback(const Py::Tuple& args)
|
||||
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoDragger *", dragger, &ptr, 0);
|
||||
}
|
||||
catch (const Base::Exception&) {
|
||||
throw Py::Exception("The first argument must be of type SoDragger");
|
||||
throw Py::TypeError("The first argument must be of type SoDragger");
|
||||
}
|
||||
SoDragger* drag = reinterpret_cast<SoDragger*>(ptr);
|
||||
|
||||
//Check if method is callable
|
||||
if (PyCallable_Check(method) == 0) {
|
||||
throw Py::Exception("the method is not callable");
|
||||
throw Py::TypeError("the method is not callable");
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -2124,7 +2124,7 @@ Py::Object View3DInventorPy::addDraggerCallback(const Py::Tuple& args)
|
||||
std::string s;
|
||||
std::ostringstream s_out;
|
||||
s_out << type << " is not a valid dragger callback type";
|
||||
throw Py::Exception(s_out.str());
|
||||
throw Py::TypeError(s_out.str());
|
||||
}
|
||||
|
||||
callbacks.push_back(method);
|
||||
@@ -2150,7 +2150,7 @@ Py::Object View3DInventorPy::removeDraggerCallback(const Py::Tuple& args)
|
||||
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoDragger *", dragger, &ptr, 0);
|
||||
}
|
||||
catch (const Base::Exception&) {
|
||||
throw Py::Exception("The first argument must be of type SoDragger");
|
||||
throw Py::TypeError("The first argument must be of type SoDragger");
|
||||
}
|
||||
|
||||
SoDragger* drag = reinterpret_cast<SoDragger*>(ptr);
|
||||
@@ -2171,7 +2171,7 @@ Py::Object View3DInventorPy::removeDraggerCallback(const Py::Tuple& args)
|
||||
std::string s;
|
||||
std::ostringstream s_out;
|
||||
s_out << type << " is not a valid dragger callback type";
|
||||
throw Py::Exception(s_out.str());
|
||||
throw Py::TypeError(s_out.str());
|
||||
}
|
||||
|
||||
callbacks.remove(method);
|
||||
|
||||
@@ -107,13 +107,13 @@ PyObject *View3DInventorViewerPy::method_varargs_ext_handler(PyObject *_self_and
|
||||
return pycxx_handler(_self_and_name_tuple, _args);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ Py::Object View3DInventorViewerPy::getSoRenderManager(const Py::Tuple& args)
|
||||
return Py::Object(proxy, true);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ Py::Object View3DInventorViewerPy::getSceneGraph(const Py::Tuple& args)
|
||||
return Py::Object(proxy, true);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ Py::Object View3DInventorViewerPy::setSceneGraph(const Py::Tuple& args)
|
||||
return Py::None();
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ Py::Object View3DInventorViewerPy::getSoEventManager(const Py::Tuple& args)
|
||||
return Py::Object(proxy, true);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,13 +265,13 @@ Py::Object View3DInventorViewerPy::setFocalDistance(const Py::Tuple& args)
|
||||
throw; // re-throw
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
@@ -287,13 +287,13 @@ Py::Object View3DInventorViewerPy::getFocalDistance(const Py::Tuple& args)
|
||||
return Py::Float(d);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ Py::Object View3DInventorViewerPy::getPoint(const Py::Tuple& args)
|
||||
return Py::Vector(Base::Vector3f(pt[0], pt[1], pt[2]));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const Py::Exception&) {
|
||||
throw;
|
||||
@@ -342,12 +342,12 @@ Py::Object View3DInventorViewerPy::setPickRadius(const Py::Tuple& args)
|
||||
return Py::None();
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ Py::Object ViewProviderPy::getAnnotation(void) const
|
||||
return Py::Object(Ptr, true);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ Py::Object ViewProviderPy::getRootNode(void) const
|
||||
return Py::Object(Ptr, true);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -870,7 +870,7 @@ Py::Object UiLoaderPy::load(const Py::Tuple& args)
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw Py::Exception("string or QIODevice expected");
|
||||
throw Py::TypeError("string or QIODevice expected");
|
||||
}
|
||||
}
|
||||
return Py::None();
|
||||
|
||||
@@ -1277,7 +1277,7 @@ private:
|
||||
PyObject *pleft=Py_False;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "ddd|dO!", &pitch, &height, &radius, &angle,
|
||||
&(PyBool_Type), &pleft)) {
|
||||
throw Py::Exception("Part.makeLongHelix fails on parms");
|
||||
throw Py::RuntimeError("Part.makeLongHelix fails on parms");
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -148,7 +148,7 @@ void ArcOfConicPy::setAxis(Py::Object arg)
|
||||
conic->SetAxis(axis);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
throw Py::Exception("cannot set axis");
|
||||
throw Py::RuntimeError("cannot set axis");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ void ArcOfConicPy::setXAxis(Py::Object arg)
|
||||
conic->SetPosition(pos);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
throw Py::Exception("cannot set X axis");
|
||||
throw Py::RuntimeError("cannot set X axis");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ void ArcOfConicPy::setYAxis(Py::Object arg)
|
||||
conic->SetPosition(pos);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
throw Py::Exception("cannot set Y axis");
|
||||
throw Py::RuntimeError("cannot set Y axis");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ void ConePy::setAxis(Py::Object arg)
|
||||
this_surf->SetAxis(axis);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
throw Py::Exception("cannot set axis");
|
||||
throw Py::RuntimeError("cannot set axis");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ void ConicPy::setAxis(Py::Object arg)
|
||||
conic->SetAxis(axis);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
throw Py::Exception("cannot set axis");
|
||||
throw Py::RuntimeError("cannot set axis");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ void ConicPy::setXAxis(Py::Object arg)
|
||||
conic->SetPosition(pos);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
throw Py::Exception("cannot set X axis");
|
||||
throw Py::RuntimeError("cannot set X axis");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ void ConicPy::setYAxis(Py::Object arg)
|
||||
conic->SetPosition(pos);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
throw Py::Exception("cannot set Y axis");
|
||||
throw Py::RuntimeError("cannot set Y axis");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ void CylinderPy::setAxis(Py::Object arg)
|
||||
this_surf->SetAxis(axis);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
throw Py::Exception("cannot set axis");
|
||||
throw Py::RuntimeError("cannot set axis");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ void Line2dPy::setLocation(Py::Object arg)
|
||||
try {
|
||||
GCE2d_MakeLine ms(pnt, dir);
|
||||
if (!ms.IsDone()) {
|
||||
throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
||||
throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
||||
}
|
||||
|
||||
// get Geom_Line of line
|
||||
@@ -171,8 +171,7 @@ void Line2dPy::setLocation(Py::Object arg)
|
||||
this_line->SetLin2d(that_line->Lin2d());
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +217,7 @@ void Line2dPy::setDirection(Py::Object arg)
|
||||
try {
|
||||
GCE2d_MakeLine ms(pnt, dir);
|
||||
if (!ms.IsDone()) {
|
||||
throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
||||
throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
||||
}
|
||||
|
||||
// get Geom_Line of line
|
||||
@@ -226,8 +225,7 @@ void Line2dPy::setDirection(Py::Object arg)
|
||||
this_line->SetLin2d(that_line->Lin2d());
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ void Line2dSegmentPy::setStartPoint(Py::Object arg)
|
||||
Standard_Failure::Raise("Both points are equal");
|
||||
GCE2d_MakeSegment ms(p1, p2);
|
||||
if (!ms.IsDone()) {
|
||||
throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
||||
throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
||||
}
|
||||
|
||||
// get Geom_Line of line segment
|
||||
@@ -252,8 +252,7 @@ void Line2dSegmentPy::setStartPoint(Py::Object arg)
|
||||
this_curv->SetTrim(that_curv->FirstParameter(), that_curv->LastParameter());
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,7 +300,7 @@ void Line2dSegmentPy::setEndPoint(Py::Object arg)
|
||||
Standard_Failure::Raise("Both points are equal");
|
||||
GCE2d_MakeSegment ms(p1, p2);
|
||||
if (!ms.IsDone()) {
|
||||
throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
||||
throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
||||
}
|
||||
|
||||
// get Geom_Line of line segment
|
||||
@@ -313,8 +312,7 @@ void Line2dSegmentPy::setEndPoint(Py::Object arg)
|
||||
this_curv->SetTrim(that_curv->FirstParameter(), that_curv->LastParameter());
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,8 +122,7 @@ void OffsetCurve2dPy::setBasisCurve(Py::Object arg)
|
||||
curve2->SetBasisCurve(curve);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ void LinePy::setLocation(Py::Object arg)
|
||||
try {
|
||||
GC_MakeLine ms(pnt, dir);
|
||||
if (!ms.IsDone()) {
|
||||
throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
||||
throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
||||
}
|
||||
|
||||
// get Geom_Line of line
|
||||
@@ -169,8 +169,7 @@ void LinePy::setLocation(Py::Object arg)
|
||||
this_curv->SetLin(that_curv->Lin());
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,7 +210,7 @@ void LinePy::setDirection(Py::Object arg)
|
||||
try {
|
||||
GC_MakeLine ms(pnt, dir);
|
||||
if (!ms.IsDone()) {
|
||||
throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
||||
throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
||||
}
|
||||
|
||||
// get Geom_Line of line
|
||||
@@ -219,8 +218,7 @@ void LinePy::setDirection(Py::Object arg)
|
||||
this_curv->SetLin(that_curv->Lin());
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +196,6 @@ PyObject* LineSegmentPy::setParameterRange(PyObject *args)
|
||||
this_curve->SetTrim(first, last);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return NULL;
|
||||
}
|
||||
@@ -244,7 +243,7 @@ void LineSegmentPy::setStartPoint(Py::Object arg)
|
||||
Standard_Failure::Raise("Both points are equal");
|
||||
GC_MakeSegment ms(p1, p2);
|
||||
if (!ms.IsDone()) {
|
||||
throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
||||
throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
||||
}
|
||||
|
||||
// get Geom_Line of line segment
|
||||
@@ -256,8 +255,7 @@ void LineSegmentPy::setStartPoint(Py::Object arg)
|
||||
this_curv->SetTrim(that_curv->FirstParameter(), that_curv->LastParameter());
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,7 +299,7 @@ void LineSegmentPy::setEndPoint(Py::Object arg)
|
||||
Standard_Failure::Raise("Both points are equal");
|
||||
GC_MakeSegment ms(p1, p2);
|
||||
if (!ms.IsDone()) {
|
||||
throw Py::Exception(gce_ErrorStatusText(ms.Status()));
|
||||
throw Py::RuntimeError(gce_ErrorStatusText(ms.Status()));
|
||||
}
|
||||
|
||||
// get Geom_Line of line segment
|
||||
@@ -313,8 +311,7 @@ void LineSegmentPy::setEndPoint(Py::Object arg)
|
||||
this_curv->SetTrim(that_curv->FirstParameter(), that_curv->LastParameter());
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -145,8 +145,7 @@ void OffsetCurvePy::setBasisCurve(Py::Object arg)
|
||||
curve2->SetBasisCurve(curve);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,8 +120,7 @@ void OffsetSurfacePy::setBasisSurface(Py::Object arg)
|
||||
surf2->SetBasisSurface(surf);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,8 +208,7 @@ void PlanePy::setPosition(Py::Object arg)
|
||||
this_surf->SetLocation(loc);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +251,7 @@ void PlanePy::setAxis(Py::Object arg)
|
||||
this_surf->SetAxis(axis);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
throw Py::Exception("cannot set axis");
|
||||
throw Py::RuntimeError("cannot set axis");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,8 +144,7 @@ void PointPy::setX(Py::Float X)
|
||||
this_point->SetX(double(X));
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,8 +164,7 @@ void PointPy::setY(Py::Float Y)
|
||||
this_point->SetY(double(Y));
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,8 +184,7 @@ void PointPy::setZ(Py::Float Z)
|
||||
this_point->SetZ(double(Z));
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ void SpherePy::setAxis(Py::Object arg)
|
||||
this_surf->SetAxis(axis);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
throw Py::Exception("cannot set axis");
|
||||
throw Py::RuntimeError("cannot set axis");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -139,8 +139,7 @@ void SurfaceOfExtrusionPy::setBasisCurve(Py::Object arg)
|
||||
curve2->SetBasisCurve(curve);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,8 +166,7 @@ void SurfaceOfRevolutionPy::setBasisCurve(Py::Object arg)
|
||||
curve2->SetBasisCurve(curve);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
throw Py::Exception(e.GetMessageString());
|
||||
throw Py::RuntimeError(e.GetMessageString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1000,7 +1000,7 @@ Py::Dict TopoShapeEdgePy::getPrincipalProperties(void) const
|
||||
Py::Boolean TopoShapeEdgePy::getClosed(void) const
|
||||
{
|
||||
if (getTopoShapePtr()->getShape().IsNull())
|
||||
throw Py::Exception("Cannot determine the 'Closed'' flag of an empty shape");
|
||||
throw Py::RuntimeError("Cannot determine the 'Closed'' flag of an empty shape");
|
||||
Standard_Boolean ok = BRep_Tool::IsClosed(getTopoShapePtr()->getShape());
|
||||
return Py::Boolean(ok ? true : false);
|
||||
}
|
||||
|
||||
@@ -873,14 +873,14 @@ Py::Object TopoShapeFacePy::getOuterWire(void) const
|
||||
{
|
||||
const TopoDS_Shape& clSh = getTopoShapePtr()->getShape();
|
||||
if (clSh.IsNull())
|
||||
throw Py::Exception("Null shape");
|
||||
throw Py::RuntimeError("Null shape");
|
||||
if (clSh.ShapeType() == TopAbs_FACE) {
|
||||
TopoDS_Face clFace = (TopoDS_Face&)clSh;
|
||||
TopoDS_Wire clWire = ShapeAnalysis::OuterWire(clFace);
|
||||
return Py::Object(new TopoShapeWirePy(new TopoShape(clWire)),true);
|
||||
}
|
||||
else {
|
||||
throw Py::Exception("Internal error, TopoDS_Shape is not a face!");
|
||||
throw Py::TypeError("Internal error, TopoDS_Shape is not a face!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ void ToroidPy::setMajorRadius(Py::Float arg)
|
||||
torus->SetMajorRadius((double)arg);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
throw Py::Exception("Major radius must be positive and higher than minor radius");
|
||||
throw Py::RuntimeError("Major radius must be positive and higher than minor radius");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ void ToroidPy::setMinorRadius(Py::Float arg)
|
||||
torus->SetMinorRadius((double)arg);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
throw Py::Exception("Minor radius must be positive and lower than major radius");
|
||||
throw Py::RuntimeError("Minor radius must be positive and lower than major radius");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ void ToroidPy::setAxis(Py::Object arg)
|
||||
this_surf->SetAxis(axis);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
throw Py::Exception("cannot set axis");
|
||||
throw Py::RuntimeError("cannot set axis");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ void CommandPy::setParameters(Py::Dict arg)
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
throw Py::Exception("The dictionary can only contain string keys");
|
||||
throw Py::TypeError("The dictionary can only contain string keys");
|
||||
}
|
||||
|
||||
boost::to_upper(ckey);
|
||||
@@ -185,7 +185,7 @@ void CommandPy::setParameters(Py::Dict arg)
|
||||
cvalue = PyFloat_AsDouble(value);
|
||||
}
|
||||
else {
|
||||
throw Py::Exception("The dictionary can only contain number values");
|
||||
throw Py::TypeError("The dictionary can only contain number values");
|
||||
}
|
||||
getCommandPtr()->Parameters[ckey]=cvalue;
|
||||
}
|
||||
@@ -202,7 +202,7 @@ PyObject* CommandPy::toGCode(PyObject *args)
|
||||
return PyString_FromString(getCommandPtr()->toGCode().c_str());
|
||||
#endif
|
||||
}
|
||||
throw Py::Exception("This method accepts no argument");
|
||||
throw Py::TypeError("This method accepts no argument");
|
||||
}
|
||||
|
||||
PyObject* CommandPy::setFromGCode(PyObject *args)
|
||||
@@ -214,7 +214,7 @@ PyObject* CommandPy::setFromGCode(PyObject *args)
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
throw Py::Exception("Argument must be a string");
|
||||
throw Py::TypeError("Argument must be a string");
|
||||
}
|
||||
|
||||
// Placement attribute get/set
|
||||
@@ -231,7 +231,7 @@ void CommandPy::setPlacement(Py::Object arg)
|
||||
if(arg.isType(PlacementType)) {
|
||||
getCommandPtr()->setFromPlacement( *static_cast<Base::PlacementPy*>((*arg))->getPlacementPtr() );
|
||||
} else
|
||||
throw Py::Exception("Argument must be a placement");
|
||||
throw Py::TypeError("Argument must be a placement");
|
||||
}
|
||||
|
||||
PyObject* CommandPy::transform(PyObject *args)
|
||||
@@ -242,7 +242,7 @@ PyObject* CommandPy::transform(PyObject *args)
|
||||
Path::Command trCmd = getCommandPtr()->transform( *p->getPlacementPtr() );
|
||||
return new CommandPy(new Path::Command(trCmd));
|
||||
} else
|
||||
throw Py::Exception("Argument must be a placement");
|
||||
throw Py::TypeError("Argument must be a placement");
|
||||
}
|
||||
|
||||
// custom attributes get/set
|
||||
|
||||
@@ -100,7 +100,7 @@ void PathPy::setCommands(Py::List list)
|
||||
Path::Command &cmd = *static_cast<Path::CommandPy*>((*it).ptr())->getCommandPtr();
|
||||
getToolpathPtr()->addCommand(cmd);
|
||||
} else {
|
||||
throw Py::Exception("The list can only contain Path Commands");
|
||||
throw Py::TypeError("The list can only contain Path Commands");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,7 +124,7 @@ PyObject* PathPy::copy(PyObject * args)
|
||||
if (PyArg_ParseTuple(args, "")) {
|
||||
return new PathPy(new Path::Toolpath(*getToolpathPtr()));
|
||||
}
|
||||
throw Py::Exception("This method accepts no argument");
|
||||
throw Py::TypeError("This method accepts no argument");
|
||||
}
|
||||
|
||||
PyObject* PathPy::addCommands(PyObject * args)
|
||||
@@ -184,7 +184,7 @@ PyObject* PathPy::toGCode(PyObject * args)
|
||||
return PyString_FromString(result.c_str());
|
||||
#endif
|
||||
}
|
||||
throw Py::Exception("This method accepts no argument");
|
||||
throw Py::TypeError("This method accepts no argument");
|
||||
}
|
||||
|
||||
PyObject* PathPy::setFromGCode(PyObject * args)
|
||||
@@ -196,7 +196,7 @@ PyObject* PathPy::setFromGCode(PyObject * args)
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
throw Py::Exception("Argument must be a string");
|
||||
throw Py::TypeError("Argument must be a string");
|
||||
}
|
||||
|
||||
// custom attributes get/set
|
||||
|
||||
@@ -223,7 +223,7 @@ PyObject* ToolPy::copy(PyObject * args)
|
||||
if (PyArg_ParseTuple(args, "")) {
|
||||
return new ToolPy(new Path::Tool(*getToolPtr()));
|
||||
}
|
||||
throw Py::Exception("This method accepts no argument");
|
||||
throw Py::TypeError("This method accepts no argument");
|
||||
}
|
||||
|
||||
PyObject* ToolPy::setFromTemplate(PyObject * args)
|
||||
@@ -276,7 +276,7 @@ PyObject* ToolPy::templateAttrs(PyObject * args)
|
||||
PyDict_SetItemString(dict, "cuttingEdgeHeight", PyFloat_FromDouble(getToolPtr()->CuttingEdgeHeight));
|
||||
return dict;
|
||||
}
|
||||
throw Py::Exception("This method accepts no argument");
|
||||
throw Py::TypeError("This method accepts no argument");
|
||||
}
|
||||
|
||||
PyObject* ToolPy::getToolTypes(PyObject * args)
|
||||
@@ -290,7 +290,7 @@ PyObject* ToolPy::getToolTypes(PyObject * args)
|
||||
}
|
||||
return list;
|
||||
}
|
||||
throw Py::Exception("This method accepts no argument");
|
||||
throw Py::TypeError("This method accepts no argument");
|
||||
}
|
||||
|
||||
PyObject* ToolPy::getToolMaterials(PyObject * args)
|
||||
@@ -304,7 +304,7 @@ PyObject* ToolPy::getToolMaterials(PyObject * args)
|
||||
}
|
||||
return list;
|
||||
}
|
||||
throw Py::Exception("This method accepts no argument");
|
||||
throw Py::TypeError("This method accepts no argument");
|
||||
}
|
||||
|
||||
|
||||
@@ -405,7 +405,7 @@ void TooltablePy::setTools(Py::Dict arg)
|
||||
Py_DECREF(success);
|
||||
}
|
||||
} else {
|
||||
throw Py::Exception("The dictionary can only contain int:tool pairs");
|
||||
throw Py::TypeError("The dictionary can only contain int:tool pairs");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,7 +417,7 @@ PyObject* TooltablePy::copy(PyObject * args)
|
||||
if (PyArg_ParseTuple(args, "")) {
|
||||
return new TooltablePy(new Path::Tooltable(*getTooltablePtr()));
|
||||
}
|
||||
throw Py::Exception("This method accepts no argument");
|
||||
throw Py::TypeError("This method accepts no argument");
|
||||
}
|
||||
|
||||
PyObject* TooltablePy::addTools(PyObject * args)
|
||||
|
||||
@@ -79,13 +79,13 @@ PyObject *DocumentProtectorPy::method_varargs_ext_handler(PyObject *_self_and_na
|
||||
return pycxx_handler(_self_and_name_tuple, _args);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
throw Py::RuntimeError("Unknown C++ exception");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ private:
|
||||
PyObject *pcObj;
|
||||
PyObject *inclBig = Py_True;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "O!|O", &(PyList_Type), &pcObj, &inclBig)) {
|
||||
throw Py::Exception("expected (listofedges,boolean");
|
||||
throw Py::TypeError("expected (listofedges,boolean");
|
||||
}
|
||||
|
||||
std::vector<TopoDS_Edge> edgeList;
|
||||
@@ -191,7 +191,7 @@ private:
|
||||
{
|
||||
PyObject *pcObj;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "O!", &(PyList_Type), &pcObj)) {
|
||||
throw Py::Exception("expected (listofedges)");
|
||||
throw Py::TypeError("expected (listofedges)");
|
||||
}
|
||||
|
||||
std::vector<TopoDS_Edge> edgeList;
|
||||
@@ -248,7 +248,7 @@ private:
|
||||
if (!PyArg_ParseTuple(args.ptr(), "OdO", &pcObjShape,
|
||||
&scale,
|
||||
&pcObjDir)) {
|
||||
throw Py::Exception("expected (shape,scale,direction");
|
||||
throw Py::TypeError("expected (shape,scale,direction");
|
||||
}
|
||||
|
||||
if (!PyObject_TypeCheck(pcObjShape, &(TopoShapePy::Type))) {
|
||||
@@ -308,7 +308,7 @@ private:
|
||||
{
|
||||
PyObject *viewObj;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "O", &viewObj)) {
|
||||
throw Py::Exception("expected (DrawViewPart)");
|
||||
throw Py::TypeError("expected (DrawViewPart)");
|
||||
}
|
||||
Py::String dxfReturn;
|
||||
|
||||
@@ -363,7 +363,7 @@ private:
|
||||
{
|
||||
PyObject *viewObj;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "O", &viewObj)) {
|
||||
throw Py::Exception("expected (DrawViewPart)");
|
||||
throw Py::TypeError("expected (DrawViewPart)");
|
||||
}
|
||||
Py::String svgReturn;
|
||||
std::string grpHead1 = "<g fill=\"none\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"";
|
||||
|
||||
@@ -43,7 +43,7 @@ PyObject* DrawViewSymbolPy::dumpSymbol(PyObject *args)
|
||||
} else {
|
||||
std::string error = std::string("Can't write ");
|
||||
error += fileSpec;
|
||||
throw Py::Exception(error);
|
||||
throw Py::RuntimeError(error);
|
||||
}
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ private:
|
||||
PyObject *pageObj;
|
||||
char* name;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "Oet", &pageObj, "utf-8",&name)) {
|
||||
throw Py::Exception("expected (Page,path");
|
||||
throw Py::TypeError("expected (Page,path");
|
||||
}
|
||||
|
||||
std::string filePath = std::string(name);
|
||||
@@ -151,7 +151,7 @@ private:
|
||||
PyObject *pageObj;
|
||||
char* name;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "Oet", &pageObj, "utf-8",&name)) {
|
||||
throw Py::Exception("expected (Page,path");
|
||||
throw Py::TypeError("expected (Page,path");
|
||||
}
|
||||
|
||||
std::string filePath = std::string(name);
|
||||
|
||||
Reference in New Issue
Block a user