hpp-fcl 1.8.1
HPP fork of FCL -- The Flexible Collision Library
Loading...
Searching...
No Matches
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
9
11
12namespace boost
13{
14 namespace serialization
15 {
16
17 namespace internal
18 {
19 template <typename BV>
21 {
23 using Base::split_axis;
26 using Base::vertices;
28 using Base::type;
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
A class describing the split rule that splits each BV node.
Definition: BV_splitter.h:59
Vec3f split_vector
Definition: BV_splitter.h:115
SplitMethodType split_method
The split algorithm used.
Definition: BV_splitter.h:130
BVHModelType type
Whether the geometry is mesh or point cloud.
Definition: BV_splitter.h:127
Vec3f * vertices
The mesh vertices or points handled by the splitter.
Definition: BV_splitter.h:121
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
FCL_REAL split_value
The split threshold, different primitives are splitted according whether their projection on the spli...
Definition: BV_splitter.h:118
Triangle * tri_indices
The triangles handled by the splitter.
Definition: BV_splitter.h:124
void save(Archive &ar, const hpp::fcl::BVSplitter< BV > &splitter_, const unsigned int)
Definition: BV_splitter.h:34
void load(Archive &ar, hpp::fcl::BVSplitter< BV > &splitter_, const unsigned int)
Definition: BV_splitter.h:50
Definition: AABB.h:12
Definition: AABB.h:46
hpp::fcl::BVSplitter< BV > Base
Definition: BV_splitter.h:22