Rerun C++ SDK
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
viewport_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/viewport_blueprint.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/auto_layout.hpp"
7#include "../../blueprint/components/auto_views.hpp"
8#include "../../blueprint/components/root_container.hpp"
9#include "../../blueprint/components/view_maximized.hpp"
10#include "../../blueprint/components/viewer_recommendation_hash.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**: The top-level description of the viewport.
23 ///
24 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
25 ///
27 /// The layout of the views
28 std::optional<ComponentBatch> root_container;
29
30 /// Show one tab as maximized?
31 std::optional<ComponentBatch> maximized;
32
33 /// Whether the viewport layout is determined automatically.
34 ///
35 /// If `true`, the container layout will be reset whenever a new view is added or removed.
36 /// This defaults to `false` and is automatically set to `false` when there is user determined layout.
37 std::optional<ComponentBatch> auto_layout;
38
39 /// Whether or not views should be created automatically.
40 ///
41 /// If `true`, the viewer will only add views that it hasn't considered previously (as identified by `past_viewer_recommendations`)
42 /// and which aren't deemed redundant to existing views.
43 /// This defaults to `false` and is automatically set to `false` when the user adds views manually in the viewer.
44 std::optional<ComponentBatch> auto_views;
45
46 /// Hashes of all recommended views the viewer has already added and that should not be added again.
47 ///
48 /// This is an internal field and should not be set usually.
49 /// If you want the viewer from stopping to add views, you should set `auto_views` to `false`.
50 ///
51 /// The viewer uses this to determine whether it should keep adding views.
52 std::optional<ComponentBatch> past_viewer_recommendations;
53
54 public:
55 /// The name of the archetype as used in `ComponentDescriptor`s.
56 static constexpr const char ArchetypeName[] =
57 "rerun.blueprint.archetypes.ViewportBlueprint";
58
59 /// `ComponentDescriptor` for the `root_container` field.
61 ArchetypeName, "ViewportBlueprint:root_container",
63 );
64 /// `ComponentDescriptor` for the `maximized` field.
66 ArchetypeName, "ViewportBlueprint:maximized",
68 );
69 /// `ComponentDescriptor` for the `auto_layout` field.
71 ArchetypeName, "ViewportBlueprint:auto_layout",
73 );
74 /// `ComponentDescriptor` for the `auto_views` field.
76 ArchetypeName, "ViewportBlueprint:auto_views",
78 );
79 /// `ComponentDescriptor` for the `past_viewer_recommendations` field.
81 ArchetypeName, "ViewportBlueprint:past_viewer_recommendations",
83 );
84
85 public:
86 ViewportBlueprint() = default;
87 ViewportBlueprint(ViewportBlueprint&& other) = default;
88 ViewportBlueprint(const ViewportBlueprint& other) = default;
89 ViewportBlueprint& operator=(const ViewportBlueprint& other) = default;
90 ViewportBlueprint& operator=(ViewportBlueprint&& other) = default;
91
92 /// Update only some specific fields of a `ViewportBlueprint`.
94 return ViewportBlueprint();
95 }
96
97 /// Clear all the fields of a `ViewportBlueprint`.
99
100 /// The layout of the views
103 ) && {
106 .value_or_throw();
107 return std::move(*this);
108 }
109
110 /// Show one tab as maximized?
113 ) && {
114 maximized =
115 ComponentBatch::from_loggable(_maximized, Descriptor_maximized).value_or_throw();
116 return std::move(*this);
117 }
118
119 /// Whether the viewport layout is determined automatically.
120 ///
121 /// If `true`, the container layout will be reset whenever a new view is added or removed.
122 /// This defaults to `false` and is automatically set to `false` when there is user determined layout.
125 ) && {
127 .value_or_throw();
128 return std::move(*this);
129 }
130
131 /// Whether or not views should be created automatically.
132 ///
133 /// If `true`, the viewer will only add views that it hasn't considered previously (as identified by `past_viewer_recommendations`)
134 /// and which aren't deemed redundant to existing views.
135 /// This defaults to `false` and is automatically set to `false` when the user adds views manually in the viewer.
137 ) && {
138 auto_views =
139 ComponentBatch::from_loggable(_auto_views, Descriptor_auto_views).value_or_throw();
140 return std::move(*this);
141 }
142
143 /// Hashes of all recommended views the viewer has already added and that should not be added again.
144 ///
145 /// This is an internal field and should not be set usually.
146 /// If you want the viewer from stopping to add views, you should set `auto_views` to `false`.
147 ///
148 /// The viewer uses this to determine whether it should keep adding views.
151 _past_viewer_recommendations
152 ) && {
154 _past_viewer_recommendations,
156 )
157 .value_or_throw();
158 return std::move(*this);
159 }
160
161 /// Partitions the component data into multiple sub-batches.
162 ///
163 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
164 /// instead, via `ComponentBatch::partitioned`.
165 ///
166 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
167 ///
168 /// The specified `lengths` must sum to the total length of the component batch.
170
171 /// Partitions the component data into unit-length sub-batches.
172 ///
173 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
174 /// where `n` is automatically guessed.
176 };
177
178} // namespace rerun::blueprint::archetypes
179
180namespace rerun {
181 /// \private
182 template <typename T>
183 struct AsComponents;
184
185 /// \private
186 template <>
187 struct AsComponents<blueprint::archetypes::ViewportBlueprint> {
188 /// Serialize all set component batches.
189 static Result<Collection<ComponentBatch>> as_batches(
191 );
192 };
193} // 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: The top-level description of the viewport.
Definition viewport_blueprint.hpp:26
ViewportBlueprint with_past_viewer_recommendations(const Collection< rerun::blueprint::components::ViewerRecommendationHash > &_past_viewer_recommendations) &&
Hashes of all recommended views the viewer has already added and that should not be added again.
Definition viewport_blueprint.hpp:149
static constexpr auto Descriptor_root_container
ComponentDescriptor for the root_container field.
Definition viewport_blueprint.hpp:60
std::optional< ComponentBatch > auto_layout
Whether the viewport layout is determined automatically.
Definition viewport_blueprint.hpp:37
std::optional< ComponentBatch > past_viewer_recommendations
Hashes of all recommended views the viewer has already added and that should not be added again.
Definition viewport_blueprint.hpp:52
ViewportBlueprint with_auto_views(const rerun::blueprint::components::AutoViews &_auto_views) &&
Whether or not views should be created automatically.
Definition viewport_blueprint.hpp:136
std::optional< ComponentBatch > root_container
The layout of the views.
Definition viewport_blueprint.hpp:28
static constexpr auto Descriptor_past_viewer_recommendations
ComponentDescriptor for the past_viewer_recommendations field.
Definition viewport_blueprint.hpp:80
std::optional< ComponentBatch > auto_views
Whether or not views should be created automatically.
Definition viewport_blueprint.hpp:44
static ViewportBlueprint clear_fields()
Clear all the fields of a ViewportBlueprint.
static constexpr auto Descriptor_auto_views
ComponentDescriptor for the auto_views field.
Definition viewport_blueprint.hpp:75
ViewportBlueprint with_auto_layout(const rerun::blueprint::components::AutoLayout &_auto_layout) &&
Whether the viewport layout is determined automatically.
Definition viewport_blueprint.hpp:123
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
std::optional< ComponentBatch > maximized
Show one tab as maximized?
Definition viewport_blueprint.hpp:31
static ViewportBlueprint update_fields()
Update only some specific fields of a ViewportBlueprint.
Definition viewport_blueprint.hpp:93
static constexpr auto Descriptor_auto_layout
ComponentDescriptor for the auto_layout field.
Definition viewport_blueprint.hpp:70
ViewportBlueprint with_maximized(const rerun::blueprint::components::ViewMaximized &_maximized) &&
Show one tab as maximized?
Definition viewport_blueprint.hpp:111
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition viewport_blueprint.hpp:56
ViewportBlueprint with_root_container(const rerun::blueprint::components::RootContainer &_root_container) &&
The layout of the views.
Definition viewport_blueprint.hpp:101
static constexpr auto Descriptor_maximized
ComponentDescriptor for the maximized field.
Definition viewport_blueprint.hpp:65
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Component: Whether the viewport layout is determined automatically.
Definition auto_layout.hpp:17
Component: Whether or not views should be created automatically.
Definition auto_views.hpp:17
Component: The container that sits at the root of a viewport.
Definition root_container.hpp:18
Component: Whether a view is maximized.
Definition view_maximized.hpp:18