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

◆ apply_hit()

template<typename T>
void MayaFlux::Portal::Forma::apply_hit ( Geometry::Form< T > & form,
const ElementHit & hit )

Write a document's spatial fields after a form's own.

A form's geometry function writes bounds_hint and contains on every draw, so the document's are applied after it, as Forma::geometry_with_containment does for a form's own.

Definition at line 43 of file ElementHit.hpp.

44{
45 if (!hit.bounds && !hit.contains)
46 return;
47 form.geometry = [inner = std::move(form.geometry), hit](T value, std::vector<uint8_t>& out, Element& element) {
48 inner(std::move(value), out, element);
49 if (hit.bounds)
50 element.bounds_hint = hit.bounds;
51 if (hit.contains)
52 element.contains = hit.contains;
53 };
54}
std::optional< Kinesis::AABB2D > bounds
std::function< bool(glm::vec2)> contains
A bounded, renderable region on a window surface.
Definition Element.hpp:62
GeometryFn< T > geometry
Writes vertex bytes for the current value.
Definition Geometry.hpp:85

References MayaFlux::Portal::Forma::ElementHit::bounds, MayaFlux::Portal::Forma::ElementHit::contains, and MayaFlux::Portal::Forma::Geometry::Form< T >::geometry.

Referenced by MayaFlux::Portal::Forma::Detail::DocumentWalk< Source, Access >::vertex_placer().

Here is the caller graph for this function: