serialization/hfield.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2021 INRIA
3 //
4 
5 #ifndef HPP_FCL_SERIALIZATION_HFIELD_H
6 #define HPP_FCL_SERIALIZATION_HFIELD_H
7 
8 #include "hpp/fcl/hfield.h"
9 
12 
13 namespace boost {
14 namespace serialization {
15 
16 template <class Archive>
17 void serialize(Archive &ar, hpp::fcl::HFNodeBase &node,
18  const unsigned int /*version*/) {
19  ar &make_nvp("first_child", node.first_child);
20  ar &make_nvp("x_id", node.x_id);
21  ar &make_nvp("x_size", node.x_size);
22  ar &make_nvp("y_id", node.y_id);
23  ar &make_nvp("y_size", node.y_size);
24  ar &make_nvp("max_height", node.max_height);
25 }
26 
27 template <class Archive, typename BV>
28 void serialize(Archive &ar, hpp::fcl::HFNode<BV> &node,
29  const unsigned int /*version*/) {
30  ar &make_nvp("base",
31  boost::serialization::base_object<hpp::fcl::HFNodeBase>(node));
32  ar &make_nvp("bv", node.bv);
33 }
34 
35 namespace internal {
36 template <typename BV>
39  using Base::bvs;
40  using Base::heights;
41  using Base::max_height;
42  using Base::min_height;
43  using Base::num_bvs;
44  using Base::x_dim;
45  using Base::x_grid;
46  using Base::y_dim;
47  using Base::y_grid;
48 };
49 } // namespace internal
50 
51 template <class Archive, typename BV>
52 void serialize(Archive &ar, hpp::fcl::HeightField<BV> &hf_model,
53  const unsigned int /*version*/) {
54  ar &make_nvp(
55  "base",
56  boost::serialization::base_object<hpp::fcl::CollisionGeometry>(hf_model));
57 
58  typedef internal::HeightFieldAccessor<BV> Accessor;
59  Accessor &access = reinterpret_cast<Accessor &>(hf_model);
60 
61  ar &make_nvp("x_dim", access.x_dim);
62  ar &make_nvp("y_dim", access.y_dim);
63  ar &make_nvp("heights", access.heights);
64  ar &make_nvp("min_height", access.min_height);
65  ar &make_nvp("max_height", access.max_height);
66  ar &make_nvp("x_grid", access.x_grid);
67  ar &make_nvp("y_grid", access.y_grid);
68 
69  ar &make_nvp("bvs", access.bvs);
70  ar &make_nvp("num_bvs", access.num_bvs);
71 }
72 } // namespace serialization
73 } // namespace boost
74 
75 #endif // ifndef HPP_FCL_SERIALIZATION_HFIELD_H
hpp::fcl::HFNode::bv
BV bv
bounding volume storing the geometry
Definition: hfield.h:109
hpp::fcl::HeightField::max_height
FCL_REAL max_height
Definition: hfield.h:326
hpp::fcl::HFNodeBase::y_size
Eigen::DenseIndex y_size
Definition: hfield.h:61
hpp::fcl::HeightField::y_dim
FCL_REAL y_dim
Definition: hfield.h:319
hfield.h
hpp::fcl::HeightField::x_dim
FCL_REAL x_dim
Dimensions in meters along X and Y directions.
Definition: hfield.h:319
hpp::fcl::HeightField::num_bvs
unsigned int num_bvs
Definition: hfield.h:334
hpp::fcl::HeightField::x_grid
VecXf x_grid
Grids along the X and Y directions. Useful for plotting or other related things.
Definition: hfield.h:330
hpp::fcl::HeightField
Data structure depicting a height field given by the base grid dimensions and the elevation along the...
Definition: hfield.h:182
hpp::fcl::HFNode
Definition: hfield.h:105
fwd.h
boost
hpp::fcl::HFNodeBase::x_id
Eigen::DenseIndex x_id
Definition: hfield.h:60
boost::serialization::internal::HeightFieldAccessor::Base
hpp::fcl::HeightField< BV > Base
Definition: serialization/hfield.h:38
hpp::fcl::HFNodeBase::max_height
FCL_REAL max_height
Definition: hfield.h:63
hpp::fcl::HFNodeBase::x_size
Eigen::DenseIndex x_size
Definition: hfield.h:60
hpp::fcl::HFNodeBase
Definition: hfield.h:53
hpp::fcl::HFNodeBase::first_child
size_t first_child
An index for first child node or primitive If the value is positive, it is the index of the first chi...
Definition: hfield.h:58
hpp::fcl::HFNodeBase::y_id
Eigen::DenseIndex y_id
Definition: hfield.h:61
hpp::fcl::HeightField::heights
MatrixXf heights
Elevation values in meters of the Height Field.
Definition: hfield.h:322
boost::serialization::serialize
void serialize(Archive &ar, hpp::fcl::AABB &aabb, const unsigned int)
Definition: serialization/AABB.h:15
hpp::fcl::HeightField::min_height
FCL_REAL min_height
Minimal height of the Height Field: all values bellow min_height will be discarded.
Definition: hfield.h:326
hpp::fcl::HeightField::bvs
BVS bvs
Bounding volume hierarchy.
Definition: hfield.h:333
OBBRSS.h
boost::serialization::internal::HeightFieldAccessor
Definition: serialization/hfield.h:37
hpp::fcl::HeightField::y_grid
VecXf y_grid
Definition: hfield.h:330


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