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/store/re_sdk_types/definitions/rerun/blueprint/archetypes/spatial_information.fbs".
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 "../../result.hpp"
12
13#include <cstdint>
14#include <optional>
15#include <utility>
16#include <vector>
17
18namespace rerun::blueprint::archetypes {
19 /// **Archetype**: This configures extra drawing config for the 3D view.
20 ///
21 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
22 ///
24 /// The target reference frame for all transformations.
25 ///
26 /// Defaults to the coordinate frame used by the space origin entity.
27 std::optional<ComponentBatch> target_frame;
28
29 /// Whether axes should be shown at the origin.
30 std::optional<ComponentBatch> show_axes;
31
32 /// Whether the bounding box should be shown.
33 std::optional<ComponentBatch> show_bounding_box;
34
35 public:
36 /// The name of the archetype as used in `ComponentDescriptor`s.
37 static constexpr const char ArchetypeName[] =
38 "rerun.blueprint.archetypes.SpatialInformation";
39
40 /// `ComponentDescriptor` for the `target_frame` field.
42 ArchetypeName, "SpatialInformation:target_frame",
44 );
45 /// `ComponentDescriptor` for the `show_axes` field.
47 ArchetypeName, "SpatialInformation:show_axes",
49 );
50 /// `ComponentDescriptor` for the `show_bounding_box` field.
52 ArchetypeName, "SpatialInformation:show_bounding_box",
54 );
55
56 public:
57 SpatialInformation() = default;
58 SpatialInformation(SpatialInformation&& other) = default;
59 SpatialInformation(const SpatialInformation& other) = default;
60 SpatialInformation& operator=(const SpatialInformation& other) = default;
61 SpatialInformation& operator=(SpatialInformation&& other) = default;
62
65 ComponentBatch::from_loggable(std::move(_target_frame), Descriptor_target_frame)
66 .value_or_throw()
67 ) {}
68
69 /// Update only some specific fields of a `SpatialInformation`.
71 return SpatialInformation();
72 }
73
74 /// Clear all the fields of a `SpatialInformation`.
76
77 /// The target reference frame for all transformations.
78 ///
79 /// Defaults to the coordinate frame used by the space origin entity.
81 const rerun::components::TransformFrameId& _target_frame
82 ) && {
84 .value_or_throw();
85 return std::move(*this);
86 }
87
88 /// Whether axes should be shown at the origin.
90 ) && {
91 show_axes =
92 ComponentBatch::from_loggable(_show_axes, Descriptor_show_axes).value_or_throw();
93 return std::move(*this);
94 }
95
96 /// Whether the bounding box should be shown.
98 const rerun::blueprint::components::Enabled& _show_bounding_box
99 ) && {
102 .value_or_throw();
103 return std::move(*this);
104 }
105
106 /// Partitions the component data into multiple sub-batches.
107 ///
108 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
109 /// instead, via `ComponentBatch::partitioned`.
110 ///
111 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
112 ///
113 /// The specified `lengths` must sum to the total length of the component batch.
115
116 /// Partitions the component data into unit-length sub-batches.
117 ///
118 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
119 /// where `n` is automatically guessed.
121 };
122
123} // namespace rerun::blueprint::archetypes
124
125namespace rerun {
126 /// \private
127 template <typename T>
128 struct AsComponents;
129
130 /// \private
131 template <>
132 struct AsComponents<blueprint::archetypes::SpatialInformation> {
133 /// Serialize all set component batches.
134 static Result<Collection<ComponentBatch>> as_batches(
136 );
137 };
138} // 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: This configures extra drawing config for the 3D view.
Definition spatial_information.hpp:23
static SpatialInformation update_fields()
Update only some specific fields of a SpatialInformation.
Definition spatial_information.hpp:70
static constexpr auto Descriptor_show_axes
ComponentDescriptor for the show_axes field.
Definition spatial_information.hpp:46
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition spatial_information.hpp:37
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:51
SpatialInformation with_show_bounding_box(const rerun::blueprint::components::Enabled &_show_bounding_box) &&
Whether the bounding box should be shown.
Definition spatial_information.hpp:97
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:30
std::optional< ComponentBatch > show_bounding_box
Whether the bounding box should be shown.
Definition spatial_information.hpp:33
std::optional< ComponentBatch > target_frame
The target reference frame for all transformations.
Definition spatial_information.hpp:27
SpatialInformation with_target_frame(const rerun::components::TransformFrameId &_target_frame) &&
The target reference frame for all transformations.
Definition spatial_information.hpp:80
static constexpr auto Descriptor_target_frame
ComponentDescriptor for the target_frame field.
Definition spatial_information.hpp:41
SpatialInformation with_show_axes(const rerun::blueprint::components::Enabled &_show_axes) &&
Whether axes should be shown at the origin.
Definition spatial_information.hpp:89
Component: Whether a procedure is enabled.
Definition enabled.hpp:17
Component: A string identifier for a transform frame.
Definition transform_frame_id.hpp:24