26 :
public boost::python::def_visitor<GeometryModelPythonVisitor>
30 template<
class PyClass>
31 void visit(PyClass & cl)
const 33 cl.def(bp::init<>(bp::arg(
"self"),
"Default constructor"))
34 .def(bp::init<const GeometryModel &>(bp::args(
"self",
"other"),
"Copy constructor"))
37 "ngeoms", &GeometryModel::ngeoms,
38 "Number of geometries contained in the Geometry Model.")
40 "geometryObjects", &GeometryModel::geometryObjects,
"Vector of geometries objects.")
44 static_cast<GeometryModel::GeomIndex (GeometryModel::*)(
const GeometryObject &)
>(
45 &GeometryModel::addGeometryObject),
46 bp::args(
"self",
"geometry_object"),
47 "Add a GeometryObject to a GeometryModel.\n" 49 "\tgeometry_object : a GeometryObject\n")
52 static_cast<GeometryModel::GeomIndex (GeometryModel::*)(
53 const GeometryObject &,
const Model &)
>(&GeometryModel::addGeometryObject),
54 bp::args(
"self",
"geometry_object",
"model"),
55 "Add a GeometryObject to a GeometryModel and set its parent joint by reading its value " 58 "\tgeometry_object : a GeometryObject\n" 59 "\tmodel : a Model of the system\n")
61 "removeGeometryObject", &GeometryModel::removeGeometryObject, bp::args(
"self",
"name"),
62 "Remove a GeometryObject. Remove also the collision pairs that contain the object.")
64 "getGeometryId", &GeometryModel::getGeometryId, bp::args(
"self",
"name"),
65 "Returns the index of a GeometryObject given by its name.")
67 "existGeometryName", &GeometryModel::existGeometryName, bp::args(
"self",
"name"),
68 "Checks if a GeometryObject given by its name exists.")
70 "createData", &GeometryModelPythonVisitor::createData, bp::arg(
"self"),
71 "Create a GeometryData associated to the current model.")
72 .def(
"clone", &GeometryModel::clone, bp::arg(
"self"),
"Create a deep copy of *this.")
74 "collisionPairs", &GeometryModel::collisionPairs,
"Vector of collision pairs.")
76 "collisionPairMapping", &GeometryModel::collisionPairMapping,
77 "Matrix relating the collision pair ID to a pair of two GeometryObject indexes.")
79 "addCollisionPair", &GeometryModel::addCollisionPair,
80 bp::args(
"self",
"collision_pair"),
81 "Add a collision pair given by the index of the two collision objects.")
83 "addAllCollisionPairs", &GeometryModel::addAllCollisionPairs,
84 "Add all collision pairs.\n" 85 "note : collision pairs between geometries having the same parent joint are not added.")
87 "setCollisionPairs", &GeometryModel::setCollisionPairs,
88 (bp::arg(
"self"), bp::arg(
"collision_map"), bp::arg(
"upper") =
true),
89 "Set the collision pairs from a given input array.\n" 90 "Each entry of the input matrix defines the activation of a given collision pair" 91 "(map[i,j] == True means that the pair (i,j) is active).")
93 "removeCollisionPair", &GeometryModel::removeCollisionPair,
94 bp::args(
"self",
"collision_pair"),
"Remove a collision pair.")
96 "removeAllCollisionPairs", &GeometryModel::removeAllCollisionPairs,
97 "Remove all collision pairs.")
99 "existCollisionPair", &GeometryModel::existCollisionPair,
100 bp::args(
"self",
"collision_pair"),
"Check if a collision pair exists.")
102 "findCollisionPair", &GeometryModel::findCollisionPair,
103 bp::args(
"self",
"collision_pair"),
"Return the index of a collision pair.")
105 .def(bp::self == bp::self)
106 .def(bp::self != bp::self);
108 bp::register_ptr_to_python<std::shared_ptr<GeometryModel>>();
111 static GeometryData createData(
const GeometryModel & geomModel)
113 return GeometryData(geomModel);
119 if (!register_symbolic_link_to_registered_type<GeometryModel>())
121 bp::class_<GeometryModel>(
123 "Geometry model containing the collision or visual geometries associated to a model.",
128 .def(::eigenpy::CopyableVisitor<GeometryModel>())
130#ifndef PINOCCHIO_PYTHON_NO_SERIALIZATION