5#ifndef __pinocchio_python_collision_pool_geometry_hpp__ 6#define __pinocchio_python_collision_pool_geometry_hpp__ 8#include <boost/python/overloads.hpp> 10#include <eigenpy/eigen-to-python.hpp> 11#include <eigenpy/memory.hpp> 12#include <eigenpy/exception.hpp> 14#include "pinocchio/bindings/python/utils/copyable.hpp" 15#include "pinocchio/bindings/python/utils/std-vector.hpp" 17#include "pinocchio/algorithm/check.hpp" 18#include "pinocchio/multibody/pool/geometry.hpp" 20#if EIGENPY_VERSION_AT_MOST(2, 8, 1) 21EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(pinocchio::GeometryPool)
28 namespace bp = boost::python;
30 template<
typename GeometryPool>
31 struct GeometryPoolPythonVisitor
32 :
public bp::def_visitor<GeometryPoolPythonVisitor<GeometryPool>>
35 typedef typename GeometryPool::Base Base;
36 typedef typename GeometryPool::Model Model;
37 typedef typename GeometryPool::GeometryModel GeometryModel;
38 typedef typename GeometryPool::GeometryData GeometryData;
39 typedef typename GeometryPool::GeometryModelVector GeometryModelVector;
40 typedef typename GeometryPool::GeometryDataVector GeometryDataVector;
43 template<
class PyClass>
44 void visit(PyClass & cl)
const 46 cl.def(bp::init<
const Model &,
const GeometryModel &, bp::optional<size_t>>(
47 bp::args(
"self",
"model",
"geometry_model",
"size"),
"Default constructor."))
48 .def(bp::init<const GeometryPool &>(bp::args(
"self",
"other"),
"Copy constructor."))
53 bp::args(
"self",
"index"),
"Return a specific geometry model.",
54 bp::return_internal_reference<>())
58 bp::arg(
"self"),
"Returns the geometry model vector.",
59 bp::return_internal_reference<>())
64 bp::args(
"self",
"index"),
"Return a specific geometry data.",
65 bp::return_internal_reference<>())
69 bp::arg(
"self"),
"Returns the geometry data vector.", bp::return_internal_reference<>())
73 "Synchronize the internal geometry models with the input geometry for all given " 78 bp::args(
"self",
"geometry_data"),
79 "Update all the geometry datas with the input geometry data value.");
85 bp::class_<GeometryPool, bp::bases<Base>>(
87 "Pool containing a model + a geometry_model and several datas for parallel computations",
89 .def(GeometryPoolPythonVisitor())
90 .def(CopyableVisitor<GeometryPool>());
92 StdVectorPythonVisitor<GeometryModelVector>::expose(
"StdVec_GeometryModel");
93 StdVectorPythonVisitor<GeometryDataVector>::expose(
"StdVec_GeometryData");
const GeometryModel & getGeometryModel(const size_t index) const
virtual void update(const GeometryData &geometry_data_to_copy)
const GeometryModelVector & getGeometryModels() const
void sync(const GeometryModel &geometry_model, const std::vector< GeomIndex > &geometry_indexes)
const GeometryDataVector & getGeometryDatas() const
const GeometryData & getGeometryData(const size_t index) const
Main pinocchio namespace.