coal/serialization/hfield.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2021-2024 INRIA
3 //
4 
5 #ifndef COAL_SERIALIZATION_HFIELD_H
6 #define COAL_SERIALIZATION_HFIELD_H
7 
8 #include "coal/hfield.h"
9 
10 #include "coal/serialization/fwd.h"
12 
13 namespace boost {
14 namespace serialization {
15 
16 template <class Archive>
17 void serialize(Archive &ar, coal::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  ar &make_nvp("contact_active_faces", node.contact_active_faces);
26 }
27 
28 template <class Archive, typename BV>
29 void serialize(Archive &ar, coal::HFNode<BV> &node,
30  const unsigned int /*version*/) {
31  ar &make_nvp("base",
32  boost::serialization::base_object<coal::HFNodeBase>(node));
33  ar &make_nvp("bv", node.bv);
34 }
35 
36 namespace internal {
37 template <typename BV>
40  using Base::bvs;
41  using Base::heights;
42  using Base::max_height;
43  using Base::min_height;
44  using Base::num_bvs;
45  using Base::x_dim;
46  using Base::x_grid;
47  using Base::y_dim;
48  using Base::y_grid;
49 };
50 } // namespace internal
51 
52 template <class Archive, typename BV>
53 void serialize(Archive &ar, coal::HeightField<BV> &hf_model,
54  const unsigned int /*version*/) {
55  ar &make_nvp(
56  "base",
57  boost::serialization::base_object<coal::CollisionGeometry>(hf_model));
58 
59  typedef internal::HeightFieldAccessor<BV> Accessor;
60  Accessor &access = reinterpret_cast<Accessor &>(hf_model);
61 
62  ar &make_nvp("x_dim", access.x_dim);
63  ar &make_nvp("y_dim", access.y_dim);
64  ar &make_nvp("heights", access.heights);
65  ar &make_nvp("min_height", access.min_height);
66  ar &make_nvp("max_height", access.max_height);
67  ar &make_nvp("x_grid", access.x_grid);
68  ar &make_nvp("y_grid", access.y_grid);
69 
70  ar &make_nvp("bvs", access.bvs);
71  ar &make_nvp("num_bvs", access.num_bvs);
72 }
73 } // namespace serialization
74 } // namespace boost
75 
79 
80 #endif // ifndef COAL_SERIALIZATION_HFIELD_H
fwd.h
coal::HFNodeBase
Definition: coal/hfield.h:53
coal::HFNodeBase::y_id
Eigen::DenseIndex y_id
Definition: coal/hfield.h:72
boost::serialization::serialize
void serialize(Archive &ar, coal::AABB &aabb, const unsigned int)
Definition: coal/serialization/AABB.h:15
boost
coal::HeightField::y_dim
CoalScalar y_dim
Definition: coal/hfield.h:344
COAL_SERIALIZATION_DECLARE_EXPORT
#define COAL_SERIALIZATION_DECLARE_EXPORT(T)
Definition: coal/serialization/fwd.h:30
coal::HFNodeBase::x_id
Eigen::DenseIndex x_id
Definition: coal/hfield.h:71
boost::serialization::internal::HeightFieldAccessor::Base
coal::HeightField< BV > Base
Definition: coal/serialization/hfield.h:39
coal::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: coal/hfield.h:69
coal::HeightField::bvs
BVS bvs
Bounding volume hierarchy.
Definition: coal/hfield.h:358
coal::HFNodeBase::max_height
CoalScalar max_height
Definition: coal/hfield.h:74
coal::HeightField
Data structure depicting a height field given by the base grid dimensions and the elevation along the...
Definition: coal/hfield.h:202
coal::HeightField::x_dim
CoalScalar x_dim
Dimensions in meters along X and Y directions.
Definition: coal/hfield.h:344
coal::HFNode::bv
BV bv
bounding volume storing the geometry
Definition: coal/hfield.h:134
hfield.h
coal::HeightField::y_grid
VecXs y_grid
Definition: coal/hfield.h:355
coal::HFNodeBase::x_size
Eigen::DenseIndex x_size
Definition: coal/hfield.h:71
coal::HFNodeBase::y_size
Eigen::DenseIndex y_size
Definition: coal/hfield.h:72
coal::HFNodeBase::contact_active_faces
int contact_active_faces
Definition: coal/hfield.h:75
coal::HeightField::heights
MatrixXs heights
Elevation values in meters of the Height Field.
Definition: coal/hfield.h:347
OBBRSS.h
coal::HFNode
Definition: coal/hfield.h:128
coal::HeightField::x_grid
VecXs x_grid
Grids along the X and Y directions. Useful for plotting or other related things.
Definition: coal/hfield.h:355
coal::HeightField::max_height
CoalScalar max_height
Definition: coal/hfield.h:351
coal::HeightField::num_bvs
unsigned int num_bvs
Definition: coal/hfield.h:359
boost::serialization::internal::HeightFieldAccessor
Definition: coal/serialization/hfield.h:38
coal::HeightField::min_height
CoalScalar min_height
Minimal height of the Height Field: all values bellow min_height will be discarded.
Definition: coal/hfield.h:351


hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:58