42#ifndef UFO_CONTAINER_TREE_PREDICATE_COORD_HPP
43#define UFO_CONTAINER_TREE_PREDICATE_COORD_HPP
46#include <ufo/container/tree/predicate/filter.hpp>
47#include <ufo/container/tree/predicate/predicate_interval.hpp>
53template <std::
size_t Axis>
55 using value_type = float;
59template <std::
size_t Axis,
bool Negated = false>
62template <
bool Negated = false>
65template <
bool Negated = false>
68template <
bool Negated = false>
71template <
bool Negated = false>
74static constexpr inline X<false> const x;
75static constexpr inline Y<false> const y;
76static constexpr inline Z<false> const z;
77static constexpr inline W<false> const w;
79template <std::
size_t Axis,
bool Negated>
84 static constexpr void init(
Pred&,
Tree const&)
noexcept
88 template <
class Value>
89 [[nodiscard]]
static constexpr bool returnableValue(
Pred const&, Value
const&)
noexcept
95 [[nodiscard]]
static constexpr bool returnable(
Pred const& p,
Tree const& t,
101 if constexpr (Negated) {
103 return p.min > c + hl || p.max < c - hl;
106 return p.min <= c + hl && p.max >= c - hl;
110 template <
class Tree>
111 [[nodiscard]]
static constexpr bool traversable(
Pred const& p,
Tree const& t,
117 if constexpr (Negated) {
119 return !(p.min <= c - hl && p.max >= c + hl);
122 return p.min <= c + hl && p.max >= c - hl;
126 template <
class Tree>
127 [[nodiscard]]
static constexpr bool returnableRay(
Pred const& p,
Tree const& t,
131 return returnable(p, t, n);
134 template <
class Tree>
135 [[nodiscard]]
static constexpr bool traversableRay(
Pred const& p,
Tree const& t,
139 return traversable(p, t, n);
Utilizing curiously recurring template pattern (CRTP)
Length halfLength() const
Returns the half length of the tree (/ root node), i.e. length() / 2.
coord_type centerAxis(std::size_t axis) const
Returns the center of the tree (/ root node) for the axis specified.