MayaFlux 1.0.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,
FormaTarget  buf,
SeriesSpec  spec,
std::shared_ptr< Kakshya::PlotContainer >  container 
)

Place a plot element onto a Surface using a FormaTarget.

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 when the container pointer is stable but its data changes.

Buffer construction and scheduling are the caller's responsibility. Create a batch with surface.render_config(), then pass a slice with spec.topology. Other plot geometry can use slices of that batch.

Parameters
surfaceSurface to register the element on.
bufTarget the series draws into, a slice of spec.topology.
specResult of a SeriesBuilder terminal. Carries the geometry function and input topology 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 96 of file Plot.cpp.

101{
102 auto mapped = make_mapped<std::shared_ptr<Kakshya::PlotContainer>>(
103 std::move(container), std::move(spec.fn), std::move(buf));
104
105 mapped.element.id = surface.layer().add(mapped.element);
106 mapped.state->id = mapped.element.id;
107 mapped.force_redraw_on_sync = true;
108 mapped.sync(&surface.layer());
109
110 return mapped;
111}
uint32_t id() const noexcept
Explicit id accessor, for clarity in chained expressions.
Definition Layer.hpp:73
Slot add(Element element)
Add an element to the layer.
Definition Layer.cpp:9
Layer & layer() noexcept
Access the spatial registry.
Definition Surface.hpp:159
Forma::GeometryFn< std::shared_ptr< Kakshya::PlotContainer > > fn

References MayaFlux::Portal::Forma::Layer::add(), MayaFlux::Portal::Forma::Plot::SeriesSpec::fn, 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: