1 #ifndef DYNAMIC_GRAPH_PYTHON_MODULE_HH
2 #define DYNAMIC_GRAPH_PYTHON_MODULE_HH
4 #ifdef PINOCCHIO_WITH_URDFDOM
6 #include <pinocchio/fwd.hpp>
9 #include <dynamic-graph/entity.h>
11 #include <boost/mpl/for_each.hpp>
12 #include <boost/mpl/vector.hpp>
13 #include <boost/python.hpp>
24 template <
typename T,
int Options = AddCommands | AddSignals>
27 assert(
dynamic_cast<T*
>(ent) != NULL);
28 bp::object obj(bp::ptr(
static_cast<T*
>(ent)));
33 template <
typename T,
int Options = AddCommands | AddSignals>
35 return makeEntity1<T, Options>(
"");
47 typename bases = boost::python::bases<dynamicgraph::Entity>,
51 std::string hiddenClassName(T::CLASS_NAME);
53 bp::class_<T, bases, boost::noncopyable> obj(hiddenClassName.c_str(),
54 bp::init<std::string>());
76 bp::def(T::CLASS_NAME.c_str(), &internal::makeEntity1<T, Options>);
77 bp::def(T::CLASS_NAME.c_str(), &internal::makeEntity2<T, Options>);
86 #endif // DYNAMIC_GRAPH_PYTHON_MODULE_HH