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