|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
A bounded, renderable region on a window surface. More...
#include <Element.hpp>
Collaboration diagram for MayaFlux::Portal::Forma::Element:Public Member Functions | |
| Element & | hidden () |
| Start hidden. | |
| Element & | non_interactive () |
| Exclude from hit testing. | |
| void | set_text (std::string_view text, std::optional< Portal::Text::PressParams > params) |
Re-composite text into the retained GPU texture. | |
| Element & | with_bounds (Kinesis::AABB2D b) |
| Set the fast-reject AABB. | |
| Element & | with_buffer (std::shared_ptr< Buffers::FormaBuffer > buf) |
| Attach a FormaBuffer as the rendered output for this region. | |
| Element & | with_circle (glm::vec2 center, float radius) |
| Set a circular containment predicate. | |
| Element & | with_contains (std::function< bool(glm::vec2)> fn) |
| Set an explicit containment predicate. | |
| Element & | with_name (std::string n) |
| Set the human-readable name used in Lila introspection and debug output. | |
| Element & | with_polygon (std::span< const glm::vec2 > verts) |
| Set a polygon containment predicate. | |
| Element & | with_rect (glm::vec2 ndc_min, glm::vec2 ndc_max) |
| Convenience: rectangular region specified as two NDC corners. | |
| Element & | with_stroke (std::span< const glm::vec2 > pts, float half_thickness) |
| Set a stroke-based containment predicate. | |
| Element & | with_text (std::string_view text, std::optional< Portal::Text::PressParams > params, Kinesis::AABB2D region={ .min=glm::vec2(-1.F),.max=glm::vec2(1.F) }) |
Press text into a new GPU texture and bind it to the attached FormaBuffer. | |
| Element & | with_texture (const std::shared_ptr< Buffers::TextureBuffer > &buf, Kinesis::AABB2D region={ .min=glm::vec2(-1.F),.max=glm::vec2(1.F) }) |
| Convenience overload extracting the GPU texture from a TextureBuffer (or TextBuffer, which inherits it). | |
| Element & | with_texture (const std::shared_ptr< Core::VKImage > &image, Kinesis::AABB2D region={ .min=glm::vec2(-1.F),.max=glm::vec2(1.F) }) |
Submit a UV quad covering region and bind image as "texSampler" on the attached FormaBuffer. | |
Public Attributes | |
| std::optional< Kinesis::AABB2D > | bounds_hint |
| Optional fast-reject bounds in NDC space. | |
| std::shared_ptr< Buffers::FormaBuffer > | buffer |
| Buffer whose rendered output occupies this region. | |
| std::function< bool(glm::vec2)> | contains |
| Authoritative containment test in NDC space. | |
| uint32_t | id { 0 } |
| Stable id assigned by Layer::add. Never zero. | |
| bool | interactive { true } |
| When false, hit testing skips this element. | |
| std::string | name |
| Optional human-readable label for Lila introspection and debug logging. | |
| std::shared_ptr< Core::VKImage > | texture |
| Optional GPU texture to bind to the attached buffer. Used for. | |
| bool | visible { true } |
| When false, the element is excluded from Layer iteration. | |
A bounded, renderable region on a window surface.
An Element pairs a spatial description with a GPU buffer whose output occupies that region. The spatial description is deliberately open:
bounds_hint: optional AABB2D in NDC space, used as a fast-reject pre-filter before contains is evaluated. Not required.contains: authoritative point-in-element test. If absent and bounds_hint is set, bounds_hint::contains is used directly. If both are absent the element never hits. For a rectangle, set only bounds_hint. For a circle, arbitrary polygon, or curve region, set contains (and optionally bounds_hint as the circumscribed rect for performance).buffer is optional. An Element with no buffer is a pure spatial registration: it participates in hit testing and relation cascades but contributes no rendered output. A voice node with a spatial position, a named region driving a compute shader, an invisible trigger zone; all are valid Elements with no buffer.
Fluent setters return Element& for chained construction:
Layer::add() assigns the stable id. All setters that affect spatial or visibility state can also be applied post-registration via Layer::Slot.
Definition at line 58 of file Element.hpp.