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/fps.hpp"
7#include "../../blueprint/components/panel_state.hpp"
8#include "../../blueprint/components/playback_speed.hpp"
9#include "../../blueprint/components/time_int.hpp"
10#include "../../blueprint/components/timeline_name.hpp"
11#include "../../collection.hpp"
12#include "../../component_batch.hpp"
13#include "../../component_column.hpp"
14#include "../../result.hpp"
15
16#include <cstdint>
17#include <optional>
18#include <utility>
19#include <vector>
20
21namespace rerun::blueprint::archetypes {
22 /// **Archetype**: Time panel specific state.
23 ///
24 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
25 ///
27 /// Current state of the panel.
28 std::optional<ComponentBatch> state;
29
30 /// What timeline the panel is on.
31 std::optional<ComponentBatch> timeline;
32
33 /// What time the time cursor should be on.
34 std::optional<ComponentBatch> time;
35
36 /// A time playback speed multiplier.
37 std::optional<ComponentBatch> playback_speed;
38
39 /// Frames per second. Only applicable for sequence timelines.
40 std::optional<ComponentBatch> fps;
41
42 public:
43 /// The name of the archetype as used in `ComponentDescriptor`s.
44 static constexpr const char ArchetypeName[] =
45 "rerun.blueprint.archetypes.TimePanelBlueprint";
46
47 /// `ComponentDescriptor` for the `state` field.
48 static constexpr auto Descriptor_state = ComponentDescriptor(
49 ArchetypeName, "TimePanelBlueprint:state",
51 );
52 /// `ComponentDescriptor` for the `timeline` field.
54 ArchetypeName, "TimePanelBlueprint:timeline",
56 );
57 /// `ComponentDescriptor` for the `time` field.
58 static constexpr auto Descriptor_time = ComponentDescriptor(
59 ArchetypeName, "TimePanelBlueprint:time",
61 );
62 /// `ComponentDescriptor` for the `playback_speed` field.
64 ArchetypeName, "TimePanelBlueprint:playback_speed",
66 );
67 /// `ComponentDescriptor` for the `fps` field.
68 static constexpr auto Descriptor_fps = ComponentDescriptor(
69 ArchetypeName, "TimePanelBlueprint:fps",
71 );
72
73 public:
74 TimePanelBlueprint() = default;
75 TimePanelBlueprint(TimePanelBlueprint&& other) = default;
76 TimePanelBlueprint(const TimePanelBlueprint& other) = default;
77 TimePanelBlueprint& operator=(const TimePanelBlueprint& other) = default;
78 TimePanelBlueprint& operator=(TimePanelBlueprint&& other) = default;
79
80 /// Update only some specific fields of a `TimePanelBlueprint`.
82 return TimePanelBlueprint();
83 }
84
85 /// Clear all the fields of a `TimePanelBlueprint`.
87
88 /// Current state of the panel.
89 TimePanelBlueprint with_state(const rerun::blueprint::components::PanelState& _state) && {
90 state = ComponentBatch::from_loggable(_state, Descriptor_state).value_or_throw();
91 return std::move(*this);
92 }
93
94 /// What timeline the panel is on.
96 ) && {
97 timeline =
98 ComponentBatch::from_loggable(_timeline, Descriptor_timeline).value_or_throw();
99 return std::move(*this);
100 }
101
102 /// What time the time cursor should be on.
104 time = ComponentBatch::from_loggable(_time, Descriptor_time).value_or_throw();
105 return std::move(*this);
106 }
107
108 /// A time playback speed multiplier.
111 ) && {
114 .value_or_throw();
115 return std::move(*this);
116 }
117
118 /// Frames per second. Only applicable for sequence timelines.
120 fps = ComponentBatch::from_loggable(_fps, Descriptor_fps).value_or_throw();
121 return std::move(*this);
122 }
123
124 /// Partitions the component data into multiple sub-batches.
125 ///
126 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
127 /// instead, via `ComponentBatch::partitioned`.
128 ///
129 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
130 ///
131 /// The specified `lengths` must sum to the total length of the component batch.
133
134 /// Partitions the component data into unit-length sub-batches.
135 ///
136 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
137 /// where `n` is automatically guessed.
139 };
140
141} // namespace rerun::blueprint::archetypes
142
143namespace rerun {
144 /// \private
145 template <typename T>
146 struct AsComponents;
147
148 /// \private
149 template <>
150 struct AsComponents<blueprint::archetypes::TimePanelBlueprint> {
151 /// Serialize all set component batches.
152 static Result<Collection<ComponentBatch>> as_batches(
154 );
155 };
156} // 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:26
static constexpr auto Descriptor_timeline
ComponentDescriptor for the timeline field.
Definition time_panel_blueprint.hpp:53
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.
static constexpr auto Descriptor_state
ComponentDescriptor for the state field.
Definition time_panel_blueprint.hpp:48
std::optional< ComponentBatch > timeline
What timeline the panel is on.
Definition time_panel_blueprint.hpp:31
std::optional< ComponentBatch > playback_speed
A time playback speed multiplier.
Definition time_panel_blueprint.hpp:37
std::optional< ComponentBatch > state
Current state of the panel.
Definition time_panel_blueprint.hpp:28
static constexpr auto Descriptor_fps
ComponentDescriptor for the fps field.
Definition time_panel_blueprint.hpp:68
TimePanelBlueprint with_fps(const rerun::blueprint::components::Fps &_fps) &&
Frames per second. Only applicable for sequence timelines.
Definition time_panel_blueprint.hpp:119
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition time_panel_blueprint.hpp:44
TimePanelBlueprint with_time(const rerun::blueprint::components::TimeInt &_time) &&
What time the time cursor should be on.
Definition time_panel_blueprint.hpp:103
static constexpr auto Descriptor_playback_speed
ComponentDescriptor for the playback_speed field.
Definition time_panel_blueprint.hpp:63
TimePanelBlueprint with_timeline(const rerun::blueprint::components::TimelineName &_timeline) &&
What timeline the panel is on.
Definition time_panel_blueprint.hpp:95
TimePanelBlueprint with_state(const rerun::blueprint::components::PanelState &_state) &&
Current state of the panel.
Definition time_panel_blueprint.hpp:89
static constexpr auto Descriptor_time
ComponentDescriptor for the time field.
Definition time_panel_blueprint.hpp:58
std::optional< ComponentBatch > fps
Frames per second. Only applicable for sequence timelines.
Definition time_panel_blueprint.hpp:40
static TimePanelBlueprint clear_fields()
Clear all the fields of a TimePanelBlueprint.
TimePanelBlueprint with_playback_speed(const rerun::blueprint::components::PlaybackSpeed &_playback_speed) &&
A time playback speed multiplier.
Definition time_panel_blueprint.hpp:109
std::optional< ComponentBatch > time
What time the time cursor should be on.
Definition time_panel_blueprint.hpp:34
static TimePanelBlueprint update_fields()
Update only some specific fields of a TimePanelBlueprint.
Definition time_panel_blueprint.hpp:81
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 reference to a time.
Definition time_int.hpp:17
Component: A timeline identified by its name.
Definition timeline_name.hpp:19