| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  | /* ----------------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-09 07:16:11 +08:00
										 |  |  |  * GTSAM Copyright 2010, Georgia Tech Research Corporation, | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  |  * Atlanta, Georgia 30332-0415 | 
					
						
							|  |  |  |  * All Rights Reserved | 
					
						
							|  |  |  |  * Authors: Frank Dellaert, et al. (see THANKS for the full author list) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  * See LICENSE for the license information | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  * -------------------------------------------------------------------------- */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /**
 | 
					
						
							|  |  |  |  * @brief wraps Point3 class to python | 
					
						
							|  |  |  |  * @author Andrew Melim | 
					
						
							|  |  |  |  * @author Ellon Paiva Mendes (LAAS-CNRS) | 
					
						
							|  |  |  |  **/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <boost/python.hpp>
 | 
					
						
							| 
									
										
										
										
											2015-11-21 04:40:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define NO_IMPORT_ARRAY
 | 
					
						
							|  |  |  | #include <numpy_eigen/NumpyEigenConverter.hpp>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  | #include "gtsam/geometry/Point3.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using namespace boost::python; | 
					
						
							|  |  |  | using namespace gtsam; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(print_overloads, Point3::print, 0, 1) | 
					
						
							|  |  |  | BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(equals_overloads, Point3::equals, 1, 2) | 
					
						
							| 
									
										
										
										
											2016-02-25 03:01:19 +08:00
										 |  |  | BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(norm_overloads, Point3::norm, 0, 1) | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | void exportPoint3(){ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class_<Point3>("Point3") | 
					
						
							|  |  |  |   .def(init<>()) | 
					
						
							|  |  |  |   .def(init<double,double,double>()) | 
					
						
							| 
									
										
										
										
											2015-11-20 23:05:42 +08:00
										 |  |  |   .def(init<const Vector3 &>()) | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  |   .def("identity", &Point3::identity) | 
					
						
							|  |  |  |   .staticmethod("identity") | 
					
						
							|  |  |  |   .def("cross", &Point3::cross) | 
					
						
							|  |  |  |   .def("distance", &Point3::distance) | 
					
						
							|  |  |  |   .def("dot", &Point3::dot) | 
					
						
							|  |  |  |   .def("equals", &Point3::equals, equals_overloads(args("q","tol"))) | 
					
						
							| 
									
										
										
										
											2016-02-25 03:01:19 +08:00
										 |  |  |   .def("norm", &Point3::norm, norm_overloads(args("OptionalJacobian<1,3>"))) | 
					
						
							| 
									
										
										
										
											2016-02-10 10:01:47 +08:00
										 |  |  |   .def("normalized", &Point3::normalized) | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  |   .def("print", &Point3::print, print_overloads(args("s"))) | 
					
						
							| 
									
										
										
										
											2016-02-19 01:55:59 +08:00
										 |  |  | #ifndef GTSAM_USE_VECTOR3_POINTS
 | 
					
						
							| 
									
										
										
										
											2016-02-18 10:56:44 +08:00
										 |  |  |   .def("vector", &Point3::vector, return_value_policy<copy_const_reference>()) | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  |   .def("x", &Point3::x) | 
					
						
							|  |  |  |   .def("y", &Point3::y) | 
					
						
							|  |  |  |   .def("z", &Point3::z) | 
					
						
							| 
									
										
										
										
											2016-02-09 09:34:42 +08:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  |   .def(self * other<double>()) | 
					
						
							|  |  |  |   .def(other<double>() * self) | 
					
						
							|  |  |  |   .def(self + self) | 
					
						
							|  |  |  |   .def(-self) | 
					
						
							|  |  |  |   .def(self - self) | 
					
						
							|  |  |  |   .def(self / other<double>()) | 
					
						
							|  |  |  |   .def(self_ns::str(self)) | 
					
						
							|  |  |  |   .def(repr(self)) | 
					
						
							|  |  |  |   .def(self == self) | 
					
						
							|  |  |  | ; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-09 07:16:11 +08:00
										 |  |  | } |