6#include "../../archetype_utils.hpp"
7#include "../../blueprint/components/corner2d.hpp"
8#include "../../collection.hpp"
9#include "../../component_batch.hpp"
10#include "../../component_column.hpp"
11#include "../../components/visible.hpp"
12#include "../../result.hpp"
19namespace rerun::blueprint::archetypes {
28 std::optional<ComponentBatch>
corner;
37 static constexpr const char ArchetypeName[] =
"rerun.blueprint.archetypes.PlotLegend";
69 return std::move(*
this);
77 return std::move(*
this);
89 return detail::partition_batches({&
corner, &
visible}, lengths_).value_or_throw();
97 return detail::partition_batches_of_unit_length({&
corner, &
visible}).value_or_throw();
105 template <
typename T>
110 struct AsComponents<blueprint::archetypes::PlotLegend> {
115 return detail::collect_batches({&archetype.
corner, &archetype.
visible});
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
A class for representing either a usable value, or an error.
Definition result.hpp:14
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26
static Result< ComponentBatch > from_loggable(const rerun::Collection< T > &components, const ComponentDescriptor &descriptor)
Creates a new component batch from a collection of component instances.
Definition component_batch.hpp:46
A ComponentDescriptor fully describes the semantics of a column of data.
Definition component_descriptor.hpp:16
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Archetype: Configuration for the legend of a plot.
Definition plot_legend.hpp:24
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition plot_legend.hpp:37
static PlotLegend update_fields()
Update only some specific fields of a PlotLegend.
Definition plot_legend.hpp:57
PlotLegend with_visible(const rerun::components::Visible &_visible) &&
Whether the legend is shown at all.
Definition plot_legend.hpp:75
static constexpr auto Descriptor_visible
ComponentDescriptor for the visible field.
Definition plot_legend.hpp:45
std::optional< ComponentBatch > corner
To what corner the legend is aligned.
Definition plot_legend.hpp:28
std::optional< ComponentBatch > visible
Whether the legend is shown at all.
Definition plot_legend.hpp:33
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition plot_legend.hpp:88
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition plot_legend.hpp:96
static constexpr auto Descriptor_corner
ComponentDescriptor for the corner field.
Definition plot_legend.hpp:40
static PlotLegend clear_fields()
Clear all the fields of a PlotLegend.
PlotLegend with_corner(const rerun::blueprint::components::Corner2D &_corner) &&
To what corner the legend is aligned.
Definition plot_legend.hpp:67
Component: Whether the container, view, entity or instance is currently visible.
Definition visible.hpp:14