1 #include <boost/python.hpp> 9 if ( index < 0 || index >=3 ) {
10 PyErr_SetString ( PyExc_IndexError,
"index out of range" );
11 throw boost::python::error_already_set();;
17 if ( index < 0 || index >=3 ) {
18 PyErr_SetString ( PyExc_IndexError,
"index out of range" );
19 throw boost::python::error_already_set();;
24 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(str_overloads, str, 0, 1)
27 Point2D & (
Point2D::*Point2Dset2 ) (
double,
double ) = &Point2D::set;
28 Point2D & (
Point2D::*Point2Dset3 ) (
double,
double,
double ) = &Point2D::set;
29 cv::Point_<double> & (
Point2D::*Point2cv ) () = &Point2D::cv;
31 class_<Point2D> (
"Point2D" )
32 .def ( init<double, double>() )
33 .def ( init<double, double, double>() )
34 .add_property(
"x", &Point2D::get_x, &Point2D::set_x)
35 .add_property(
"y", &Point2D::get_y, &Point2D::set_y)
36 .add_property(
"h", &Point2D::get_h, &Point2D::set_h)
37 .def (
"angle", &Point2D::angle )
38 .def (
"inside", &Point2D::inside )
41 .def (
"set", Point2Dset2, return_value_policy<copy_non_const_reference>() )
42 .def (
"set", Point2Dset3, return_value_policy<copy_non_const_reference>() )
43 .def (
"cv", Point2cv, return_value_policy<copy_non_const_reference>() )
44 .def(
"__str__", &Pose2D::str, str_overloads())
45 .def(
"str", &Pose2D::str, str_overloads());
48 Pose2D & (
Pose2D::*Pose2Dset3 ) (
double,
double,
double ) = &Pose2D::set;
52 class_<Pose2D> (
"Pose2D" )
53 .def ( init<double, double, double>() )
54 .def ( init<const Point2D&, double>() )
55 .add_property(
"x", &Pose2D::get_x, &Pose2D::set_x)
56 .add_property(
"y", &Pose2D::get_y, &Pose2D::set_y)
57 .add_property(
"theta", &Pose2D::get_theta, &Pose2D::set_theta)
58 .def (
"set", Pose2Dset3, return_value_policy<copy_non_const_reference>() )
59 .def (
"position", Pose2Dposition, return_value_policy<copy_non_const_reference>() )
60 .def (
"recompute_cached_cos_sin", &Pose2D::recompute_cached_cos_sin )
61 .def (
"transform_into_base", &Pose2D::transform_into_base, return_value_policy<copy_non_const_reference>())
63 .def(
"__str__", &Pose2D::str, str_overloads())
64 .def(
"str", &Pose2D::str, str_overloads());
double Point2Dgetitem(Point2D &f, int index)
void Point2Dsetitem(Point2D &f, int index, int val)
BOOST_PYTHON_MODULE(tuw_geometry_wrapper)