Rerun C++ SDK
Loading...
Searching...
No Matches
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 "../../indicator_component.hpp"
15#include "../../result.hpp"
16
17#include <cstdint>
18#include <optional>
19#include <utility>
20#include <vector>
21
22namespace rerun::blueprint::archetypes {
23 /// **Archetype**: The top-level description of the viewport.
25 /// The layout of the views
26 std::optional<ComponentBatch> root_container;
27
28 /// Show one tab as maximized?
29 std::optional<ComponentBatch> maximized;
30
31 /// Whether the viewport layout is determined automatically.
32 ///
33 /// If `true`, the container layout will be reset whenever a new view is added or removed.
34 /// This defaults to `false` and is automatically set to `false` when there is user determined layout.
35 std::optional<ComponentBatch> auto_layout;
36
37 /// Whether or not views should be created automatically.
38 ///
39 /// If `true`, the viewer will only add views that it hasn't considered previously (as identified by `past_viewer_recommendations`)
40 /// and which aren't deemed redundant to existing views.
41 /// This defaults to `false` and is automatically set to `false` when the user adds views manually in the viewer.
42 std::optional<ComponentBatch> auto_views;
43
44 /// Hashes of all recommended views the viewer has already added and that should not be added again.
45 ///
46 /// This is an internal field and should not be set usually.
47 /// If you want the viewer from stopping to add views, you should set `auto_views` to `false`.
48 ///
49 /// The viewer uses this to determine whether it should keep adding views.
50 std::optional<ComponentBatch> past_viewer_recommendations;
51
52 public:
53 static constexpr const char IndicatorComponentName[] =
54 "rerun.blueprint.components.ViewportBlueprintIndicator";
55
56 /// Indicator component, used to identify the archetype when converting to a list of components.
58 /// The name of the archetype as used in `ComponentDescriptor`s.
59 static constexpr const char ArchetypeName[] =
60 "rerun.blueprint.archetypes.ViewportBlueprint";
61
62 /// `ComponentDescriptor` for the `root_container` field.
64 ArchetypeName, "root_container",
66 );
67 /// `ComponentDescriptor` for the `maximized` field.
69 ArchetypeName, "maximized",
71 );
72 /// `ComponentDescriptor` for the `auto_layout` field.
74 ArchetypeName, "auto_layout",
76 );
77 /// `ComponentDescriptor` for the `auto_views` field.
79 ArchetypeName, "auto_views",
81 );
82 /// `ComponentDescriptor` for the `past_viewer_recommendations` field.
84 ArchetypeName, "past_viewer_recommendations",
86 .component_name
87 );
88
89 public:
90 ViewportBlueprint() = default;
91 ViewportBlueprint(ViewportBlueprint&& other) = default;
92 ViewportBlueprint(const ViewportBlueprint& other) = default;
93 ViewportBlueprint& operator=(const ViewportBlueprint& other) = default;
94 ViewportBlueprint& operator=(ViewportBlueprint&& other) = default;
95
96 /// Update only some specific fields of a `ViewportBlueprint`.
98 return ViewportBlueprint();
99 }
100
101 /// Clear all the fields of a `ViewportBlueprint`.
103
104 /// The layout of the views
107 ) && {
110 .value_or_throw();
111 return std::move(*this);
112 }
113
114 /// Show one tab as maximized?
117 ) && {
118 maximized =
119 ComponentBatch::from_loggable(_maximized, Descriptor_maximized).value_or_throw();
120 return std::move(*this);
121 }
122
123 /// Whether the viewport layout is determined automatically.
124 ///
125 /// If `true`, the container layout will be reset whenever a new view is added or removed.
126 /// This defaults to `false` and is automatically set to `false` when there is user determined layout.
129 ) && {
131 .value_or_throw();
132 return std::move(*this);
133 }
134
135 /// Whether or not views should be created automatically.
136 ///
137 /// If `true`, the viewer will only add views that it hasn't considered previously (as identified by `past_viewer_recommendations`)
138 /// and which aren't deemed redundant to existing views.
139 /// This defaults to `false` and is automatically set to `false` when the user adds views manually in the viewer.
141 ) && {
142 auto_views =
143 ComponentBatch::from_loggable(_auto_views, Descriptor_auto_views).value_or_throw();
144 return std::move(*this);
145 }
146
147 /// Hashes of all recommended views the viewer has already added and that should not be added again.
148 ///
149 /// This is an internal field and should not be set usually.
150 /// If you want the viewer from stopping to add views, you should set `auto_views` to `false`.
151 ///
152 /// The viewer uses this to determine whether it should keep adding views.
155 _past_viewer_recommendations
156 ) && {
158 _past_viewer_recommendations,
160 )
161 .value_or_throw();
162 return std::move(*this);
163 }
164
165 /// Partitions the component data into multiple sub-batches.
166 ///
167 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
168 /// instead, via `ComponentBatch::partitioned`.
169 ///
170 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
171 ///
172 /// The specified `lengths` must sum to the total length of the component batch.
174
175 /// Partitions the component data into unit-length sub-batches.
176 ///
177 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
178 /// where `n` is automatically guessed.
180 };
181
182} // namespace rerun::blueprint::archetypes
183
184namespace rerun {
185 /// \private
186 template <typename T>
187 struct AsComponents;
188
189 /// \private
190 template <>
191 struct AsComponents<blueprint::archetypes::ViewportBlueprint> {
192 /// Serialize all set component batches.
193 static Result<Collection<ComponentBatch>> as_batches(
195 );
196 };
197} // 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=rerun::Loggable< T >::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:14
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:24
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:153
static constexpr auto Descriptor_root_container
ComponentDescriptor for the root_container field.
Definition viewport_blueprint.hpp:63
std::optional< ComponentBatch > auto_layout
Whether the viewport layout is determined automatically.
Definition viewport_blueprint.hpp:35
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:50
ViewportBlueprint with_auto_views(const rerun::blueprint::components::AutoViews &_auto_views) &&
Whether or not views should be created automatically.
Definition viewport_blueprint.hpp:140
std::optional< ComponentBatch > root_container
The layout of the views.
Definition viewport_blueprint.hpp:26
static constexpr auto Descriptor_past_viewer_recommendations
ComponentDescriptor for the past_viewer_recommendations field.
Definition viewport_blueprint.hpp:83
std::optional< ComponentBatch > auto_views
Whether or not views should be created automatically.
Definition viewport_blueprint.hpp:42
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:78
ViewportBlueprint with_auto_layout(const rerun::blueprint::components::AutoLayout &_auto_layout) &&
Whether the viewport layout is determined automatically.
Definition viewport_blueprint.hpp:127
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:29
static ViewportBlueprint update_fields()
Update only some specific fields of a ViewportBlueprint.
Definition viewport_blueprint.hpp:97
static constexpr auto Descriptor_auto_layout
ComponentDescriptor for the auto_layout field.
Definition viewport_blueprint.hpp:73
ViewportBlueprint with_maximized(const rerun::blueprint::components::ViewMaximized &_maximized) &&
Show one tab as maximized?
Definition viewport_blueprint.hpp:115
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition viewport_blueprint.hpp:59
ViewportBlueprint with_root_container(const rerun::blueprint::components::RootContainer &_root_container) &&
The layout of the views.
Definition viewport_blueprint.hpp:105
static constexpr auto Descriptor_maximized
ComponentDescriptor for the maximized field.
Definition viewport_blueprint.hpp:68
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:15
Component: Whether or not views should be created automatically.
Definition auto_views.hpp:15
Component: The container that sits at the root of a viewport.
Definition root_container.hpp:16
Component: Whether a view is maximized.
Definition view_maximized.hpp:16
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:32