UFO
1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
contains_void_region.hpp
1
42
#ifndef UFO_MAP_VOID_REGION_PREDICATE_CONTAINS_VOID_REGION_HPP
43
#define UFO_MAP_VOID_REGION_PREDICATE_CONTAINS_VOID_REGION_HPP
44
45
// UFO
46
#include <ufo/container/tree/predicate/filter.hpp>
47
#include <ufo/utility/type_traits.hpp>
48
49
namespace
ufo::pred
50
{
51
template
<
bool
Negated = false>
52
struct
ContainsVoidRegion
{
53
};
54
55
static
constexpr
ContainsVoidRegion
const
contains_void_region;
56
57
template
<
bool
Negated>
58
constexpr
ContainsVoidRegion<!Negated>
operator!(
ContainsVoidRegion<Negated>
)
noexcept
59
{
60
return
ContainsVoidRegion<!Negated>
{};
61
}
62
63
template
<
bool
Negated>
64
struct
Filter
<
ContainsVoidRegion
<Negated>>
65
: FilterBase<ContainsVoidRegion<Negated>, FilterType::INIT, FilterType::VALUE,
66
FilterType::RAY> {
67
using
Pred
=
ContainsVoidRegion<Negated>
;
68
69
template
<
class
Tree>
70
[[nodiscard]]
static
constexpr
bool
returnable(
Pred
const
&,
Tree
const
& t,
71
typename
Tree::Node
const
& n)
72
{
73
if
constexpr
(Negated) {
74
return
!t.voidRegionContains(n.index);
75
}
else
{
76
return
t.voidRegionContains(n.index);
77
}
78
}
79
80
template
<
class
Tree>
81
[[nodiscard]]
static
constexpr
bool
traversable(
Pred
const
&,
Tree
const
& t,
82
typename
Tree::Node
const
& n)
83
{
84
if
constexpr
(Negated) {
85
return
true
;
86
}
else
{
87
return
t.voidRegionContains(n.index);
88
}
89
}
90
};
91
}
// namespace ufo::pred
92
93
#endif
// UFO_MAP_VOID_REGION_PREDICATE_CONTAINS_VOID_REGION_HPP
ufo::Tree
Utilizing curiously recurring template pattern (CRTP)
Definition
tree.hpp:104
ufo::pred
Definition
predicate.hpp:74
ufo::TreeNode
Definition
node.hpp:57
ufo::pred::ContainsVoidRegion
Definition
contains_void_region.hpp:52
ufo::pred::Filter
Definition
filter.hpp:51
lib
map
include
ufo
map
void_region
predicate
contains_void_region.hpp
Generated by
1.9.8