5 #ifndef __pinocchio_python_multibody_pool_model_hpp__ 6 #define __pinocchio_python_multibody_pool_model_hpp__ 10 #include "pinocchio/multibody/pool/model.hpp" 12 #include <boost/python/overloads.hpp> 16 #include "pinocchio/algorithm/check.hpp" 28 template<
typename ModelPool>
30 :
public bp::def_visitor< ModelPoolPythonVisitor<ModelPool> >
38 template<
class PyClass>
42 .def(bp::init<Model,bp::optional<int> >(
bp::args(
"self",
"model",
"size"),
43 "Default constructor."))
44 .def(bp::init<ModelPool>(
bp::args(
"self",
"other"),
48 bp::arg(
"self"),
"Model contained in the pool.",
49 bp::return_internal_reference<>())
50 .def(
"data",(Data & (
ModelPool::*)(
const size_t))&ModelPool::data,
51 bp::args(
"self",
"index"),
"Return a specific data.",
52 bp::return_internal_reference<>())
53 .def(
"datas",(DataVector & (
ModelPool::*)())&ModelPool::datas,
54 bp::arg(
"self"),
"Returns the data vectors.",
55 bp::return_internal_reference<>())
57 .def(
"size",&ModelPool::size,bp::arg(
"self"),
58 "Returns the size of the pool.")
59 .def(
"resize",&ModelPool::resize,
bp::args(
"self",
"new_size"),
62 .def(
"update",(
void (
ModelPool::*)(
const Model &))&ModelPool::update,
64 "Update the model, meaning that all the datas will be refreshed accordingly.")
65 .def(
"update",(
void (
ModelPool::*)(
const Data &))&ModelPool::update,
66 bp::args(
"self",
"data"),
"Update all the datas with the input data value.")
67 .def(
"update",(
void (
ModelPool::*)(
const Model &,
const Data &))&ModelPool::update,
68 bp::args(
"self",
"model",
"data"),
"Update the model and data together.")
75 bp::class_<ModelPool>(
"ModelPool",
76 "Pool containing a model and several datas for parallel computations",
88 #endif // ifnded __pinocchio_python_multibody_pool_model_hpp__
ModelPool::DataVector DataVector
Expose an std::vector from a type given as template argument.
Add the Python method copy to allow a copy of this by calling the copy constructor.
std::vector< Data, Eigen::aligned_allocator< Data > > DataVector
Main pinocchio namespace.
#define EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(...)
void visit(PyClass &cl) const