5 #ifndef HPP_FCL_SERIALIZATION_CONVEX_H 6 #define HPP_FCL_SERIALIZATION_CONVEX_H 17 namespace serialization {
27 template <
class Archive>
29 const unsigned int ) {
33 Accessor &accessor =
reinterpret_cast<Accessor &
>(convex_base);
35 ar &make_nvp(
"base", boost::serialization::base_object<hpp::fcl::ShapeBase>(
37 const unsigned int num_points_previous = convex_base.
num_points;
38 ar &make_nvp(
"num_points", convex_base.
num_points);
40 if (Archive::is_loading::value) {
41 if (num_points_previous != convex_base.
num_points ||
42 !accessor.own_storage_) {
43 delete[] convex_base.
points;
45 accessor.own_storage_ =
true;
50 typedef Eigen::Matrix<FCL_REAL, 3, Eigen::Dynamic> MatrixPoints;
51 Eigen::Map<MatrixPoints> points_map(
52 reinterpret_cast<double *>(convex_base.
points), 3,
54 ar &make_nvp(
"points", points_map);
57 ar &make_nvp(
"center", convex_base.
center);
63 template <
typename PolygonT>
71 template <
class Archive,
typename PolygonT>
73 const unsigned int ) {
77 Accessor &convex =
reinterpret_cast<Accessor &
>(convex_);
78 ar &make_nvp(
"base", boost::serialization::base_object<ConvexBase>(convex));
80 const unsigned int num_polygons_previous = convex.num_polygons;
81 ar &make_nvp(
"num_polygons", convex.num_polygons);
83 if (Archive::is_loading::value) {
84 if (num_polygons_previous != convex.num_polygons) {
85 delete[] convex.polygons;
86 convex.polygons =
new PolygonT[convex.num_polygons];
90 ar &make_array<PolygonT>(convex.polygons, convex.num_polygons);
92 if (Archive::is_loading::value) convex.fillNeighbors();
113 #endif // ifndef HPP_FCL_SERIALIZATION_CONVEX_H bool own_storage_
Definition: geometric_shapes.h:693
hpp::fcl::Convex< PolygonT > Base
Definition: convex.h:65
Main namespace.
Definition: broadphase_bruteforce.h:44
void fillNeighbors()
Definition: convex.hxx:204
void serialize(Archive &ar, hpp::fcl::AABB &aabb, const unsigned int)
Definition: AABB.h:15
hpp::fcl::ConvexBase Base
Definition: convex.h:21
unsigned int num_points
Definition: geometric_shapes.h:624
Definition: broadphase_bruteforce.h:45
Base for convex polytope.
Definition: geometric_shapes.h:581
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
Definition: data_types.h:66
Convex polytope.
Definition: convex.h:50
Vec3f center
center of the convex polytope, this is used for collision: center is guaranteed in the internal of th...
Definition: geometric_shapes.h:659
Vec3f * points
An array of the points of the polygon.
Definition: geometric_shapes.h:623