6#include "../archetype_utils.hpp"
7#include "../collection.hpp"
8#include "../component_batch.hpp"
9#include "../component_column.hpp"
10#include "../components/aggregation_policy.hpp"
11#include "../components/color.hpp"
12#include "../components/interpolation_mode.hpp"
13#include "../components/name.hpp"
14#include "../components/scalar.hpp"
15#include "../components/stroke_width.hpp"
16#include "../components/unit.hpp"
17#include "../components/variance.hpp"
18#include "../components/visible.hpp"
19#include "../result.hpp"
84 std::optional<ComponentBatch>
values;
95 std::optional<ComponentBatch>
units;
110 std::optional<ComponentBatch>
names;
139 static constexpr const char ArchetypeName[] =
"rerun.archetypes.Measurements";
192 .value_or_throw()) {}
205 return std::move(*
this);
214 return std::move(*
this);
223 return std::move(*
this);
231 return std::move(*
this);
239 return std::move(*
this);
247 return std::move(*
this);
263 return std::move(*
this);
279 return std::move(*
this);
292 return std::move(*
this);
306 return std::move(*
this);
319 return std::move(*
this);
331 return detail::partition_batches(
351 return detail::partition_batches_of_unit_length({&
values,
368 template <
typename T>
373 struct AsComponents<archetypes::Measurements> {
375 static Result<Collection<ComponentBatch>> as_batches(
376 const archetypes::Measurements& archetype
378 return detail::collect_batches(
380 &archetype.variances,
385 &archetype.visible_series,
386 &archetype.aggregation_policy,
387 &archetype.interpolation_mode}
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
AggregationPolicy
Component: Policy for aggregation of multiple scalar plot values.
Definition aggregation_policy.hpp:28
InterpolationMode
Component: Specifies how values between data points are interpolated in time series.
Definition interpolation_mode.hpp:24
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26
Arrow-encoded data of a single batch of components together with a component descriptor.
Definition component_batch.hpp:28
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: One or more scalar measurements, each with a variance and a unit.
Definition measurements.hpp:82
static constexpr auto Descriptor_units
ComponentDescriptor for the units field.
Definition measurements.hpp:151
static Measurements clear_fields()
Clear all the fields of a Measurements.
static constexpr auto Descriptor_names
ComponentDescriptor for the names field.
Definition measurements.hpp:164
std::optional< ComponentBatch > widths
Stroke width for the corresponding series.
Definition measurements.hpp:105
std::optional< ComponentBatch > units
Units of the measurements, shown in the legend and in tooltips.
Definition measurements.hpp:95
Measurements with_colors(const Collection< rerun::components::Color > &_colors) &&
Color for the corresponding series.
Definition measurements.hpp:229
static constexpr auto Descriptor_variances
ComponentDescriptor for the variances field.
Definition measurements.hpp:146
std::optional< ComponentBatch > variances
Variances of the measurements (σ², in the units of values squared).
Definition measurements.hpp:89
std::optional< ComponentBatch > colors
Color for the corresponding series.
Definition measurements.hpp:100
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition measurements.hpp:330
std::optional< ComponentBatch > aggregation_policy
Configures the zoom-dependent scalar aggregation.
Definition measurements.hpp:128
std::optional< ComponentBatch > visible_series
Which series are visible.
Definition measurements.hpp:119
Measurements with_interpolation_mode(const rerun::components::InterpolationMode &_interpolation_mode) &&
Specifies how values between data points are interpolated.
Definition measurements.hpp:300
static constexpr auto Descriptor_interpolation_mode
ComponentDescriptor for the interpolation_mode field.
Definition measurements.hpp:178
Measurements with_variances(const Collection< rerun::components::Variance > &_variances) &&
Variances of the measurements (σ², in the units of values squared).
Definition measurements.hpp:211
static Measurements update_fields()
Update only some specific fields of a Measurements.
Definition measurements.hpp:195
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition measurements.hpp:139
static constexpr auto Descriptor_colors
ComponentDescriptor for the colors field.
Definition measurements.hpp:155
Measurements with_aggregation_policy(const rerun::components::AggregationPolicy &_aggregation_policy) &&
Configures the zoom-dependent scalar aggregation.
Definition measurements.hpp:273
std::optional< ComponentBatch > values
The measured scalar values.
Definition measurements.hpp:84
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition measurements.hpp:350
Measurements with_widths(const Collection< rerun::components::StrokeWidth > &_widths) &&
Stroke width for the corresponding series.
Definition measurements.hpp:237
static constexpr auto Descriptor_values
ComponentDescriptor for the values field.
Definition measurements.hpp:142
Measurements with_many_interpolation_mode(const Collection< rerun::components::InterpolationMode > &_interpolation_mode) &&
This method makes it possible to pack multiple interpolation_mode in a single component batch.
Definition measurements.hpp:313
Measurements with_names(const Collection< rerun::components::Name > &_names) &&
Display name of the series.
Definition measurements.hpp:245
Measurements with_units(const Collection< rerun::components::Unit > &_units) &&
Units of the measurements, shown in the legend and in tooltips.
Definition measurements.hpp:221
static constexpr auto Descriptor_aggregation_policy
ComponentDescriptor for the aggregation_policy field.
Definition measurements.hpp:173
Measurements with_many_aggregation_policy(const Collection< rerun::components::AggregationPolicy > &_aggregation_policy) &&
This method makes it possible to pack multiple aggregation_policy in a single component batch.
Definition measurements.hpp:286
Measurements with_visible_series(const Collection< rerun::components::Visible > &_visible_series) &&
Which series are visible.
Definition measurements.hpp:257
static constexpr auto Descriptor_visible_series
ComponentDescriptor for the visible_series field.
Definition measurements.hpp:168
static constexpr auto Descriptor_widths
ComponentDescriptor for the widths field.
Definition measurements.hpp:159
std::optional< ComponentBatch > names
Display name of the series.
Definition measurements.hpp:110
Measurements with_values(const Collection< rerun::components::Scalar > &_values) &&
The measured scalar values.
Definition measurements.hpp:203
std::optional< ComponentBatch > interpolation_mode
Specifies how values between data points are interpolated.
Definition measurements.hpp:135