MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / getDetailPath

Method getDetailPath

src/Gui/ViewProviderFeaturePython.cpp:389–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389ViewProviderFeaturePythonImp::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
441std::vector<Base::Vector3d> ViewProviderFeaturePythonImp::getSelectionShape(const char* /*Element*/) const

Callers

nothing calls this directly

Calls 10

pyCallFunction · 0.85
createSWIGPointerObjMethod · 0.80
convertSWIGPointerObjMethod · 0.80
StringClass · 0.70
ObjectClass · 0.70
getLengthMethod · 0.45
refMethod · 0.45
ptrMethod · 0.45
copyMethod · 0.45
reportExceptionMethod · 0.45

Tested by

no test coverage detected