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 /// Defaults to the root path '/' if not specified.
35 ///
36 /// The transform at this path forms the reference point for all scene->world transforms in this view.
37 /// I.e. the position of this entity path in space forms the origin of the coordinate system in this view.
38 /// Furthermore, this is the primary indicator for heuristics on what entities we show in this view.
39 std::optional<ComponentBatch> space_origin;
40
41 /// Whether this view is visible.
42 ///
43 /// Defaults to true if not specified.
44 std::optional<ComponentBatch> visible;
45
46 public:
47 /// The name of the archetype as used in `ComponentDescriptor`s.
48 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.ViewBlueprint";
49
50 /// `ComponentDescriptor` for the `class_identifier` field.
52 ArchetypeName, "ViewBlueprint:class_identifier",
54 );
55 /// `ComponentDescriptor` for the `display_name` field.
57 ArchetypeName, "ViewBlueprint:display_name",
59 );
60 /// `ComponentDescriptor` for the `space_origin` field.
62 ArchetypeName, "ViewBlueprint:space_origin",
64 );
65 /// `ComponentDescriptor` for the `visible` field.
66 static constexpr auto Descriptor_visible = ComponentDescriptor(
67 ArchetypeName, "ViewBlueprint:visible",
69 );
70
71 public:
72 ViewBlueprint() = default;
73 ViewBlueprint(ViewBlueprint&& other) = default;
74 ViewBlueprint(const ViewBlueprint& other) = default;
75 ViewBlueprint& operator=(const ViewBlueprint& other) = default;
76 ViewBlueprint& operator=(ViewBlueprint&& other) = default;
77
79 : class_identifier(ComponentBatch::from_loggable(
80 std::move(_class_identifier), Descriptor_class_identifier
81 )
82 .value_or_throw()) {}
83
84 /// Update only some specific fields of a `ViewBlueprint`.
86 return ViewBlueprint();
87 }
88
89 /// Clear all the fields of a `ViewBlueprint`.
91
92 /// The class of the view.
94 const rerun::blueprint::components::ViewClass& _class_identifier
95 ) && {
98 .value_or_throw();
99 return std::move(*this);
100 }
101
102 /// The name of the view.
105 .value_or_throw();
106 return std::move(*this);
107 }
108
109 /// The "anchor point" of this view.
110 ///
111 /// Defaults to the root path '/' if not specified.
112 ///
113 /// The transform at this path forms the reference point for all scene->world transforms in this view.
114 /// I.e. the position of this entity path in space forms the origin of the coordinate system in this view.
115 /// Furthermore, this is the primary indicator for heuristics on what entities we show in this view.
118 ) && {
120 .value_or_throw();
121 return std::move(*this);
122 }
123
124 /// Whether this view is visible.
125 ///
126 /// Defaults to true if not specified.
128 visible = ComponentBatch::from_loggable(_visible, Descriptor_visible).value_or_throw();
129 return std::move(*this);
130 }
131
132 /// Partitions the component data into multiple sub-batches.
133 ///
134 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
135 /// instead, via `ComponentBatch::partitioned`.
136 ///
137 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
138 ///
139 /// The specified `lengths` must sum to the total length of the component batch.
141
142 /// Partitions the component data into unit-length sub-batches.
143 ///
144 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
145 /// where `n` is automatically guessed.
147 };
148
149} // namespace rerun::blueprint::archetypes
150
151namespace rerun {
152 /// \private
153 template <typename T>
154 struct AsComponents;
155
156 /// \private
157 template <>
158 struct AsComponents<blueprint::archetypes::ViewBlueprint> {
159 /// Serialize all set component batches.
160 static Result<Collection<ComponentBatch>> as_batches(
162 );
163 };
164} // 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:116
ViewBlueprint with_display_name(const rerun::components::Name &_display_name) &&
The name of the view.
Definition view_blueprint.hpp:103
ViewBlueprint with_visible(const rerun::components::Visible &_visible) &&
Whether this view is visible.
Definition view_blueprint.hpp:127
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:93
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:44
static ViewBlueprint update_fields()
Update only some specific fields of a ViewBlueprint.
Definition view_blueprint.hpp:85
static constexpr auto Descriptor_space_origin
ComponentDescriptor for the space_origin field.
Definition view_blueprint.hpp:61
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition view_blueprint.hpp:48
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:66
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:56
std::optional< ComponentBatch > space_origin
The "anchor point" of this view.
Definition view_blueprint.hpp:39
static constexpr auto Descriptor_class_identifier
ComponentDescriptor for the class_identifier field.
Definition view_blueprint.hpp:51
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