coal
3.0.4
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
Toggle main menu visibility
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
10
#include "
coal/serialization/fwd.h
"
11
#include "
coal/serialization/OBBRSS.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>
38
struct
HeightFieldAccessor
:
coal::HeightField
<BV> {
39
typedef
coal::HeightField<BV>
Base
;
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
76
COAL_SERIALIZATION_DECLARE_EXPORT
(
::coal::HeightField<::coal::AABB>
)
77
COAL_SERIALIZATION_DECLARE_EXPORT
(::
coal
::HeightField<::
coal
::OBB>)
78
COAL_SERIALIZATION_DECLARE_EXPORT
(::
coal
::HeightField<::
coal
::OBBRSS>)
79
80
#endif
// ifndef COAL_SERIALIZATION_HFIELD_H
coal::HeightField
Data structure depicting a height field given by the base grid dimensions and the elevation along the...
Definition
hfield.h:202
coal::HeightField::max_height
CoalScalar max_height
Definition
hfield.h:351
coal::HeightField::y_grid
VecXs y_grid
Definition
hfield.h:355
coal::HeightField::y_dim
CoalScalar y_dim
Definition
hfield.h:344
coal::HeightField::x_grid
VecXs x_grid
Grids along the X and Y directions. Useful for plotting or other related things.
Definition
hfield.h:355
coal::HeightField::num_bvs
unsigned int num_bvs
Definition
hfield.h:359
coal::HeightField::heights
MatrixXs heights
Elevation values in meters of the Height Field.
Definition
hfield.h:347
coal::HeightField::x_dim
CoalScalar x_dim
Dimensions in meters along X and Y directions.
Definition
hfield.h:344
coal::HeightField::bvs
BVS bvs
Bounding volume hierarchy.
Definition
hfield.h:358
coal::HeightField::min_height
CoalScalar min_height
Minimal height of the Height Field: all values bellow min_height will be discarded.
Definition
hfield.h:351
fwd.h
COAL_SERIALIZATION_DECLARE_EXPORT
#define COAL_SERIALIZATION_DECLARE_EXPORT(T)
Definition
fwd.h:30
hfield.h
boost::serialization
Definition
AABB.h:12
boost::serialization::serialize
void serialize(Archive &ar, coal::AABB &aabb, const unsigned int)
Definition
AABB.h:15
boost
Definition
AABB.h:11
coal
Main namespace.
Definition
broadphase_bruteforce.h:44
OBBRSS.h
boost::serialization::internal::HeightFieldAccessor
Definition
hfield.h:38
boost::serialization::internal::HeightFieldAccessor::Base
coal::HeightField< BV > Base
Definition
hfield.h:39
coal::HFNodeBase
Definition
hfield.h:53
coal::HFNodeBase::y_size
Eigen::DenseIndex y_size
Definition
hfield.h:72
coal::HFNodeBase::x_size
Eigen::DenseIndex x_size
Definition
hfield.h:71
coal::HFNodeBase::contact_active_faces
int contact_active_faces
Definition
hfield.h:75
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
hfield.h:69
coal::HFNodeBase::y_id
Eigen::DenseIndex y_id
Definition
hfield.h:72
coal::HFNodeBase::max_height
CoalScalar max_height
Definition
hfield.h:74
coal::HFNodeBase::x_id
Eigen::DenseIndex x_id
Definition
hfield.h:71
coal::HFNode
Definition
hfield.h:128
coal::HFNode::bv
BV bv
bounding volume storing the geometry
Definition
hfield.h:134
include
coal
serialization
hfield.h
Generated by
1.17.0