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

◆ series_by_role()

MAYAFLUX_API std::vector< std::span< const double > > MayaFlux::Portal::Forma::Plot::series_by_role ( const Kakshya::PlotContainer container,
Kakshya::DataDimension::Role  role 
)

Collect all series from processed_data whose DataDimension role matches role.

Returns spans pointing directly into the DataVariant storage — no copy. Returns an empty vector if no series carry the role or if any matching variant does not hold vector<double>.

Parameters
containerPlotContainer after process_default() has been called.
roleDataDimension::Role to match.

Definition at line 12 of file PlotSpec.cpp.

15{
16 const auto& dims = container.get_structure().dimensions;
17 const auto& data = container.get_processed_data();
18
19 std::vector<std::span<const double>> result;
20 for (size_t i = 0; i < dims.size() && i < data.size(); ++i) {
21 if (dims[i].role != role)
22 continue;
23 const auto* vec = std::get_if<std::vector<double>>(&data[i]);
24 if (!vec || vec->empty())
25 continue;
26 result.emplace_back(vec->data(), vec->size());
27 }
28 return result;
29}
std::vector< DataVariant > & get_processed_data() override
Get a mutable reference to the processed data buffer.
ContainerDataStructure & get_structure() override
Get the data structure defining this container's layout.

References MayaFlux::Kakshya::ContainerDataStructure::dimensions, MayaFlux::Kakshya::PlotContainer::get_processed_data(), and MayaFlux::Kakshya::PlotContainer::get_structure().

+ Here is the call graph for this function: