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 "../../blueprint/components/visible.hpp"
9#include "../../collection.hpp"
10#include "../../component_batch.hpp"
11#include "../../component_column.hpp"
12#include "../../components/name.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.
24 /// The class of the view.
25 std::optional<ComponentBatch> class_identifier;
26
27 /// The name of the view.
28 std::optional<ComponentBatch> display_name;
29
30 /// The "anchor point" of this view.
31 ///
32 /// Defaults to the root path '/' if not specified.
33 ///
34 /// The transform at this path forms the reference point for all scene->world transforms in this view.
35 /// I.e. the position of this entity path in space forms the origin of the coordinate system in this view.
36 /// Furthermore, this is the primary indicator for heuristics on what entities we show in this view.
37 std::optional<ComponentBatch> space_origin;
38
39 /// Whether this view is visible.
40 ///
41 /// Defaults to true if not specified.
42 std::optional<ComponentBatch> visible;
43
44 public:
45 static constexpr const char IndicatorComponentName[] =
46 "rerun.blueprint.components.ViewBlueprintIndicator";
47
48 /// Indicator component, used to identify the archetype when converting to a list of components.
50 /// The name of the archetype as used in `ComponentDescriptor`s.
51 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.ViewBlueprint";
52
53 /// `ComponentDescriptor` for the `class_identifier` field.
55 ArchetypeName, "class_identifier",
57 );
58 /// `ComponentDescriptor` for the `display_name` field.
60 ArchetypeName, "display_name",
62 );
63 /// `ComponentDescriptor` for the `space_origin` field.
65 ArchetypeName, "space_origin",
67 );
68 /// `ComponentDescriptor` for the `visible` field.
69 static constexpr auto Descriptor_visible = ComponentDescriptor(
70 ArchetypeName, "visible",
72 );
73
74 public:
75 ViewBlueprint() = default;
76 ViewBlueprint(ViewBlueprint&& other) = default;
77 ViewBlueprint(const ViewBlueprint& other) = default;
78 ViewBlueprint& operator=(const ViewBlueprint& other) = default;
79 ViewBlueprint& operator=(ViewBlueprint&& other) = default;
80
82 : class_identifier(ComponentBatch::from_loggable(
83 std::move(_class_identifier), Descriptor_class_identifier
84 )
85 .value_or_throw()) {}
86
87 /// Update only some specific fields of a `ViewBlueprint`.
89 return ViewBlueprint();
90 }
91
92 /// Clear all the fields of a `ViewBlueprint`.
94
95 /// The class of the view.
97 const rerun::blueprint::components::ViewClass& _class_identifier
98 ) && {
101 .value_or_throw();
102 return std::move(*this);
103 }
104
105 /// The name of the view.
108 .value_or_throw();
109 return std::move(*this);
110 }
111
112 /// The "anchor point" of this view.
113 ///
114 /// Defaults to the root path '/' if not specified.
115 ///
116 /// The transform at this path forms the reference point for all scene->world transforms in this view.
117 /// I.e. the position of this entity path in space forms the origin of the coordinate system in this view.
118 /// Furthermore, this is the primary indicator for heuristics on what entities we show in this view.
121 ) && {
123 .value_or_throw();
124 return std::move(*this);
125 }
126
127 /// Whether this view is visible.
128 ///
129 /// Defaults to true if not specified.
131 visible = ComponentBatch::from_loggable(_visible, Descriptor_visible).value_or_throw();
132 return std::move(*this);
133 }
134
135 /// Partitions the component data into multiple sub-batches.
136 ///
137 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
138 /// instead, via `ComponentBatch::partitioned`.
139 ///
140 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
141 ///
142 /// The specified `lengths` must sum to the total length of the component batch.
144
145 /// Partitions the component data into unit-length sub-batches.
146 ///
147 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
148 /// where `n` is automatically guessed.
150 };
151
152} // namespace rerun::blueprint::archetypes
153
154namespace rerun {
155 /// \private
156 template <typename T>
157 struct AsComponents;
158
159 /// \private
160 template <>
161 struct AsComponents<blueprint::archetypes::ViewBlueprint> {
162 /// Serialize all set component batches.
163 static Result<Collection<ComponentBatch>> as_batches(
165 );
166 };
167} // 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:23
ViewBlueprint with_space_origin(const rerun::blueprint::components::ViewOrigin &_space_origin) &&
The "anchor point" of this view.
Definition view_blueprint.hpp:119
ViewBlueprint with_display_name(const rerun::components::Name &_display_name) &&
The name of the view.
Definition view_blueprint.hpp:106
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:28
ViewBlueprint with_class_identifier(const rerun::blueprint::components::ViewClass &_class_identifier) &&
The class of the view.
Definition view_blueprint.hpp:96
std::optional< ComponentBatch > class_identifier
The class of the view.
Definition view_blueprint.hpp:25
std::optional< ComponentBatch > visible
Whether this view is visible.
Definition view_blueprint.hpp:42
static ViewBlueprint update_fields()
Update only some specific fields of a ViewBlueprint.
Definition view_blueprint.hpp:88
static constexpr auto Descriptor_space_origin
ComponentDescriptor for the space_origin field.
Definition view_blueprint.hpp:64
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition view_blueprint.hpp:51
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:69
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:59
std::optional< ComponentBatch > space_origin
The "anchor point" of this view.
Definition view_blueprint.hpp:37
static constexpr auto Descriptor_class_identifier
ComponentDescriptor for the class_identifier field.
Definition view_blueprint.hpp:54
ViewBlueprint with_visible(const rerun::blueprint::components::Visible &_visible) &&
Whether this view is visible.
Definition view_blueprint.hpp:130
Component: The class identifier of view, e.g. "2D", "TextLog", ….
Definition view_class.hpp:17
Component: The origin of a view.
Definition view_origin.hpp:17
Component: Whether the container, view, entity or instance is currently visible.
Definition visible.hpp:15
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