hpp-fcl  3.0.0
HPP fork of FCL -- The Flexible Collision Library
collision_object.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2021 INRIA
3 //
4 
5 #ifndef HPP_FCL_SERIALIZATION_COLLISION_OBJECT_H
6 #define HPP_FCL_SERIALIZATION_COLLISION_OBJECT_H
7 
9 
12 
13 namespace boost {
14 namespace serialization {
15 
16 template <class Archive>
17 void save(Archive& ar, const hpp::fcl::CollisionGeometry& collision_geometry,
18  const unsigned int /*version*/) {
19  ar& make_nvp("aabb_center", collision_geometry.aabb_center);
20  ar& make_nvp("aabb_radius", collision_geometry.aabb_radius);
21  ar& make_nvp("aabb_local", collision_geometry.aabb_local);
22  ar& make_nvp("cost_density", collision_geometry.cost_density);
23  ar& make_nvp("threshold_occupied", collision_geometry.threshold_occupied);
24  ar& make_nvp("threshold_free", collision_geometry.threshold_free);
25 }
26 
27 template <class Archive>
28 void load(Archive& ar, hpp::fcl::CollisionGeometry& collision_geometry,
29  const unsigned int /*version*/) {
30  ar >> make_nvp("aabb_center", collision_geometry.aabb_center);
31  ar >> make_nvp("aabb_radius", collision_geometry.aabb_radius);
32  ar >> make_nvp("aabb_local", collision_geometry.aabb_local);
33  ar >> make_nvp("cost_density", collision_geometry.cost_density);
34  ar >> make_nvp("threshold_occupied", collision_geometry.threshold_occupied);
35  ar >> make_nvp("threshold_free", collision_geometry.threshold_free);
36  collision_geometry.user_data = NULL; // no way to recover this
37 }
38 
40 
41 } // namespace serialization
42 } // namespace boost
43 
44 namespace hpp {
45 namespace fcl {
46 
47 // fwd declaration
48 template <typename BV>
49 class HeightField;
50 
51 template <typename PolygonT>
52 class Convex;
53 
54 struct OBB;
55 struct OBBRSS;
56 class AABB;
57 
58 class OcTree;
59 class Box;
60 class Sphere;
61 class Ellipsoid;
62 class Capsule;
63 class Cone;
64 class TriangleP;
65 class Cylinder;
66 class Halfspace;
67 class Plane;
68 
69 namespace serialization {
70 template <>
72  template <class Archive>
73  static void on(Archive& ar) {
74  ar.template register_type<Box>();
75  ar.template register_type<Sphere>();
76  ar.template register_type<Ellipsoid>();
77  ar.template register_type<TriangleP>();
78  ar.template register_type<Capsule>();
79  ar.template register_type<Cone>();
80  ar.template register_type<Cylinder>();
81  ar.template register_type<Halfspace>();
82  ar.template register_type<Plane>();
83  ar.template register_type<OcTree>();
84  ar.template register_type<HeightField<OBB>>();
85  ar.template register_type<HeightField<OBBRSS>>();
86  ar.template register_type<HeightField<AABB>>();
87  ar.template register_type<Convex<Triangle>>();
88  ;
89  }
90 };
91 } // namespace serialization
92 } // namespace fcl
93 } // namespace hpp
94 
95 #endif // ifndef HPP_FCL_SERIALIZATION_COLLISION_OBJECT_H
The geometry for the object for collision or distance computation.
Definition: collision_object.h:95
#define HPP_FCL_SERIALIZATION_SPLIT(Type)
Definition: fwd.h:24
FCL_REAL cost_density
collision cost for unit volume
Definition: collision_object.h:165
AABB aabb_local
AABB in local coordinate, used for tight AABB when only translation transform.
Definition: collision_object.h:159
FCL_REAL threshold_occupied
threshold for occupied ( >= is occupied)
Definition: collision_object.h:168
FCL_REAL aabb_radius
AABB radius.
Definition: collision_object.h:155
void * user_data
pointer to user defined data specific to this object
Definition: collision_object.h:162
FCL_REAL threshold_free
threshold for free (<= is free)
Definition: collision_object.h:171
Vec3f aabb_center
AABB center in local coordinate.
Definition: collision_object.h:152
void save(Archive &ar, const hpp::fcl::BVSplitter< BV > &splitter_, const unsigned int)
Definition: BV_splitter.h:30
void load(Archive &ar, hpp::fcl::BVSplitter< BV > &splitter_, const unsigned int)
Definition: BV_splitter.h:44
Definition: AABB.h:11
Main namespace.
Definition: broadphase_bruteforce.h:44
static void on(Archive &ar)
Definition: collision_object.h:73