UFO
1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
has_color.hpp
1
42
#ifndef UFO_MAP_COLOR_PREDICATE_HAS_COLOR_HPP
43
#define UFO_MAP_COLOR_PREDICATE_HAS_COLOR_HPP
44
45
// UFO
46
#include <ufo/map/color/color.hpp>
47
#include <ufo/map/predicate/predicate.hpp>
48
#include <ufo/map/types.hpp>
49
50
namespace
ufo::pred
51
{
52
template
<
bool
Negated = false>
53
struct
HasColor
{
54
};
55
56
template
<
bool
Negated>
57
HasColor<!Negated>
operator!(
HasColor<Negated>
)
58
{
59
return
{};
60
}
61
62
template
<
bool
Negated>
63
struct
InnerCheck<
HasColor
<Negated>> {
64
using
Pred
=
HasColor<Negated>
;
65
66
template
<
class
Map,
class
Node>
67
static
constexpr
bool
apply(
Pred
p,
Map
const
& m, Node
const
& n)
68
{
69
if
constexpr
(Negated) {
70
return
true
;
71
}
else
{
72
return
ColorBlendingMode::NONE == m.colorPropagationBlendingMode() ||
73
!m.colorEmpty(n.index());
74
}
75
}
76
};
77
78
template
<
bool
Negated>
79
struct
ValueCheck<
HasColor
<Negated>> {
80
using
Pred
=
HasColor<Negated>
;
81
82
template
<
class
Map,
class
Node>
83
static
constexpr
bool
apply(
Pred
,
Map
const
& m, Node n)
84
{
85
if
constexpr
(Negated) {
86
return
m.colorEmpty(n.index());
87
}
else
{
88
return
!m.colorEmpty(n.index());
89
}
90
}
91
};
92
}
// namespace ufo::pred
93
94
#endif
// UFO_MAP_COLOR_PREDICATE_HAS_COLOR_HPP
ufo::Map
Definition
map.hpp:100
ufo::pred
Definition
predicate.hpp:74
ufo::pred::HasColor
Definition
has_color.hpp:53
lib
map
include
ufo
map
color
predicate
has_color.hpp
Generated by
1.9.8