From a9b0d81be47f28d871e7f648700d4af0012af4b4 Mon Sep 17 00:00:00 2001 From: dellaert Date: Wed, 17 Feb 2016 18:56:44 -0800 Subject: [PATCH] Yet another overload fix in python wrapper --- gtsam/geometry/Point3.h | 9 +++++++++ python/handwritten/geometry/Point3.cpp | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gtsam/geometry/Point3.h b/gtsam/geometry/Point3.h index 9c660f083..8b31316c7 100644 --- a/gtsam/geometry/Point3.h +++ b/gtsam/geometry/Point3.h @@ -109,6 +109,15 @@ class GTSAM_EXPORT Point3 : public Vector3 { /// return as Vector3 const Vector3& vector() const { return *this; } + /// get x + inline double x() const {return (*this)[0];} + + /// get y + inline double y() const {return (*this)[1];} + + /// get z + inline double z() const {return (*this)[2];} + /// @} /// Output stream operator diff --git a/python/handwritten/geometry/Point3.cpp b/python/handwritten/geometry/Point3.cpp index f83b0c516..c87421075 100644 --- a/python/handwritten/geometry/Point3.cpp +++ b/python/handwritten/geometry/Point3.cpp @@ -43,13 +43,13 @@ class_("Point3") .def("norm", &Point3::norm) .def("normalized", &Point3::normalized) .def("print", &Point3::print, print_overloads(args("s"))) -#ifndef GTSAM_USE_VECTOR3_POINTS +#ifdef GTSAM_USE_VECTOR3_POINTS + .def("vector", &Point3::vector, return_value_policy()) +#else .def("vector", &Point3::vector) .def("x", &Point3::x) .def("y", &Point3::y) .def("z", &Point3::z) -#else - .def("vector", &Point3::vector, return_value_policy()) #endif .def(self * other()) .def(other() * self)