MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ test()

template<typename Point, typename Box>
bool MayaFlux::Kinesis::HitRegion< Point, Box >::test ( const std::optional< Box > & clip,
const std::optional< Box > & bounds,
const std::function< bool(Point)> & contains,
Point p )
inlinestaticnodiscard

hits() over three parts held elsewhere, without copying them.

For owners that keep the clip, bounds and containment test as separate fields and cannot build a HitRegion per query.

Definition at line 57 of file HitRegion.hpp.

59 {
60 if (clip && !clip->contains(p))
61 return false;
62 if (bounds && !bounds->contains(p))
63 return false;
64 if (contains)
65 return contains(p);
66 return bounds.has_value();
67 }
std::function< bool(Point)> contains
Authoritative containment test.
Definition HitRegion.hpp:40
std::optional< Box > clip
Region outside which nothing hits, regardless of the other parts.
Definition HitRegion.hpp:43
std::optional< Box > bounds
Fast reject box; must circumscribe contains when both are set.
Definition HitRegion.hpp:37
A region a point can hit: fast reject bounds, an authoritative containment test, and an optional clip...
Definition HitRegion.hpp:35

Referenced by MayaFlux::Kinesis::HitRegion< double, AABB1D >::hits().

Here is the caller graph for this function: