broadphase_callbacks.hh
Go to the documentation of this file.
1 //
2 // Software License Agreement (BSD License)
3 //
4 // Copyright (c) 2022 INRIA
5 // Author: Justin Carpentier
6 // All rights reserved.
7 //
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions
10 // are met:
11 //
12 // * Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 // * Redistributions in binary form must reproduce the above
15 // copyright notice, this list of conditions and the following
16 // disclaimer in the documentation and/or other materials provided
17 // with the distribution.
18 // * Neither the name of INRIA nor the names of its
19 // contributors may be used to endorse or promote products derived
20 // from this software without specific prior written permission.
21 //
22 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 // POSSIBILITY OF SUCH DAMAGE.
34 
35 #ifndef HPP_FCL_PYTHON_BROADPHASE_BROADPHASE_CALLBACKS_HH
36 #define HPP_FCL_PYTHON_BROADPHASE_BROADPHASE_CALLBACKS_HH
37 
38 #include <eigenpy/eigenpy.hpp>
39 
40 #include <hpp/fcl/fwd.hh>
42 
43 #include "../fcl.hh"
44 
45 #ifdef HPP_FCL_HAS_DOXYGEN_AUTODOC
46 #include "doxygen_autodoc/functions.h"
47 #include "doxygen_autodoc/hpp/fcl/broadphase/broadphase_callbacks.h"
48 #endif
49 
50 namespace hpp {
51 namespace fcl {
52 
54  bp::wrapper<CollisionCallBackBase> {
56 
57  void init() { this->get_override("init")(); }
59 #pragma GCC diagnostic push
60 #pragma GCC diagnostic ignored "-Wconversion"
61  return this->get_override("collide")(o1, o2);
62 #pragma GCC diagnostic pop
63  }
64 
65  static void expose() {
66  bp::class_<CollisionCallBackBaseWrapper, boost::noncopyable>(
67  "CollisionCallBackBase", bp::no_init)
68  .def("init", bp::pure_virtual(&Base::init),
70  .def("collide", bp::pure_virtual(&Base::collide),
72  .def("__call__", &Base::operator(),
73  doxygen::member_func_doc(&Base::operator()));
74  }
75 }; // CollisionCallBackBaseWrapper
76 
78  bp::wrapper<DistanceCallBackBase> {
81 
82  void init() { this->get_override("init")(); }
84  Eigen::Matrix<double, 1, 1>& dist) {
85  return distance(o1, o2, dist.coeffRef(0, 0));
86  }
87 
89 #pragma GCC diagnostic push
90 #pragma GCC diagnostic ignored "-Wconversion"
91  return this->get_override("distance")(o1, o2, dist);
92 #pragma GCC diagnostic pop
93  }
94 
95  static void expose() {
96  bp::class_<DistanceCallBackBaseWrapper, boost::noncopyable>(
97  "DistanceCallBackBase", bp::no_init)
98  .def("init", bp::pure_virtual(&Base::init),
100  .def("distance",
101  bp::pure_virtual(
102  static_cast<bool (Self::*)(
104  Eigen::Matrix<double, 1, 1>& dist)>(&Self::distance)),
106  .def("__call__", &Base::operator(),
107  doxygen::member_func_doc(&Base::operator()));
108  }
109 }; // DistanceCallBackBaseWrapper
110 
111 } // namespace fcl
112 } // namespace hpp
113 
114 #endif // ifndef HPP_FCL_PYTHON_BROADPHASE_BROADPHASE_CALLBACKS_HH
hpp::fcl::CollisionCallBackBaseWrapper::Base
CollisionCallBackBase Base
Definition: broadphase_callbacks.hh:55
hpp::fcl::DistanceCallBackBaseWrapper::distance
bool distance(CollisionObject *o1, CollisionObject *o2, Eigen::Matrix< double, 1, 1 > &dist)
Definition: broadphase_callbacks.hh:83
hpp::fcl::CollisionCallBackBaseWrapper::init
void init()
Initialization of the callback before running the collision broadphase manager.
Definition: broadphase_callbacks.hh:57
eigenpy.hpp
hpp::fcl::CollisionCallBackBaseWrapper::collide
bool collide(CollisionObject *o1, CollisionObject *o2)
Collision evaluation between two objects in collision. This callback will cause the broadphase evalua...
Definition: broadphase_callbacks.hh:58
hpp::fcl::CollisionCallBackBase::init
virtual void init()
Initialization of the callback before running the collision broadphase manager.
Definition: broadphase_callbacks.h:53
hpp::fcl::DistanceCallBackBaseWrapper::Self
DistanceCallBackBaseWrapper Self
Definition: broadphase_callbacks.hh:80
hpp::fcl::DistanceCallBackBaseWrapper::init
void init()
Initialization of the callback before running the collision broadphase manager.
Definition: broadphase_callbacks.hh:82
hpp::fcl::CollisionCallBackBase::collide
virtual bool collide(CollisionObject *o1, CollisionObject *o2)=0
Collision evaluation between two objects in collision. This callback will cause the broadphase evalua...
hpp::fcl::DistanceCallBackBase::init
virtual void init()
Initialization of the callback before running the collision broadphase manager.
Definition: broadphase_callbacks.h:76
hpp::fcl::FCL_REAL
double FCL_REAL
Definition: data_types.h:65
hpp::fcl::DistanceCallBackBase
Base callback class for distance queries. This class can be supersed by child classes to provide desi...
Definition: broadphase_callbacks.h:73
hpp
Main namespace.
Definition: broadphase_bruteforce.h:44
hpp::fcl::CollisionObject
the object for collision or distance computation, contains the geometry and the transform information
Definition: collision_object.h:215
hpp::fcl::CollisionCallBackBaseWrapper::expose
static void expose()
Definition: broadphase_callbacks.hh:65
hpp::fcl::DistanceCallBackBaseWrapper::distance
bool distance(CollisionObject *o1, CollisionObject *o2, FCL_REAL &dist)
Distance evaluation between two objects in collision. This callback will cause the broadphase evaluat...
Definition: broadphase_callbacks.hh:88
broadphase_callbacks.h
hpp::fcl::CollisionCallBackBaseWrapper
Definition: broadphase_callbacks.hh:53
hpp::fcl::DistanceCallBackBase::distance
virtual bool distance(CollisionObject *o1, CollisionObject *o2, FCL_REAL &dist)=0
Distance evaluation between two objects in collision. This callback will cause the broadphase evaluat...
fwd.hh
hpp::fcl::CollisionCallBackBase
Base callback class for collision queries. This class can be supersed by child classes to provide des...
Definition: broadphase_callbacks.h:50
hpp::fcl::DistanceCallBackBaseWrapper::Base
DistanceCallBackBase Base
Definition: broadphase_callbacks.hh:79
doxygen::member_func_doc
const char * member_func_doc(FuncPtr)
Definition: doxygen.hh:33
hpp::fcl::DistanceCallBackBaseWrapper
Definition: broadphase_callbacks.hh:77
hpp::fcl::DistanceCallBackBaseWrapper::expose
static void expose()
Definition: broadphase_callbacks.hh:95


hpp-fcl
Author(s):
autogenerated on Fri Aug 2 2024 02:45:12