42#ifndef UFO_CONTAINER_TREE_PREDICATE_INSIDE_HPP
43#define UFO_CONTAINER_TREE_PREDICATE_INSIDE_HPP
46#include <ufo/container/tree/predicate/filter.hpp>
47#include <ufo/container/tree/predicate/spatial.hpp>
48#include <ufo/geometry/inside.hpp>
49#include <ufo/geometry/intersects.hpp>
56template <
class Geometry,
bool Negated = false>
61template <
class Geometry,
bool Negated>
68template <
class Geometry,
bool Negated>
73 static constexpr void init(
Pred&,
Tree const&)
noexcept
77 template <
class Value>
78 [[nodiscard]]
static constexpr bool returnableValue(
Pred const& p,
79 Value
const& v)
noexcept
81 if constexpr (Negated) {
82 if constexpr (is_pair_v<std::remove_cvref_t<Value>>) {
83 return !
inside(v.first, p.geometry);
85 return !
inside(v, p.geometry);
88 if constexpr (is_pair_v<std::remove_cvref_t<Value>>) {
89 return inside(v.first, p.geometry);
91 return inside(v, p.geometry);
97 [[nodiscard]]
static constexpr bool returnable(
Pred const& p,
Tree const& t,
100 if constexpr (Negated) {
107 template <
class Tree>
108 [[nodiscard]]
static constexpr bool traversable(
Pred const& p,
Tree const& t,
111 if constexpr (Negated) {
118 template <
class Tree>
119 [[nodiscard]]
static constexpr bool returnableRay(
Pred const& p,
Tree const& t,
123 return returnable(p, t, n);
126 template <
class Tree>
127 [[nodiscard]]
static constexpr bool traversableRay(
Pred const& p,
Tree const& t,
131 return traversable(p, t, n);
137template <
class Geometry,
bool Negated>
Utilizing curiously recurring template pattern (CRTP)
Bounds bounds() const
Returns the bounds of the tree (/ root node).
constexpr bool inside(A const &a, B const &b)
Checks if a shape is inside another shape.
constexpr bool intersects(A const &a, B const &b)
Checks if two shapes intersect.