| 387 | } |
| 388 | |
| 389 | ViewProviderFeaturePythonImp::ValueT ViewProviderFeaturePythonImp::getDetailPath( |
| 390 | const char* name, |
| 391 | SoFullPath* path, |
| 392 | bool append, |
| 393 | SoDetail*& det |
| 394 | ) const |
| 395 | { |
| 396 | FC_PY_CALL_CHECK(getDetailPath); |
| 397 | |
| 398 | Base::PyGILStateLocker lock; |
| 399 | auto length = path->getLength(); |
| 400 | try { |
| 401 | PyObject* pivy = nullptr; |
| 402 | pivy = Base::Interpreter() |
| 403 | .createSWIGPointerObj("pivy.coin", "SoFullPath *", static_cast<void*>(path), 1); |
| 404 | path->ref(); |
| 405 | Py::Tuple args(3); |
| 406 | args.setItem(0, Py::String(name)); |
| 407 | args.setItem(1, Py::Object(pivy, true)); |
| 408 | args.setItem(2, Py::Boolean(append)); |
| 409 | Py::Object pyDet(Base::pyCall(py_getDetailPath.ptr(), args.ptr())); |
| 410 | if (!pyDet.isTrue()) { |
| 411 | return Rejected; |
| 412 | } |
| 413 | if (pyDet.isBoolean()) { |
| 414 | return Accepted; |
| 415 | } |
| 416 | void* ptr = nullptr; |
| 417 | Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoDetail *", pyDet.ptr(), &ptr, 0); |
| 418 | auto detail = static_cast<SoDetail*>(ptr); |
| 419 | det = detail ? detail->copy() : nullptr; |
| 420 | if (det) { |
| 421 | return Accepted; |
| 422 | } |
| 423 | delete det; |
| 424 | } |
| 425 | catch (const Base::Exception& e) { |
| 426 | e.reportException(); |
| 427 | } |
| 428 | catch (Py::Exception&) { |
| 429 | if (PyErr_ExceptionMatches(PyExc_NotImplementedError)) { |
| 430 | PyErr_Clear(); |
| 431 | return NotImplemented; |
| 432 | } |
| 433 | Base::PyException e; // extract the Python error text |
| 434 | e.reportException(); |
| 435 | } |
| 436 | path->truncate(length); |
| 437 | return Rejected; |
| 438 | } |
| 439 | |
| 440 | |
| 441 | std::vector<Base::Vector3d> ViewProviderFeaturePythonImp::getSelectionShape(const char* /*Element*/) const |
nothing calls this directly
no test coverage detected