bindings/python/collision/tree-broadphase-manager.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2022 INRIA
3 //
4 
5 #ifndef __pinocchio_python_collision_tree_broadphase_manager_hpp__
6 #define __pinocchio_python_collision_tree_broadphase_manager_hpp__
7 
10 
12 #include <boost/algorithm/string/replace.hpp>
13 
14 namespace pinocchio
15 {
16  namespace python
17  {
18  namespace bp = boost::python;
19 
20  template<typename Derived>
22  : public bp::def_visitor<TreeBroadPhaseManagerPythonVisitor<Derived>>
23  {
24  public:
27 
28  /* --- Exposing C++ API to python through the handler ----------------- */
29  template<class PyClass>
30  void visit(PyClass & cl) const
31  {
32  cl
33  .def(bp::init<const Model *, const GeometryModel *, GeometryData *>(
34  bp::args("self", "model", "geometry_model", "geometry_data"), "Default constructor")
35  [bp::with_custodian_and_ward<1, 2>(), bp::with_custodian_and_ward<1, 3>(),
36  bp::with_custodian_and_ward<1, 4>()])
37  .def(bp::init<const Self &>(
38  bp::args("self", "other"), "Copy constructor")[bp::with_custodian_and_ward<1, 2>()])
39 
40  .def(
41  "getBroadPhaseManagers",
42  (BroadPhaseManagerVector & (Self::*)()) & Self::getBroadPhaseManagers, bp::arg("self"),
43  "Returns the internal broad phase managers", bp::return_internal_reference<>())
44 
46  }
47 
48  /* --- Expose --------------------------------------------------------- */
49  static void expose()
50  {
51  std::string derived_name = boost::typeindex::type_id<Derived>().pretty_name();
52  boost::algorithm::replace_all(derived_name, "hpp::fcl::", "");
53  const std::string class_name = "TreeBroadPhaseManager_" + derived_name;
54 
55  const std::string class_doc =
56  "Tree-based broad phase manager associated to hpp::fcl::" + derived_name;
57  bp::class_<Self> registered_class(class_name.c_str(), class_doc.c_str(), bp::no_init);
58  registered_class.def(TreeBroadPhaseManagerPythonVisitor());
59 
61  bp::objects::register_dynamic_id<Base>();
62  bp::objects::register_conversion<Self, Base>(false);
63  }
64  };
65 
66  } // namespace python
67 } // namespace pinocchio
68 
69 #endif // ifndef __pinocchio_python_collision_tree_broadphase_manager_hpp__
boost::python
pinocchio::python::BroadPhaseManagerBasePythonVisitor
Definition: bindings/python/collision/broadphase-manager-base.hpp:19
pinocchio::BroadPhaseManagerBase
Definition: collision/broadphase-manager-base.hpp:15
pinocchio::python::TreeBroadPhaseManagerPythonVisitor::BroadPhaseManagerVector
Self::BroadPhaseManagerVector BroadPhaseManagerVector
Definition: bindings/python/collision/tree-broadphase-manager.hpp:26
pinocchio::TreeBroadPhaseManagerTpl::BroadPhaseManagerVector
std::vector< BroadPhaseManager > BroadPhaseManagerVector
Definition: collision/tree-broadphase-manager.hpp:23
Base
BVNodeBase Base
eigen-to-python.hpp
pinocchio::python::TreeBroadPhaseManagerPythonVisitor
Definition: bindings/python/collision/tree-broadphase-manager.hpp:21
tree-broadphase-manager.hpp
pinocchio::TreeBroadPhaseManagerTpl
Definition: collision/pool/fwd.hpp:38
python
broadphase-manager-base.hpp
class_doc
const char * class_doc()
pinocchio::python::TreeBroadPhaseManagerPythonVisitor::expose
static void expose()
Definition: bindings/python/collision/tree-broadphase-manager.hpp:49
pinocchio::TreeBroadPhaseManagerTpl::getBroadPhaseManagers
const BroadPhaseManagerVector & getBroadPhaseManagers() const
Returns internal broad phase managers.
Definition: collision/tree-broadphase-manager.hpp:112
cl
cl
pinocchio::python::TreeBroadPhaseManagerPythonVisitor::visit
void visit(PyClass &cl) const
Definition: bindings/python/collision/tree-broadphase-manager.hpp:30
pinocchio::python::TreeBroadPhaseManagerPythonVisitor::Self
TreeBroadPhaseManagerTpl< Derived > Self
Definition: bindings/python/collision/tree-broadphase-manager.hpp:25
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Thu Dec 19 2024 03:41:33