35 #ifndef HPP_FCL_PYTHON_BROADPHASE_BROADPHASE_COLLISION_MANAGER_HH 36 #define HPP_FCL_PYTHON_BROADPHASE_BROADPHASE_COLLISION_MANAGER_HH 46 #ifdef HPP_FCL_HAS_DOXYGEN_AUTODOC 47 #include "doxygen_autodoc/functions.h" 48 #include "doxygen_autodoc/hpp/fcl/broadphase/broadphase_collision_manager.h" 51 #include <boost/algorithm/string/replace.hpp> 52 #include <boost/type_index.hpp> 59 bp::wrapper<BroadPhaseCollisionManager> {
63 this->get_override(
"registerObjects")(other_objs);
66 this->get_override(
"registerObjects")(obj);
69 this->get_override(
"unregisterObject")(obj);
72 void update(
const std::vector<CollisionObject *> &other_objs) {
73 this->get_override(
"update")(other_objs);
76 void update() { this->get_override(
"update")(); }
78 void setup() { this->get_override(
"setup")(); }
79 void clear() { this->get_override(
"clear")(); }
82 #pragma GCC diagnostic push 83 #pragma GCC diagnostic ignored "-Wconversion" 84 return this->get_override(
"getObjects")();
85 #pragma GCC diagnostic pop 89 this->get_override(
"collide")(
callback);
92 this->get_override(
"collide")(obj,
callback);
96 this->get_override(
"collide")(other_manager,
callback);
100 this->get_override(
"distance")(
callback);
103 this->get_override(
"collide")(obj,
callback);
107 this->get_override(
"collide")(other_manager,
callback);
111 #pragma GCC diagnostic push 112 #pragma GCC diagnostic ignored "-Wconversion" 113 return this->get_override(
"empty")();
114 #pragma GCC diagnostic pop 117 #pragma GCC diagnostic push 118 #pragma GCC diagnostic ignored "-Wconversion" 119 return this->get_override(
"size")();
120 #pragma GCC diagnostic pop 124 bp::class_<BroadPhaseCollisionManagerWrapper, boost::noncopyable>(
125 "BroadPhaseCollisionManager", bp::no_init)
128 bp::with_custodian_and_ward_postcall<1, 2>())
131 bp::with_custodian_and_ward_postcall<1, 2>())
135 .def(
"update", bp::pure_virtual((
void(Base::*)()) &
Base::update),
139 (
void(Base::*)(
const std::vector<CollisionObject *> &)) &
142 const std::vector<CollisionObject *> &))(&Base::update)),
143 bp::with_custodian_and_ward_postcall<1, 2>())
149 bp::with_custodian_and_ward_postcall<1, 2>())
162 bp::pure_virtual((std::vector<CollisionObject *>(Base::*)()
const) &
165 (std::vector<CollisionObject *>(Base::*)()
const) &
167 bp::with_custodian_and_ward_postcall<0, 1>())
216 template <
typename Derived>
218 std::string class_name = boost::typeindex::type_id<Derived>().pretty_name();
219 boost::algorithm::replace_all(class_name,
"hpp::fcl::",
"");
221 boost::algorithm::replace_all(class_name,
"class ",
"");
224 bp::class_<Derived, bp::bases<BroadPhaseCollisionManager> >(
225 class_name.c_str(), bp::no_init)
226 .
def(dv::init<Derived>());
234 #endif // ifndef HPP_FCL_PYTHON_BROADPHASE_BROADPHASE_COLLISION_MANAGER_HH const char * member_func_doc(FuncPtr)
static void exposeDerived()
BroadPhaseCollisionManager Base
void setup()
initialize the manager, related with the specific type of manager
void distance(BroadPhaseCollisionManager *other_manager, DistanceCallBackBase *callback) const
perform distance test with objects belonging to another manager
size_t size() const
the number of objects managed by the manager
void update(const std::vector< CollisionObject *> &other_objs)
update the manager by explicitly given the set of objects update
Base class for broad phase collision. It helps to accelerate the collision/distance between N objects...
virtual void update()=0
update the condition of manager
virtual void registerObjects(const std::vector< CollisionObject *> &other_objs)
add objects to the manager
Base callback class for collision queries. This class can be supersed by child classes to provide des...
std::vector< CollisionObject * > getObjects() const
return the objects managed by the manager
void clear()
clear the manager
void unregisterObject(CollisionObject *obj)
remove one object from the manager
void def(const char *name, Func func)
void update()
update the condition of manager
void collide(CollisionCallBackBase *callback) const
perform collision test for the objects belonging to the manager (i.e., N^2 self collision) ...
void registerObjects(const std::vector< CollisionObject *> &other_objs)
add objects to the manager
void distance(DistanceCallBackBase *callback) const
perform distance test for the objects belonging to the manager (i.e., N^2 self distance) ...
void distance(CollisionObject *obj, DistanceCallBackBase *callback) const
perform distance computation between one object and all the objects belonging to the manager ...
virtual std::vector< CollisionObject * > getObjects() const
return the objects managed by the manager
void collide(BroadPhaseCollisionManager *other_manager, CollisionCallBackBase *callback) const
perform collision test with objects belonging to another manager
void registerObject(CollisionObject *obj)
add one object to the manager
void update(CollisionObject *obj)
update the manager by explicitly given the object updated
virtual size_t size() const =0
the number of objects managed by the manager
void collide(CollisionObject *obj, CollisionCallBackBase *callback) const
perform collision test between one object and all the objects belonging to the manager ...
bool empty() const
whether the manager is empty
virtual void unregisterObject(CollisionObject *obj)=0
remove one object from the manager
virtual void clear()=0
clear the manager
virtual void setup()=0
initialize the manager, related with the specific type of manager
virtual void collide(CollisionObject *obj, CollisionCallBackBase *callback) const =0
perform collision test between one object and all the objects belonging to the manager ...
the object for collision or distance computation, contains the geometry and the transform information...
Base callback class for distance queries. This class can be supersed by child classes to provide desi...
virtual bool empty() const =0
whether the manager is empty
virtual void registerObject(CollisionObject *obj)=0
add one object to the manager
virtual void distance(CollisionObject *obj, DistanceCallBackBase *callback) const =0
perform distance computation between one object and all the objects belonging to the manager ...