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/entity_path.hpp"
11#include "../../components/linear_speed.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**: The controls for the 3D eye in a spatial 3D view.
21 ///
22 /// This configures the camera through which the 3D scene is viewed.
23 ///
24 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
25 ///
27 /// The kind of the eye for the spatial 3D view.
28 ///
29 /// This controls how the eye movement behaves when the user interact with the view.
30 /// Defaults to orbital.
31 std::optional<ComponentBatch> kind;
32
33 /// Translation speed of the eye in the view (when using WASDQE keys to move in the 3D scene).
34 ///
35 /// The default depends on the control kind.
36 /// For orbit cameras it is derived from the distance to the orbit center.
37 /// For first person cameras it is derived from the scene size.
38 std::optional<ComponentBatch> speed;
39
40 /// Currently tracked entity.
41 ///
42 /// If this is a camera, it takes over the camera pose, otherwise follows the entity.
43 std::optional<ComponentBatch> tracking_entity;
44
45 public:
46 /// The name of the archetype as used in `ComponentDescriptor`s.
47 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.EyeControls3D";
48
49 /// `ComponentDescriptor` for the `kind` field.
50 static constexpr auto Descriptor_kind = ComponentDescriptor(
51 ArchetypeName, "EyeControls3D:kind",
53 );
54 /// `ComponentDescriptor` for the `speed` field.
55 static constexpr auto Descriptor_speed = ComponentDescriptor(
56 ArchetypeName, "EyeControls3D:speed",
58 );
59 /// `ComponentDescriptor` for the `tracking_entity` field.
61 ArchetypeName, "EyeControls3D:tracking_entity",
63 );
64
65 public:
66 EyeControls3D() = default;
67 EyeControls3D(EyeControls3D&& other) = default;
68 EyeControls3D(const EyeControls3D& other) = default;
69 EyeControls3D& operator=(const EyeControls3D& other) = default;
70 EyeControls3D& operator=(EyeControls3D&& other) = default;
71
72 /// Update only some specific fields of a `EyeControls3D`.
74 return EyeControls3D();
75 }
76
77 /// Clear all the fields of a `EyeControls3D`.
79
80 /// The kind of the eye for the spatial 3D view.
81 ///
82 /// This controls how the eye movement behaves when the user interact with the view.
83 /// Defaults to orbital.
84 EyeControls3D with_kind(const rerun::blueprint::components::Eye3DKind& _kind) && {
85 kind = ComponentBatch::from_loggable(_kind, Descriptor_kind).value_or_throw();
86 return std::move(*this);
87 }
88
89 /// Translation speed of the eye in the view (when using WASDQE keys to move in the 3D scene).
90 ///
91 /// The default depends on the control kind.
92 /// For orbit cameras it is derived from the distance to the orbit center.
93 /// For first person cameras it is derived from the scene size.
95 speed = ComponentBatch::from_loggable(_speed, Descriptor_speed).value_or_throw();
96 return std::move(*this);
97 }
98
99 /// Currently tracked entity.
100 ///
101 /// If this is a camera, it takes over the camera pose, otherwise follows the entity.
103 ) && {
106 .value_or_throw();
107 return std::move(*this);
108 }
109
110 /// Partitions the component data into multiple sub-batches.
111 ///
112 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
113 /// instead, via `ComponentBatch::partitioned`.
114 ///
115 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
116 ///
117 /// The specified `lengths` must sum to the total length of the component batch.
119
120 /// Partitions the component data into unit-length sub-batches.
121 ///
122 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
123 /// where `n` is automatically guessed.
125 };
126
127} // namespace rerun::blueprint::archetypes
128
129namespace rerun {
130 /// \private
131 template <typename T>
132 struct AsComponents;
133
134 /// \private
135 template <>
136 struct AsComponents<blueprint::archetypes::EyeControls3D> {
137 /// Serialize all set component batches.
138 static Result<Collection<ComponentBatch>> as_batches(
140 );
141 };
142} // 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:26
static constexpr auto Descriptor_kind
ComponentDescriptor for the kind field.
Definition eye_controls3d.hpp:50
std::optional< ComponentBatch > kind
The kind of the eye for the spatial 3D view.
Definition eye_controls3d.hpp:31
static constexpr auto Descriptor_tracking_entity
ComponentDescriptor for the tracking_entity field.
Definition eye_controls3d.hpp:60
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:47
EyeControls3D with_kind(const rerun::blueprint::components::Eye3DKind &_kind) &&
The kind of the eye for the spatial 3D view.
Definition eye_controls3d.hpp:84
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:94
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:38
static EyeControls3D update_fields()
Update only some specific fields of a EyeControls3D.
Definition eye_controls3d.hpp:73
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:55
std::optional< ComponentBatch > tracking_entity
Currently tracked entity.
Definition eye_controls3d.hpp:43
EyeControls3D with_tracking_entity(const rerun::components::EntityPath &_tracking_entity) &&
Currently tracked entity.
Definition eye_controls3d.hpp:102
Component: A path to an entity, usually to reference some data that is part of the target entity.
Definition entity_path.hpp:16
Component: Linear speed, used for translation speed for example.
Definition linear_speed.hpp:14