bindings/python/multibody/pool/geometry.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2021 INRIA
3 //
4 
5 #ifndef __pinocchio_python_multibody_pool_geometry_hpp__
6 #define __pinocchio_python_multibody_pool_geometry_hpp__
7 
9 
10 #include "pinocchio/multibody/pool/geometry.hpp"
11 
12 #include <boost/python/overloads.hpp>
13 #include <eigenpy/memory.hpp>
14 #include <eigenpy/exception.hpp>
15 
16 #include "pinocchio/algorithm/check.hpp"
19 
21 
22 namespace pinocchio
23 {
24  namespace python
25  {
26  namespace bp = boost::python;
27 
28  template<typename GeometryPool>
30  : public bp::def_visitor< GeometryPoolPythonVisitor<GeometryPool> >
31  {
32 
33  typedef typename GeometryPool::Base Base;
34  typedef typename GeometryPool::Model Model;
38 
39  /* --- Exposing C++ API to python through the handler ----------------- */
40  template<class PyClass>
41  void visit(PyClass& cl) const
42  {
43  cl
44  .def(bp::init<Model,GeometryModel,bp::optional<int> >(bp::args("self","model","geometry_model","size"),
45  "Default constructor."))
46  .def(bp::init<GeometryPool>(bp::args("self","other"),
47  "Copy constructor."))
48 
49  .def("geometry_model",(GeometryModel & (GeometryPool::*)())&GeometryPool::geometry_model,
50  bp::arg("self"),"Geometry model contained in the pool.",
51  bp::return_internal_reference<>())
52  .def("geometry_data",(GeometryData & (GeometryPool::*)(const size_t))&GeometryPool::geometry_data,
53  bp::args("self","index"),"Return a specific geometry_data data.",
54  bp::return_internal_reference<>())
55  .def("geometry_datas",(GeometryDataVector & (GeometryPool::*)())&GeometryPool::geometry_datas,
56  bp::arg("self"),"Returns the geometry data vector.",
57  bp::return_internal_reference<>())
58 
59  .def("update",(void (GeometryPool::*)(const GeometryModel &))&GeometryPool::update,
60  bp::args("self","geometry_model"),
61  "Update the geometry model, meaning that all the datas will be refreshed accordingly.")
62  .def("update",(void (GeometryPool::*)(const GeometryData &))&GeometryPool::update,
63  bp::args("self","geometry_data"),"Update all the geometry datas with the input geometry data value.")
64  .def("update",(void (GeometryPool::*)(const GeometryModel &, const GeometryData &))&GeometryPool::update,
65  bp::args("self","geometry_model","geometry_data"),
66  "Update the geometry model and data together.")
67  ;
68  }
69 
70  static void expose()
71  {
72 
73  bp::class_<GeometryPool,bp::bases<Base> >("GeometryPool",
74  "Pool containing a model + a geometry_model and several datas for parallel computations",
75  bp::no_init)
78  ;
79 
81  }
82  };
83  }
84 }
85 
86 #endif // ifnded __pinocchio_python_multibody_pool_geometry_hpp__
Expose an std::vector from a type given as template argument.
Definition: std-vector.hpp:170
std::vector< GeometryData, Eigen::aligned_allocator< GeometryData > > GeometryDataVector
Add the Python method copy to allow a copy of this by calling the copy constructor.
Definition: copyable.hpp:21
Main pinocchio namespace.
Definition: timings.cpp:30
#define EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(...)


pinocchio
Author(s):
autogenerated on Tue Jun 1 2021 02:45:03