6#include "../archetype_utils.hpp"
7#include "../collection.hpp"
8#include "../component_batch.hpp"
9#include "../component_column.hpp"
10#include "../components/color.hpp"
11#include "../components/text.hpp"
12#include "../components/visible.hpp"
13#include "../result.hpp"
71 std::optional<ComponentBatch>
values;
77 std::optional<ComponentBatch>
labels;
83 std::optional<ComponentBatch>
colors;
93 static constexpr const char ArchetypeName[] =
"rerun.archetypes.StateConfiguration";
137 return std::move(*
this);
146 return std::move(*
this);
155 return std::move(*
this);
164 return std::move(*
this);
194 template <
typename T>
199 struct AsComponents<archetypes::StateConfiguration> {
201 static Result<Collection<ComponentBatch>> as_batches(
202 const archetypes::StateConfiguration& archetype
204 return detail::collect_batches(
205 {&archetype.values, &archetype.labels, &archetype.colors, &archetype.visible}
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:90
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: Define the style and mapping for state values in a state timeline view.
Definition state_configuration.hpp:66
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition state_configuration.hpp:93
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition state_configuration.hpp:184
StateConfiguration with_colors(const Collection< rerun::components::Color > &_colors) &&
Colors for each state value.
Definition state_configuration.hpp:153
StateConfiguration with_values(const Collection< rerun::components::Text > &_values) &&
The raw state values that this configuration applies to.
Definition state_configuration.hpp:135
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition state_configuration.hpp:175
StateConfiguration with_visible(const Collection< rerun::components::Visible > &_visible) &&
Visibility for each state value.
Definition state_configuration.hpp:162
static StateConfiguration clear_fields()
Clear all the fields of a StateConfiguration.
std::optional< ComponentBatch > values
The raw state values that this configuration applies to.
Definition state_configuration.hpp:71
std::optional< ComponentBatch > colors
Colors for each state value.
Definition state_configuration.hpp:83
static constexpr auto Descriptor_values
ComponentDescriptor for the values field.
Definition state_configuration.hpp:96
static constexpr auto Descriptor_colors
ComponentDescriptor for the colors field.
Definition state_configuration.hpp:106
StateConfiguration with_labels(const Collection< rerun::components::Text > &_labels) &&
Display labels for each state value.
Definition state_configuration.hpp:144
static StateConfiguration update_fields()
Update only some specific fields of a StateConfiguration.
Definition state_configuration.hpp:124
std::optional< ComponentBatch > visible
Visibility for each state value.
Definition state_configuration.hpp:89
static constexpr auto Descriptor_visible
ComponentDescriptor for the visible field.
Definition state_configuration.hpp:111
static constexpr auto Descriptor_labels
ComponentDescriptor for the labels field.
Definition state_configuration.hpp:101
std::optional< ComponentBatch > labels
Display labels for each state value.
Definition state_configuration.hpp:77