hpp-fcl: include/hpp/fcl/serialization/BV_splitter.h Source File

hpp-fcl 1.7.7 HPP fork of FCL -- The Flexible Collision Library

BV_splitter.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2021 INRIA
3 //
4
5 #ifndef HPP_FCL_SERIALIZATION_BV_SPLITTER_H
6 #define HPP_FCL_SERIALIZATION_BV_SPLITTER_H
7
8 #include "hpp/fcl/internal/BV_splitter.h"
9
10 #include "hpp/fcl/serialization/fwd.h"
11
12 namespace boost
13 {
14 namespace serialization
15 {
16
17 namespace internal
18 {
19 template <typename BV>
20 struct BVSplitterAccessor : hpp::fcl::BVSplitter<BV>
21 {
22 typedef hpp::fcl::BVSplitter<BV> Base;
23 using Base::split_axis;
24 using Base::split_vector;
25 using Base::split_value;
26 using Base::vertices;
27 using Base::tri_indices;
28 using Base::type;
29 using Base::split_method;
30 };
31 }
32
33 template <class Archive, typename BV>
34 void save(Archive & ar,
35 const hpp::fcl::BVSplitter<BV> & splitter_,
36 const unsigned int /*version*/)
37 {
38 using namespace hpp::fcl;
39 typedef internal::BVSplitterAccessor<BV> Accessor;
40 const Accessor & splitter = reinterpret_cast<const Accessor &>(splitter_);
41
42 ar & make_nvp("split_axis",splitter.split_axis);
43 ar & make_nvp("split_vector",splitter.split_vector);
44 ar & make_nvp("split_value",splitter.split_value);
45 ar & make_nvp("type",splitter.type);
46 ar & make_nvp("split_method",splitter.split_method);
47 }
48
49 template <class Archive, typename BV>
50 void load(Archive & ar,
51 hpp::fcl::BVSplitter<BV> & splitter_,
52 const unsigned int /*version*/)
53 {
54 using namespace hpp::fcl;
55 typedef internal::BVSplitterAccessor<BV> Accessor;
56 Accessor & splitter = reinterpret_cast<Accessor &>(splitter_);
57
58 ar >> make_nvp("split_axis",splitter.split_axis);
59 ar >> make_nvp("split_vector",splitter.split_vector);
60 ar >> make_nvp("split_value",splitter.split_value);
61 ar >> make_nvp("type",splitter.type);
62 ar >> make_nvp("split_method",splitter.split_method);
63
64 splitter.vertices = NULL;
65 splitter.tri_indices = NULL;
66 }
67 }
68 }
69
70 #endif // ifndef HPP_FCL_SERIALIZATION_BV_SPLITTER_H
hpp::fcl::BVSplitter
A class describing the split rule that splits each BV node.
Definition: BV_splitter.h:59
hpp::fcl::BVSplitter::split_vector
Vec3f split_vector
Definition: BV_splitter.h:115
hpp::fcl::BVSplitter::split_method
SplitMethodType split_method
The split algorithm used.
Definition: BV_splitter.h:130
hpp::fcl::BVSplitter::type
BVHModelType type
Whether the geometry is mesh or point cloud.
Definition: BV_splitter.h:127
hpp::fcl::BVSplitter::vertices
Vec3f * vertices
The mesh vertices or points handled by the splitter.
Definition: BV_splitter.h:121
hpp::fcl::BVSplitter::split_axis
int split_axis
The axis based on which the split decision is made. For most BV, the axis is aligned with one of the ...
Definition: BV_splitter.h:114
hpp::fcl::BVSplitter::split_value
FCL_REAL split_value
The split threshold, different primitives are splitted according whether their projection on the spli...
Definition: BV_splitter.h:118
hpp::fcl::BVSplitter::tri_indices
Triangle * tri_indices
The triangles handled by the splitter.
Definition: BV_splitter.h:124
fwd.h
BV_splitter.h
boost::serialization::save
void save(Archive &ar, const hpp::fcl::BVSplitter< BV > &splitter_, const unsigned int)
Definition: BV_splitter.h:34
boost::serialization::load
void load(Archive &ar, hpp::fcl::BVSplitter< BV > &splitter_, const unsigned int)
Definition: BV_splitter.h:50
boost
Definition: AABB.h:12
hpp::fcl
Definition: AABB.h:46
boost::serialization::internal::BVSplitterAccessor
Definition: BV_splitter.h:21
boost::serialization::internal::BVSplitterAccessor::Base
hpp::fcl::BVSplitter< BV > Base
Definition: BV_splitter.h:22