1 |
|
|
// Copyright (c) 2017 CNRS |
2 |
|
|
// Copyright (c) 2022 INRIA |
3 |
|
|
// Authors: Joseph Mirabel (joseph.mirabel@laas.fr) |
4 |
|
|
// |
5 |
|
|
// This file is part of hpp-fcl. |
6 |
|
|
// hpp-fcl is free software: you can redistribute it |
7 |
|
|
// and/or modify it under the terms of the GNU Lesser General Public |
8 |
|
|
// License as published by the Free Software Foundation, either version |
9 |
|
|
// 3 of the License, or (at your option) any later version. |
10 |
|
|
// |
11 |
|
|
// hpp-fcl is distributed in the hope that it will be |
12 |
|
|
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
13 |
|
|
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 |
|
|
// General Lesser Public License for more details. You should have |
15 |
|
|
// received a copy of the GNU Lesser General Public License along with |
16 |
|
|
// hpp-fcl. If not, see <http://www.gnu.org/licenses/>. |
17 |
|
|
|
18 |
|
|
#ifndef HPP_FCL_COLLISION_UTILITY_H |
19 |
|
|
#define HPP_FCL_COLLISION_UTILITY_H |
20 |
|
|
|
21 |
|
|
#include <hpp/fcl/collision_object.h> |
22 |
|
|
|
23 |
|
|
namespace hpp { |
24 |
|
|
namespace fcl { |
25 |
|
|
|
26 |
|
|
HPP_FCL_DLLAPI CollisionGeometry* extract(const CollisionGeometry* model, |
27 |
|
|
const Transform3f& pose, |
28 |
|
|
const AABB& aabb); |
29 |
|
|
|
30 |
|
|
/** |
31 |
|
|
* \brief Returns the name associated to a NODE_TYPE |
32 |
|
|
*/ |
33 |
|
|
inline const char* get_node_type_name(NODE_TYPE node_type) { |
34 |
|
|
static const char* node_type_name_all[] = { |
35 |
|
|
"BV_UNKNOWN", "BV_AABB", "BV_OBB", "BV_RSS", |
36 |
|
|
"BV_kIOS", "BV_OBBRSS", "BV_KDOP16", "BV_KDOP18", |
37 |
|
|
"BV_KDOP24", "GEOM_BOX", "GEOM_SPHERE", "GEOM_CAPSULE", |
38 |
|
|
"GEOM_CONE", "GEOM_CYLINDER", "GEOM_CONVEX", "GEOM_PLANE", |
39 |
|
|
"GEOM_HALFSPACE", "GEOM_TRIANGLE", "GEOM_OCTREE", "GEOM_ELLIPSOID", |
40 |
|
|
"HF_AABB", "HF_OBBRSS", "NODE_COUNT"}; |
41 |
|
|
|
42 |
|
|
return node_type_name_all[node_type]; |
43 |
|
|
} |
44 |
|
|
|
45 |
|
|
/** |
46 |
|
|
* \brief Returns the name associated to a OBJECT_TYPE |
47 |
|
|
*/ |
48 |
|
|
inline const char* get_object_type_name(OBJECT_TYPE object_type) { |
49 |
|
|
static const char* object_type_name_all[] = { |
50 |
|
|
"OT_UNKNOWN", "OT_BVH", "OT_GEOM", "OT_OCTREE", "OT_HFIELD", "OT_COUNT"}; |
51 |
|
|
|
52 |
|
|
return object_type_name_all[object_type]; |
53 |
|
|
} |
54 |
|
|
|
55 |
|
|
} // namespace fcl |
56 |
|
|
|
57 |
|
|
} // namespace hpp |
58 |
|
|
|
59 |
|
|
#endif // FCL_COLLISION_UTILITY_H |