Rerun C++ SDK
Loading...
Searching...
No Matches
spatial_information.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/build/re_type_definitions/rerun/blueprint/archetypes/spatial_information.def.rs".
3
4#pragma once
5
6#include "../../blueprint/components/enabled.hpp"
7#include "../../collection.hpp"
8#include "../../component_batch.hpp"
9#include "../../component_column.hpp"
10#include "../../components/transform_frame_id.hpp"
11#include "../../components/view_coordinates.hpp"
12#include "../../result.hpp"
13
14#include <cstdint>
15#include <optional>
16#include <utility>
17#include <vector>
18
19namespace rerun::blueprint::archetypes {
20 /// **Archetype**: Configures spatial view properties.
21 ///
22 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
23 ///
25 /// The target reference frame for all transformations.
26 ///
27 /// Defaults to the coordinate frame used by the space origin entity.
28 std::optional<ComponentBatch> target_frame;
29
30 /// Whether the bounding box should be shown.
31 std::optional<ComponentBatch> show_bounding_box;
32
33 /// Whether axes should be shown at the origin.
34 std::optional<ComponentBatch> show_axes;
35
36 /// Controls the orientation of the axes in a 3D view; it has no effect in a 2D view.
37 ///
38 /// This determines the 3D eye orientation, navigation, and default grid plane.
39 ///
40 /// The three directions are always ordered as [x, y, z] and specify where each positive axis points.
41 /// For example, [Right, Down, Forward] means that +X points right, +Y points down, and +Z points forward.
42 ///
43 /// When this property is unset, a 3D view first uses `archetypes::ViewCoordinates` logged at its origin entity or the closest ancestor.
44 /// If none is found, it uses the camera orientation from the closest ancestor `archetypes::Pinhole`.
45 /// If neither is found, the fallback is RFU.
46 ///
47 /// This property is hidden from the selection panel for 2D views.
48 ///
49 /// ⚠ [Rerun does not yet support left-handed coordinate systems](https://github.com/rerun-io/rerun/issues/5032).
50 std::optional<ComponentBatch> axes;
51
52 public:
53 /// The name of the archetype as used in `ComponentDescriptor`s.
54 static constexpr const char ArchetypeName[] =
55 "rerun.blueprint.archetypes.SpatialInformation";
56
57 /// `ComponentDescriptor` for the `target_frame` field.
59 ArchetypeName, "SpatialInformation:target_frame",
61 );
62 /// `ComponentDescriptor` for the `show_bounding_box` field.
64 ArchetypeName, "SpatialInformation:show_bounding_box",
66 );
67 /// `ComponentDescriptor` for the `show_axes` field.
69 ArchetypeName, "SpatialInformation:show_axes",
71 );
72 /// `ComponentDescriptor` for the `axes` field.
73 static constexpr auto Descriptor_axes = ComponentDescriptor(
74 ArchetypeName, "SpatialInformation:axes",
76 );
77
78 public:
79 SpatialInformation() = default;
80 SpatialInformation(SpatialInformation&& other) = default;
81 SpatialInformation(const SpatialInformation& other) = default;
82 SpatialInformation& operator=(const SpatialInformation& other) = default;
83 SpatialInformation& operator=(SpatialInformation&& other) = default;
84
87 ComponentBatch::from_loggable(std::move(_target_frame), Descriptor_target_frame)
88 .value_or_throw()
89 ) {}
90
91 /// Update only some specific fields of a `SpatialInformation`.
93 return SpatialInformation();
94 }
95
96 /// Clear all the fields of a `SpatialInformation`.
98
99 /// The target reference frame for all transformations.
100 ///
101 /// Defaults to the coordinate frame used by the space origin entity.
103 const rerun::components::TransformFrameId& _target_frame
104 ) && {
106 .value_or_throw();
107 return std::move(*this);
108 }
109
110 /// Whether the bounding box should be shown.
112 const rerun::blueprint::components::Enabled& _show_bounding_box
113 ) && {
116 .value_or_throw();
117 return std::move(*this);
118 }
119
120 /// Whether axes should be shown at the origin.
122 ) && {
123 show_axes =
124 ComponentBatch::from_loggable(_show_axes, Descriptor_show_axes).value_or_throw();
125 return std::move(*this);
126 }
127
128 /// Controls the orientation of the axes in a 3D view; it has no effect in a 2D view.
129 ///
130 /// This determines the 3D eye orientation, navigation, and default grid plane.
131 ///
132 /// The three directions are always ordered as [x, y, z] and specify where each positive axis points.
133 /// For example, [Right, Down, Forward] means that +X points right, +Y points down, and +Z points forward.
134 ///
135 /// When this property is unset, a 3D view first uses `archetypes::ViewCoordinates` logged at its origin entity or the closest ancestor.
136 /// If none is found, it uses the camera orientation from the closest ancestor `archetypes::Pinhole`.
137 /// If neither is found, the fallback is RFU.
138 ///
139 /// This property is hidden from the selection panel for 2D views.
140 ///
141 /// ⚠ [Rerun does not yet support left-handed coordinate systems](https://github.com/rerun-io/rerun/issues/5032).
143 axes = ComponentBatch::from_loggable(_axes, Descriptor_axes).value_or_throw();
144 return std::move(*this);
145 }
146
147 /// Partitions the component data into multiple sub-batches.
148 ///
149 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
150 /// instead, via `ComponentBatch::partitioned`.
151 ///
152 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
153 ///
154 /// The specified `lengths` must sum to the total length of the component batch.
156
157 /// Partitions the component data into unit-length sub-batches.
158 ///
159 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
160 /// where `n` is automatically guessed.
162 };
163
164} // namespace rerun::blueprint::archetypes
165
166namespace rerun {
167 /// \private
168 template <typename T>
169 struct AsComponents;
170
171 /// \private
172 template <>
173 struct AsComponents<blueprint::archetypes::SpatialInformation> {
174 /// Serialize all set component batches.
175 static Result<Collection<ComponentBatch>> as_batches(
177 );
178 };
179} // 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: Configures spatial view properties.
Definition spatial_information.hpp:24
static SpatialInformation update_fields()
Update only some specific fields of a SpatialInformation.
Definition spatial_information.hpp:92
static constexpr auto Descriptor_show_axes
ComponentDescriptor for the show_axes field.
Definition spatial_information.hpp:68
static constexpr auto Descriptor_axes
ComponentDescriptor for the axes field.
Definition spatial_information.hpp:73
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition spatial_information.hpp:54
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static constexpr auto Descriptor_show_bounding_box
ComponentDescriptor for the show_bounding_box field.
Definition spatial_information.hpp:63
SpatialInformation with_show_bounding_box(const rerun::blueprint::components::Enabled &_show_bounding_box) &&
Whether the bounding box should be shown.
Definition spatial_information.hpp:111
static SpatialInformation clear_fields()
Clear all the fields of a SpatialInformation.
std::optional< ComponentBatch > show_axes
Whether axes should be shown at the origin.
Definition spatial_information.hpp:34
std::optional< ComponentBatch > show_bounding_box
Whether the bounding box should be shown.
Definition spatial_information.hpp:31
std::optional< ComponentBatch > target_frame
The target reference frame for all transformations.
Definition spatial_information.hpp:28
SpatialInformation with_target_frame(const rerun::components::TransformFrameId &_target_frame) &&
The target reference frame for all transformations.
Definition spatial_information.hpp:102
static constexpr auto Descriptor_target_frame
ComponentDescriptor for the target_frame field.
Definition spatial_information.hpp:58
SpatialInformation with_axes(const rerun::components::ViewCoordinates &_axes) &&
Controls the orientation of the axes in a 3D view; it has no effect in a 2D view.
Definition spatial_information.hpp:142
SpatialInformation with_show_axes(const rerun::blueprint::components::Enabled &_show_axes) &&
Whether axes should be shown at the origin.
Definition spatial_information.hpp:121
std::optional< ComponentBatch > axes
Controls the orientation of the axes in a 3D view; it has no effect in a 2D view.
Definition spatial_information.hpp:50
Component: Whether a procedure is enabled.
Definition enabled.hpp:17
Component: A string identifier for a transform frame.
Definition transform_frame_id.hpp:24
Component: An orientation convention for a camera or 3D view.
Definition view_coordinates.hpp:28