coal 3.0.1
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
Loading...
Searching...
No Matches
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
12
13namespace boost {
14namespace serialization {
15
16template <class Archive>
17void 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
28template <class Archive, typename BV>
29void 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
36namespace internal {
37template <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
52template <class Archive, typename BV>
53void 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
Data structure depicting a height field given by the base grid dimensions and the elevation along the...
Definition hfield.h:202
VecXs y_grid
Definition hfield.h:355
Scalar max_height
Definition hfield.h:351
VecXs x_grid
Grids along the X and Y directions. Useful for plotting or other related things.
Definition hfield.h:355
unsigned int num_bvs
Definition hfield.h:359
MatrixXs heights
Elevation values in meters of the Height Field.
Definition hfield.h:347
Scalar y_dim
Definition hfield.h:344
Scalar min_height
Minimal height of the Height Field: all values bellow min_height will be discarded.
Definition hfield.h:351
Scalar x_dim
Dimensions in meters along X and Y directions.
Definition hfield.h:344
BVS bvs
Bounding volume hierarchy.
Definition hfield.h:358
#define COAL_SERIALIZATION_DECLARE_EXPORT(T)
Definition fwd.h:30
void serialize(Archive &ar, coal::AABB &aabb, const unsigned int)
Definition AABB.h:15
Definition AABB.h:11
Main namespace.
Definition broadphase_bruteforce.h:44
coal::HeightField< BV > Base
Definition hfield.h:39
Definition hfield.h:53
Eigen::DenseIndex y_size
Definition hfield.h:72
Eigen::DenseIndex x_size
Definition hfield.h:71
int contact_active_faces
Definition hfield.h:75
Scalar max_height
Definition hfield.h:74
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:69
Eigen::DenseIndex y_id
Definition hfield.h:72
Eigen::DenseIndex x_id
Definition hfield.h:71
Definition hfield.h:128
BV bv
bounding volume storing the geometry
Definition hfield.h:134