Rerun C++ SDK
Loading...
Searching...
No Matches
eye_controls3d.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/eye_controls3d.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/eye3d_kind.hpp"
7#include "../../collection.hpp"
8#include "../../component_batch.hpp"
9#include "../../component_column.hpp"
10#include "../../components/linear_speed.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**: The controls for the 3D eye in a spatial 3D view.
20 ///
21 /// This configures the camera through which the 3D scene is viewed.
22 ///
23 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
24 ///
26 /// The kind of the eye for the spatial 3D view.
27 ///
28 /// This controls how the eye movement behaves when the user interact with the view.
29 /// Defaults to orbital.
30 std::optional<ComponentBatch> kind;
31
32 /// Translation speed of the eye in the view (when using WASDQE keys to move in the 3D scene).
33 ///
34 /// The default depends on the control kind.
35 /// For orbit cameras it is derived from the distance to the orbit center.
36 /// For first person cameras it is derived from the scene size.
37 std::optional<ComponentBatch> speed;
38
39 public:
40 /// The name of the archetype as used in `ComponentDescriptor`s.
41 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.EyeControls3D";
42
43 /// `ComponentDescriptor` for the `kind` field.
44 static constexpr auto Descriptor_kind = ComponentDescriptor(
45 ArchetypeName, "EyeControls3D:kind",
47 );
48 /// `ComponentDescriptor` for the `speed` field.
49 static constexpr auto Descriptor_speed = ComponentDescriptor(
50 ArchetypeName, "EyeControls3D:speed",
52 );
53
54 public:
55 EyeControls3D() = default;
56 EyeControls3D(EyeControls3D&& other) = default;
57 EyeControls3D(const EyeControls3D& other) = default;
58 EyeControls3D& operator=(const EyeControls3D& other) = default;
59 EyeControls3D& operator=(EyeControls3D&& other) = default;
60
61 /// Update only some specific fields of a `EyeControls3D`.
63 return EyeControls3D();
64 }
65
66 /// Clear all the fields of a `EyeControls3D`.
68
69 /// The kind of the eye for the spatial 3D view.
70 ///
71 /// This controls how the eye movement behaves when the user interact with the view.
72 /// Defaults to orbital.
73 EyeControls3D with_kind(const rerun::blueprint::components::Eye3DKind& _kind) && {
74 kind = ComponentBatch::from_loggable(_kind, Descriptor_kind).value_or_throw();
75 return std::move(*this);
76 }
77
78 /// Translation speed of the eye in the view (when using WASDQE keys to move in the 3D scene).
79 ///
80 /// The default depends on the control kind.
81 /// For orbit cameras it is derived from the distance to the orbit center.
82 /// For first person cameras it is derived from the scene size.
84 speed = ComponentBatch::from_loggable(_speed, Descriptor_speed).value_or_throw();
85 return std::move(*this);
86 }
87
88 /// Partitions the component data into multiple sub-batches.
89 ///
90 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
91 /// instead, via `ComponentBatch::partitioned`.
92 ///
93 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
94 ///
95 /// The specified `lengths` must sum to the total length of the component batch.
97
98 /// Partitions the component data into unit-length sub-batches.
99 ///
100 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
101 /// where `n` is automatically guessed.
103 };
104
105} // namespace rerun::blueprint::archetypes
106
107namespace rerun {
108 /// \private
109 template <typename T>
110 struct AsComponents;
111
112 /// \private
113 template <>
114 struct AsComponents<blueprint::archetypes::EyeControls3D> {
115 /// Serialize all set component batches.
116 static Result<Collection<ComponentBatch>> as_batches(
118 );
119 };
120} // 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
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 controls for the 3D eye in a spatial 3D view.
Definition eye_controls3d.hpp:25
static constexpr auto Descriptor_kind
ComponentDescriptor for the kind field.
Definition eye_controls3d.hpp:44
std::optional< ComponentBatch > kind
The kind of the eye for the spatial 3D view.
Definition eye_controls3d.hpp:30
static EyeControls3D clear_fields()
Clear all the fields of a EyeControls3D.
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition eye_controls3d.hpp:41
EyeControls3D with_kind(const rerun::blueprint::components::Eye3DKind &_kind) &&
The kind of the eye for the spatial 3D view.
Definition eye_controls3d.hpp:73
EyeControls3D with_speed(const rerun::components::LinearSpeed &_speed) &&
Translation speed of the eye in the view (when using WASDQE keys to move in the 3D scene).
Definition eye_controls3d.hpp:83
std::optional< ComponentBatch > speed
Translation speed of the eye in the view (when using WASDQE keys to move in the 3D scene).
Definition eye_controls3d.hpp:37
static EyeControls3D update_fields()
Update only some specific fields of a EyeControls3D.
Definition eye_controls3d.hpp:62
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
static constexpr auto Descriptor_speed
ComponentDescriptor for the speed field.
Definition eye_controls3d.hpp:49
Component: Linear speed, used for translation speed for example.
Definition linear_speed.hpp:14