Rerun C++ SDK
Loading...
Searching...
No Matches
raw_data_view_format.hpp
1// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/build/re_type_definitions/rerun/blueprint/archetypes/raw_data_view_format.def.rs".
3
4#pragma once
5
6#include "../../archetype_utils.hpp"
7#include "../../blueprint/components/view_density.hpp"
8#include "../../collection.hpp"
9#include "../../component_batch.hpp"
10#include "../../component_column.hpp"
11#include "../../components/visible.hpp"
12#include "../../result.hpp"
13
14#include <cstdint>
15#include <optional>
16#include <utility>
17#include <vector>
18
19namespace rerun::blueprint::archetypes {
20 /// **Archetype**: Formatting options for a raw data view.
21 ///
22 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
23 ///
25 /// Show the bar carrying the time cursor and the step-to-next-event buttons.
26 ///
27 /// Defaults to true.
28 std::optional<ComponentBatch> show_time_navigation;
29
30 /// How densely the rows are packed.
31 ///
32 /// Defaults to spacious.
33 std::optional<ComponentBatch> style;
34
35 public:
36 /// The name of the archetype as used in `ComponentDescriptor`s.
37 static constexpr const char ArchetypeName[] =
38 "rerun.blueprint.archetypes.RawDataViewFormat";
39
40 /// `ComponentDescriptor` for the `show_time_navigation` field.
42 ArchetypeName, "RawDataViewFormat:show_time_navigation",
44 );
45 /// `ComponentDescriptor` for the `style` field.
46 static constexpr auto Descriptor_style = ComponentDescriptor(
47 ArchetypeName, "RawDataViewFormat:style",
49 );
50
51 public:
52 RawDataViewFormat() = default;
53 RawDataViewFormat(RawDataViewFormat&& other) = default;
54 RawDataViewFormat(const RawDataViewFormat& other) = default;
55 RawDataViewFormat& operator=(const RawDataViewFormat& other) = default;
56 RawDataViewFormat& operator=(RawDataViewFormat&& other) = default;
57
58 /// Update only some specific fields of a `RawDataViewFormat`.
60 return RawDataViewFormat();
61 }
62
63 /// Clear all the fields of a `RawDataViewFormat`.
65
66 /// Show the bar carrying the time cursor and the step-to-next-event buttons.
67 ///
68 /// Defaults to true.
70 const rerun::components::Visible& _show_time_navigation
71 ) && {
73 _show_time_navigation,
75 )
76 .value_or_throw();
77 return std::move(*this);
78 }
79
80 /// How densely the rows are packed.
81 ///
82 /// Defaults to spacious.
83 RawDataViewFormat with_style(const rerun::blueprint::components::ViewDensity& _style) && {
84 style = ComponentBatch::from_loggable(_style, Descriptor_style).value_or_throw();
85 return std::move(*this);
86 }
87
88 /// Partitions the component data into multiple sub-batches.
89 ///
90 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
91 /// instead, via `ComponentBatch::partitioned`.
92 ///
93 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
94 ///
95 /// The specified `lengths` must sum to the total length of the component batch.
97 return detail::partition_batches({&show_time_navigation, &style}, lengths_)
98 .value_or_throw();
99 }
100
101 /// Partitions the component data into unit-length sub-batches.
102 ///
103 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
104 /// where `n` is automatically guessed.
106 return detail::partition_batches_of_unit_length({&show_time_navigation, &style})
107 .value_or_throw();
108 }
109 };
110
111} // namespace rerun::blueprint::archetypes
112
113namespace rerun {
114 /// \private
115 template <typename T>
116 struct AsComponents;
117
118 /// \private
119 template <>
120 struct AsComponents<blueprint::archetypes::RawDataViewFormat> {
121 /// Serialize all set component batches.
122 static Result<Collection<ComponentBatch>> as_batches(
124 ) {
125 return detail::collect_batches({&archetype.show_time_navigation, &archetype.style});
126 }
127 };
128} // namespace rerun
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: Formatting options for a raw data view.
Definition raw_data_view_format.hpp:24
static RawDataViewFormat update_fields()
Update only some specific fields of a RawDataViewFormat.
Definition raw_data_view_format.hpp:59
static constexpr auto Descriptor_style
ComponentDescriptor for the style field.
Definition raw_data_view_format.hpp:46
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition raw_data_view_format.hpp:96
RawDataViewFormat with_style(const rerun::blueprint::components::ViewDensity &_style) &&
How densely the rows are packed.
Definition raw_data_view_format.hpp:83
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition raw_data_view_format.hpp:105
RawDataViewFormat with_show_time_navigation(const rerun::components::Visible &_show_time_navigation) &&
Show the bar carrying the time cursor and the step-to-next-event buttons.
Definition raw_data_view_format.hpp:69
static RawDataViewFormat clear_fields()
Clear all the fields of a RawDataViewFormat.
static constexpr auto Descriptor_show_time_navigation
ComponentDescriptor for the show_time_navigation field.
Definition raw_data_view_format.hpp:41
std::optional< ComponentBatch > show_time_navigation
Show the bar carrying the time cursor and the step-to-next-event buttons.
Definition raw_data_view_format.hpp:28
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition raw_data_view_format.hpp:37
std::optional< ComponentBatch > style
How densely the rows are packed.
Definition raw_data_view_format.hpp:33
Component: Whether the container, view, entity or instance is currently visible.
Definition visible.hpp:14