From b15e41fdb1d7ddb29daf374f4ce5a5edde6c8ebb Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 12 Apr 2021 15:12:21 +0200 Subject: [PATCH] Base: [skip ci] add convenience function to get PyObjectBase from GeometryT --- src/Base/GeometryPyCXX.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Base/GeometryPyCXX.h b/src/Base/GeometryPyCXX.h index 8226918845..8dfd6cf9f8 100644 --- a/src/Base/GeometryPyCXX.h +++ b/src/Base/GeometryPyCXX.h @@ -185,11 +185,12 @@ public: } operator T() const { - // cast the PyObject pointer to the matching sub-class - // and call then the defined member function + return getValue(); + } + PyT* getPy() const + { PyT* py = static_cast(ptr()); - T* v = (py->*valuePtr)(); - return *v; + return py; } private: