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<>())
51 bp::args(
"self",
"index"),
"Return a specific data.",
52 bp::return_internal_reference<>())
54 bp::arg(
"self"),
"Returns the data vectors.",
55 bp::return_internal_reference<>())
58 "Returns the size of the pool.")
63 bp::args(
"self",
"model"),
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__ const DataVector & datas() const
Returns the data vectors.
ModelPool::DataVector DataVector
void def(const char *name, Func func)
int size() const
Returns the size of the pool.
void update(const Model &model)
Update the model, meaning that all the datas will be refreshed accordingly.
static ::boost::python::class_< vector_type > expose(const std::string &class_name, const std::string &doc_string="")
const Model & model() const
Returns the model stored within the pool.
Add the Python method copy to allow a copy of this by calling the copy constructor.
const Data & data(const size_t index) const
Return a specific data.
void resize(const int new_size)
Set the size of the pool and perform the appropriate resize.
void init(bool compute_local_aabb=true)
std::vector< Data, Eigen::aligned_allocator< Data > > DataVector
Main pinocchio namespace.
#define EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(...)
void visit(PyClass &cl) const