Rerun C++ SDK
Loading...
Searching...
No Matches
time_panel_blueprint.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/store/re_types/definitions/rerun/blueprint/archetypes/panel_blueprint.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/absolute_time_range.hpp"
7#include "../../blueprint/components/fps.hpp"
8#include "../../blueprint/components/loop_mode.hpp"
9#include "../../blueprint/components/panel_state.hpp"
10#include "../../blueprint/components/play_state.hpp"
11#include "../../blueprint/components/playback_speed.hpp"
12#include "../../blueprint/components/timeline_name.hpp"
13#include "../../collection.hpp"
14#include "../../component_batch.hpp"
15#include "../../component_column.hpp"
16#include "../../result.hpp"
17
18#include <cstdint>
19#include <optional>
20#include <utility>
21#include <vector>
22
23namespace rerun::blueprint::archetypes {
24 /// **Archetype**: Time panel specific state.
25 ///
26 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
27 ///
29 /// Current state of the panel.
30 std::optional<ComponentBatch> state;
31
32 /// What timeline the panel is on.
33 std::optional<ComponentBatch> timeline;
34
35 /// A time playback speed multiplier.
36 std::optional<ComponentBatch> playback_speed;
37
38 /// Frames per second. Only applicable for sequence timelines.
39 std::optional<ComponentBatch> fps;
40
41 /// If the time is currently paused, playing, or following.
42 ///
43 /// Defaults to either playing or following, depending on the data source.
44 std::optional<ComponentBatch> play_state;
45
46 /// How the time should loop. A selection loop only works if there is also a `time_selection` passed.
47 ///
48 /// Defaults to off.
49 std::optional<ComponentBatch> loop_mode;
50
51 /// Selects a range of time on the time panel.
52 std::optional<ComponentBatch> time_selection;
53
54 public:
55 /// The name of the archetype as used in `ComponentDescriptor`s.
56 static constexpr const char ArchetypeName[] =
57 "rerun.blueprint.archetypes.TimePanelBlueprint";
58
59 /// `ComponentDescriptor` for the `state` field.
60 static constexpr auto Descriptor_state = ComponentDescriptor(
61 ArchetypeName, "TimePanelBlueprint:state",
63 );
64 /// `ComponentDescriptor` for the `timeline` field.
66 ArchetypeName, "TimePanelBlueprint:timeline",
68 );
69 /// `ComponentDescriptor` for the `playback_speed` field.
71 ArchetypeName, "TimePanelBlueprint:playback_speed",
73 );
74 /// `ComponentDescriptor` for the `fps` field.
75 static constexpr auto Descriptor_fps = ComponentDescriptor(
76 ArchetypeName, "TimePanelBlueprint:fps",
78 );
79 /// `ComponentDescriptor` for the `play_state` field.
81 ArchetypeName, "TimePanelBlueprint:play_state",
83 );
84 /// `ComponentDescriptor` for the `loop_mode` field.
86 ArchetypeName, "TimePanelBlueprint:loop_mode",
88 );
89 /// `ComponentDescriptor` for the `time_selection` field.
91 ArchetypeName, "TimePanelBlueprint:time_selection",
93 );
94
95 public:
96 TimePanelBlueprint() = default;
97 TimePanelBlueprint(TimePanelBlueprint&& other) = default;
98 TimePanelBlueprint(const TimePanelBlueprint& other) = default;
99 TimePanelBlueprint& operator=(const TimePanelBlueprint& other) = default;
100 TimePanelBlueprint& operator=(TimePanelBlueprint&& other) = default;
101
102 /// Update only some specific fields of a `TimePanelBlueprint`.
104 return TimePanelBlueprint();
105 }
106
107 /// Clear all the fields of a `TimePanelBlueprint`.
109
110 /// Current state of the panel.
111 TimePanelBlueprint with_state(const rerun::blueprint::components::PanelState& _state) && {
112 state = ComponentBatch::from_loggable(_state, Descriptor_state).value_or_throw();
113 return std::move(*this);
114 }
115
116 /// What timeline the panel is on.
118 ) && {
119 timeline =
120 ComponentBatch::from_loggable(_timeline, Descriptor_timeline).value_or_throw();
121 return std::move(*this);
122 }
123
124 /// A time playback speed multiplier.
127 ) && {
130 .value_or_throw();
131 return std::move(*this);
132 }
133
134 /// Frames per second. Only applicable for sequence timelines.
136 fps = ComponentBatch::from_loggable(_fps, Descriptor_fps).value_or_throw();
137 return std::move(*this);
138 }
139
140 /// If the time is currently paused, playing, or following.
141 ///
142 /// Defaults to either playing or following, depending on the data source.
144 const rerun::blueprint::components::PlayState& _play_state
145 ) && {
146 play_state =
147 ComponentBatch::from_loggable(_play_state, Descriptor_play_state).value_or_throw();
148 return std::move(*this);
149 }
150
151 /// How the time should loop. A selection loop only works if there is also a `time_selection` passed.
152 ///
153 /// Defaults to off.
154 TimePanelBlueprint with_loop_mode(const rerun::blueprint::components::LoopMode& _loop_mode
155 ) && {
156 loop_mode =
157 ComponentBatch::from_loggable(_loop_mode, Descriptor_loop_mode).value_or_throw();
158 return std::move(*this);
159 }
160
161 /// Selects a range of time on the time panel.
164 ) && {
167 .value_or_throw();
168 return std::move(*this);
169 }
170
171 /// Partitions the component data into multiple sub-batches.
172 ///
173 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
174 /// instead, via `ComponentBatch::partitioned`.
175 ///
176 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
177 ///
178 /// The specified `lengths` must sum to the total length of the component batch.
180
181 /// Partitions the component data into unit-length sub-batches.
182 ///
183 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
184 /// where `n` is automatically guessed.
186 };
187
188} // namespace rerun::blueprint::archetypes
189
190namespace rerun {
191 /// \private
192 template <typename T>
193 struct AsComponents;
194
195 /// \private
196 template <>
197 struct AsComponents<blueprint::archetypes::TimePanelBlueprint> {
198 /// Serialize all set component batches.
199 static Result<Collection<ComponentBatch>> as_batches(
201 );
202 };
203} // 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:23
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: Time panel specific state.
Definition time_panel_blueprint.hpp:28
static constexpr auto Descriptor_timeline
ComponentDescriptor for the timeline field.
Definition time_panel_blueprint.hpp:65
std::optional< ComponentBatch > loop_mode
How the time should loop.
Definition time_panel_blueprint.hpp:49
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
std::optional< ComponentBatch > time_selection
Selects a range of time on the time panel.
Definition time_panel_blueprint.hpp:52
static constexpr auto Descriptor_state
ComponentDescriptor for the state field.
Definition time_panel_blueprint.hpp:60
std::optional< ComponentBatch > timeline
What timeline the panel is on.
Definition time_panel_blueprint.hpp:33
std::optional< ComponentBatch > playback_speed
A time playback speed multiplier.
Definition time_panel_blueprint.hpp:36
std::optional< ComponentBatch > state
Current state of the panel.
Definition time_panel_blueprint.hpp:30
static constexpr auto Descriptor_fps
ComponentDescriptor for the fps field.
Definition time_panel_blueprint.hpp:75
TimePanelBlueprint with_fps(const rerun::blueprint::components::Fps &_fps) &&
Frames per second. Only applicable for sequence timelines.
Definition time_panel_blueprint.hpp:135
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition time_panel_blueprint.hpp:56
static constexpr auto Descriptor_playback_speed
ComponentDescriptor for the playback_speed field.
Definition time_panel_blueprint.hpp:70
TimePanelBlueprint with_timeline(const rerun::blueprint::components::TimelineName &_timeline) &&
What timeline the panel is on.
Definition time_panel_blueprint.hpp:117
TimePanelBlueprint with_state(const rerun::blueprint::components::PanelState &_state) &&
Current state of the panel.
Definition time_panel_blueprint.hpp:111
TimePanelBlueprint with_play_state(const rerun::blueprint::components::PlayState &_play_state) &&
If the time is currently paused, playing, or following.
Definition time_panel_blueprint.hpp:143
static constexpr auto Descriptor_loop_mode
ComponentDescriptor for the loop_mode field.
Definition time_panel_blueprint.hpp:85
std::optional< ComponentBatch > fps
Frames per second. Only applicable for sequence timelines.
Definition time_panel_blueprint.hpp:39
TimePanelBlueprint with_time_selection(const rerun::blueprint::components::AbsoluteTimeRange &_time_selection) &&
Selects a range of time on the time panel.
Definition time_panel_blueprint.hpp:162
static TimePanelBlueprint clear_fields()
Clear all the fields of a TimePanelBlueprint.
TimePanelBlueprint with_loop_mode(const rerun::blueprint::components::LoopMode &_loop_mode) &&
How the time should loop.
Definition time_panel_blueprint.hpp:154
static constexpr auto Descriptor_time_selection
ComponentDescriptor for the time_selection field.
Definition time_panel_blueprint.hpp:90
TimePanelBlueprint with_playback_speed(const rerun::blueprint::components::PlaybackSpeed &_playback_speed) &&
A time playback speed multiplier.
Definition time_panel_blueprint.hpp:125
static constexpr auto Descriptor_play_state
ComponentDescriptor for the play_state field.
Definition time_panel_blueprint.hpp:80
static TimePanelBlueprint update_fields()
Update only some specific fields of a TimePanelBlueprint.
Definition time_panel_blueprint.hpp:103
std::optional< ComponentBatch > play_state
If the time is currently paused, playing, or following.
Definition time_panel_blueprint.hpp:44
Component: A reference to a range of time.
Definition absolute_time_range.hpp:17
Component: Frames per second for a sequence timeline.
Definition fps.hpp:17
Component: A playback speed which determines how fast time progresses.
Definition playback_speed.hpp:17
Component: A timeline identified by its name.
Definition timeline_name.hpp:19