geometry-functors.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2021 INRIA
3 //
4 
5 #ifndef __pinocchio_python_collision_geometry_functors_hpp__
6 #define __pinocchio_python_collision_geometry_functors_hpp__
7 
9 
11 
12 namespace pinocchio
13 {
14  namespace python
15  {
16  namespace bp = boost::python;
17 
18  template<typename GeometryFunctor>
20  : public boost::python::def_visitor<GeometryFunctorPythonVisitor<GeometryFunctor>>
21  {
22 
23  template<class PyClass>
24  void visit(PyClass & cl) const
25  {
26  const std::string class_name = bp::type_id<GeometryFunctor>().name();
27 
28  cl.def(bp::init<const GeometryObject &, const GeometryObject &>(
29  bp::args("self", "geometry_object1", "geometry_object2"),
30  (std::string("Constructor of a ") + class_name).c_str()))
31  .def(
32  "run", &GeometryFunctor::run, bp::args("self", "tf1", "tf2", "request", "result"),
33  "Call the function and return the result")
34 
35  .def(
36  "getGeometryObject1", &GeometryFunctor::getGeometryObject1,
37  bp::return_value_policy<bp::copy_const_reference>())
38  .def(
39  "getGeometryObject2", &GeometryFunctor::getGeometryObject2,
40  bp::return_value_policy<bp::copy_const_reference>())
41 
42  .def("print", &print);
43  }
44 
45  static void print(const GeometryFunctor & self)
46  {
47  std::cout << "address #1: " << &self.getGeometryObject1() << std::endl;
48  std::cout << "address #2: " << &self.getGeometryObject2() << std::endl;
49  }
50  };
51 
52  } // namespace python
53 } // namespace pinocchio
54 
55 #endif // ifndef __pinocchio_python_collision_geometry_functors_hpp__
boost::python
pinocchio::python::GeometryFunctorPythonVisitor::print
static void print(const GeometryFunctor &self)
Definition: geometry-functors.hpp:45
registration.hpp
omniidl_be_python_with_docstring.run
def run(tree, args)
Definition: cmake/hpp/idl/omniidl_be_python_with_docstring.py:140
pinocchio::python::GeometryFunctorPythonVisitor::visit
void visit(PyClass &cl) const
Definition: geometry-functors.hpp:24
python
geometry.hpp
cl
cl
pinocchio::python::GeometryFunctorPythonVisitor
Definition: geometry-functors.hpp:19
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:09