Rerun C++ SDK
Loading...
Searching...
No Matches
view_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/view_blueprint.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/view_class.hpp"
7#include "../../blueprint/components/view_origin.hpp"
8#include "../../collection.hpp"
9#include "../../component_batch.hpp"
10#include "../../component_column.hpp"
11#include "../../components/name.hpp"
12#include "../../components/visible.hpp"
13#include "../../indicator_component.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 description of a single view.
23 ///
24 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
25 ///
27 /// The class of the view.
28 std::optional<ComponentBatch> class_identifier;
29
30 /// The name of the view.
31 std::optional<ComponentBatch> display_name;
32
33 /// The "anchor point" of this view.
34 ///
35 /// Defaults to the root path '/' if not specified.
36 ///
37 /// The transform at this path forms the reference point for all scene->world transforms in this view.
38 /// I.e. the position of this entity path in space forms the origin of the coordinate system in this view.
39 /// Furthermore, this is the primary indicator for heuristics on what entities we show in this view.
40 std::optional<ComponentBatch> space_origin;
41
42 /// Whether this view is visible.
43 ///
44 /// Defaults to true if not specified.
45 std::optional<ComponentBatch> visible;
46
47 public:
48 static constexpr const char IndicatorComponentName[] =
49 "rerun.blueprint.components.ViewBlueprintIndicator";
50
51 /// Indicator component, used to identify the archetype when converting to a list of components.
53 /// The name of the archetype as used in `ComponentDescriptor`s.
54 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.ViewBlueprint";
55
56 /// `ComponentDescriptor` for the `class_identifier` field.
58 ArchetypeName, "class_identifier",
60 );
61 /// `ComponentDescriptor` for the `display_name` field.
63 ArchetypeName, "display_name",
65 );
66 /// `ComponentDescriptor` for the `space_origin` field.
68 ArchetypeName, "space_origin",
70 );
71 /// `ComponentDescriptor` for the `visible` field.
72 static constexpr auto Descriptor_visible = ComponentDescriptor(
73 ArchetypeName, "visible",
75 );
76
77 public:
78 ViewBlueprint() = default;
79 ViewBlueprint(ViewBlueprint&& other) = default;
80 ViewBlueprint(const ViewBlueprint& other) = default;
81 ViewBlueprint& operator=(const ViewBlueprint& other) = default;
82 ViewBlueprint& operator=(ViewBlueprint&& other) = default;
83
85 : class_identifier(ComponentBatch::from_loggable(
86 std::move(_class_identifier), Descriptor_class_identifier
87 )
88 .value_or_throw()) {}
89
90 /// Update only some specific fields of a `ViewBlueprint`.
92 return ViewBlueprint();
93 }
94
95 /// Clear all the fields of a `ViewBlueprint`.
97
98 /// The class of the view.
100 const rerun::blueprint::components::ViewClass& _class_identifier
101 ) && {
104 .value_or_throw();
105 return std::move(*this);
106 }
107
108 /// The name of the view.
111 .value_or_throw();
112 return std::move(*this);
113 }
114
115 /// The "anchor point" of this view.
116 ///
117 /// Defaults to the root path '/' if not specified.
118 ///
119 /// The transform at this path forms the reference point for all scene->world transforms in this view.
120 /// I.e. the position of this entity path in space forms the origin of the coordinate system in this view.
121 /// Furthermore, this is the primary indicator for heuristics on what entities we show in this view.
124 ) && {
126 .value_or_throw();
127 return std::move(*this);
128 }
129
130 /// Whether this view is visible.
131 ///
132 /// Defaults to true if not specified.
134 visible = ComponentBatch::from_loggable(_visible, Descriptor_visible).value_or_throw();
135 return std::move(*this);
136 }
137
138 /// Partitions the component data into multiple sub-batches.
139 ///
140 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
141 /// instead, via `ComponentBatch::partitioned`.
142 ///
143 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
144 ///
145 /// The specified `lengths` must sum to the total length of the component batch.
147
148 /// Partitions the component data into unit-length sub-batches.
149 ///
150 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
151 /// where `n` is automatically guessed.
153 };
154
155} // namespace rerun::blueprint::archetypes
156
157namespace rerun {
158 /// \private
159 template <typename T>
160 struct AsComponents;
161
162 /// \private
163 template <>
164 struct AsComponents<blueprint::archetypes::ViewBlueprint> {
165 /// Serialize all set component batches.
166 static Result<Collection<ComponentBatch>> as_batches(
168 );
169 };
170} // 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
Arrow-encoded data of a single batch of components together with a component descriptor.
Definition component_batch.hpp:28
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 description of a single view.
Definition view_blueprint.hpp:26
ViewBlueprint with_space_origin(const rerun::blueprint::components::ViewOrigin &_space_origin) &&
The "anchor point" of this view.
Definition view_blueprint.hpp:122
ViewBlueprint with_display_name(const rerun::components::Name &_display_name) &&
The name of the view.
Definition view_blueprint.hpp:109
ViewBlueprint with_visible(const rerun::components::Visible &_visible) &&
Whether this view is visible.
Definition view_blueprint.hpp:133
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
std::optional< ComponentBatch > display_name
The name of the view.
Definition view_blueprint.hpp:31
ViewBlueprint with_class_identifier(const rerun::blueprint::components::ViewClass &_class_identifier) &&
The class of the view.
Definition view_blueprint.hpp:99
std::optional< ComponentBatch > class_identifier
The class of the view.
Definition view_blueprint.hpp:28
std::optional< ComponentBatch > visible
Whether this view is visible.
Definition view_blueprint.hpp:45
static ViewBlueprint update_fields()
Update only some specific fields of a ViewBlueprint.
Definition view_blueprint.hpp:91
static constexpr auto Descriptor_space_origin
ComponentDescriptor for the space_origin field.
Definition view_blueprint.hpp:67
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition view_blueprint.hpp:54
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static constexpr auto Descriptor_visible
ComponentDescriptor for the visible field.
Definition view_blueprint.hpp:72
static ViewBlueprint clear_fields()
Clear all the fields of a ViewBlueprint.
static constexpr auto Descriptor_display_name
ComponentDescriptor for the display_name field.
Definition view_blueprint.hpp:62
std::optional< ComponentBatch > space_origin
The "anchor point" of this view.
Definition view_blueprint.hpp:40
static constexpr auto Descriptor_class_identifier
ComponentDescriptor for the class_identifier field.
Definition view_blueprint.hpp:57
Component: The class identifier of view, e.g.
Definition view_class.hpp:20
Component: The origin of a view.
Definition view_origin.hpp:20
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:32
Component: A display name, typically for an entity or a item like a plot series.
Definition name.hpp:17
Component: Whether the container, view, entity or instance is currently visible.
Definition visible.hpp:15