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

◆ place()

MAYAFLUX_API Mapped< std::shared_ptr< Kakshya::PlotContainer > > MayaFlux::Portal::Forma::Plot::place ( Surface surface,
std::shared_ptr< Buffers::FormaBuffer buf,
SeriesSpec  spec,
std::shared_ptr< Kakshya::PlotContainer container 
)

Place a plot element onto a Surface using a pre-built FormaBuffer.

Constructs a Mapped<shared_ptr<PlotContainer>> from the geometry function carried by spec, registers the element on surface's layer, and runs one initial sync so the first frame has valid geometry. Sets force_redraw_on_sync so geometry regenerates on every sync() call the container pointer is stable across frames but its data changes each frame.

Buffer construction and scheduling are the caller's responsibility. Use Portal::Forma::create_buffer(surface.window(), spec.capacity_for(N), spec.topology) to build the buffer, and schedule_metro to drive sync() at the desired rate.

Parameters
surfaceSurface to register the element on.
bufPre-built, registered FormaBuffer sized for this encoding. Use spec.capacity_for(N) and spec.topology to construct it.
specResult of a SeriesBuilder terminal. Carries the geometry function, topology, and capacity arithmetic for this encoding. Raw GeometryFn callers are responsible for calling container->process_default() inside their function; SeriesBuilder terminals call it internally.
containerPlotContainer with series bound and marked ready for processing. Becomes the initial MappedState value.
Returns
Fully constructed Mapped with element registered on the surface layer. Call sync() each frame to drive geometry updates.

Definition at line 81 of file Plot.cpp.

86{
87 auto mapped = make_mapped<std::shared_ptr<Kakshya::PlotContainer>>(
88 std::move(container), std::move(spec.fn), std::move(buf));
89
90 mapped.element.id = surface.layer().add(mapped.element);
91 mapped.state->id = mapped.element.id;
92 mapped.force_redraw_on_sync = true;
93 mapped.sync();
94
95 return mapped;
96}
uint32_t id() const noexcept
Explicit id accessor, for clarity in chained expressions.
Definition Layer.hpp:70
Slot add(Element element)
Add an element to the layer.
Definition Layer.cpp:9
Layer & layer() noexcept
Access the spatial registry.
Definition Surface.hpp:107
Forma::GeometryFn< std::shared_ptr< Kakshya::PlotContainer > > fn

References MayaFlux::Portal::Forma::Layer::add(), MayaFlux::Portal::Forma::Mapped< T >::element, MayaFlux::Portal::Forma::Plot::SeriesSpec::fn, MayaFlux::Portal::Forma::Element::id, MayaFlux::Portal::Forma::Layer::Slot::id(), and MayaFlux::Portal::Forma::Surface::layer().

Referenced by MayaFlux::Portal::Forma::plot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: