Yet another overload fix in python wrapper

release/4.3a0
dellaert 2016-02-17 18:56:44 -08:00
parent df4efbf2d7
commit a9b0d81be4
2 changed files with 12 additions and 3 deletions

View File

@ -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

View File

@ -43,13 +43,13 @@ class_<Point3>("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<copy_const_reference>())
#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<copy_const_reference>())
#endif
.def(self * other<double>())
.def(other<double>() * self)