Rerun C++ SDK
Loading...
Searching...
No Matches
ellipsoids3d.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/archetypes/ellipsoids3d.fbs".
3
4#pragma once
5
6#include "../collection.hpp"
7#include "../compiler_utils.hpp"
8#include "../component_batch.hpp"
9#include "../components/class_id.hpp"
10#include "../components/color.hpp"
11#include "../components/fill_mode.hpp"
12#include "../components/half_size3d.hpp"
13#include "../components/pose_rotation_axis_angle.hpp"
14#include "../components/pose_rotation_quat.hpp"
15#include "../components/pose_translation3d.hpp"
16#include "../components/radius.hpp"
17#include "../components/text.hpp"
18#include "../indicator_component.hpp"
19#include "../result.hpp"
20
21#include <cstdint>
22#include <optional>
23#include <utility>
24#include <vector>
25
26namespace rerun::archetypes {
27 /// **Archetype**: 3D ellipsoids or spheres.
28 ///
29 /// This archetype is for ellipsoids or spheres whose size is a key part of the data
30 /// (e.g. a bounding sphere).
31 /// For points whose radii are for the sake of visualization, use `archetypes::Points3D` instead.
32 ///
33 /// Note that orienting and placing the ellipsoids/spheres is handled via `[archetypes.InstancePoses3D]`.
34 /// Some of its component are repeated here for convenience.
35 /// If there's more instance poses than half sizes, the last half size will be repeated for the remaining poses.
36 struct Ellipsoids3D {
37 /// For each ellipsoid, half of its size on its three axes.
38 ///
39 /// If all components are equal, then it is a sphere with that radius.
41
42 /// Optional center positions of the ellipsoids.
43 ///
44 /// If not specified, the centers will be at (0, 0, 0).
45 /// Note that this uses a `components::PoseTranslation3D` which is also used by `archetypes::InstancePoses3D`.
46 std::optional<Collection<rerun::components::PoseTranslation3D>> centers;
47
48 /// Rotations via axis + angle.
49 ///
50 /// If no rotation is specified, the axes of the ellipsoid align with the axes of the local coordinate system.
51 /// Note that this uses a `components::PoseRotationAxisAngle` which is also used by `archetypes::InstancePoses3D`.
52 std::optional<Collection<rerun::components::PoseRotationAxisAngle>> rotation_axis_angles;
53
54 /// Rotations via quaternion.
55 ///
56 /// If no rotation is specified, the axes of the ellipsoid align with the axes of the local coordinate system.
57 /// Note that this uses a `components::PoseRotationQuat` which is also used by `archetypes::InstancePoses3D`.
58 std::optional<Collection<rerun::components::PoseRotationQuat>> quaternions;
59
60 /// Optional colors for the ellipsoids.
61 std::optional<Collection<rerun::components::Color>> colors;
62
63 /// Optional radii for the lines used when the ellipsoid is rendered as a wireframe.
64 std::optional<Collection<rerun::components::Radius>> line_radii;
65
66 /// Optionally choose whether the ellipsoids are drawn with lines or solid.
67 std::optional<rerun::components::FillMode> fill_mode;
68
69 /// Optional text labels for the ellipsoids.
70 std::optional<Collection<rerun::components::Text>> labels;
71
72 /// Optional class ID for the ellipsoids.
73 ///
74 /// The class ID provides colors and labels if not specified explicitly.
75 std::optional<Collection<rerun::components::ClassId>> class_ids;
76
77 public:
78 static constexpr const char IndicatorComponentName[] =
79 "rerun.components.Ellipsoids3DIndicator";
80
81 /// Indicator component, used to identify the archetype when converting to a list of components.
83
84 public: // START of extensions from ellipsoids3d_ext.cpp:
85 /// Creates new `Ellipsoids3D` that are spheres, with `half_sizes` created from radii.
86 //
87 // TODO(andreas): This should not take an std::vector.
88 static Ellipsoids3D from_radii(const std::vector<float>& sizes);
89
90 /// Creates new `Ellipsoids3D` that are spheres, with `half_sizes` and `centers` created
91 /// from centers and radii.
92 //
93 // TODO(andreas): This should not take an std::vector.
95 const std::vector<datatypes::Vec3D>& centers, const std::vector<float>& radii
96 );
97
98 /// Creates new `Ellipsoids3D` with `half_sizes` centered around the local origin.
100 Ellipsoids3D ellipsoids;
101 ellipsoids.half_sizes = std::move(half_sizes);
102 return ellipsoids;
103 }
104
105 /// Creates new `Ellipsoids3D` with `centers` and `half_sizes`.
109 ) {
110 Ellipsoids3D ellipsoids;
111 ellipsoids.half_sizes = std::move(half_sizes);
112 ellipsoids.centers = std::move(centers);
113 return ellipsoids;
114 }
115
116 // END of extensions from ellipsoids3d_ext.cpp, start of generated code:
117
118 public:
119 Ellipsoids3D() = default;
120 Ellipsoids3D(Ellipsoids3D&& other) = default;
121
122 /// Optional center positions of the ellipsoids.
123 ///
124 /// If not specified, the centers will be at (0, 0, 0).
125 /// Note that this uses a `components::PoseTranslation3D` which is also used by `archetypes::InstancePoses3D`.
127 centers = std::move(_centers);
128 // See: https://github.com/rerun-io/rerun/issues/4027
129 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
130 }
131
132 /// Rotations via axis + angle.
133 ///
134 /// If no rotation is specified, the axes of the ellipsoid align with the axes of the local coordinate system.
135 /// Note that this uses a `components::PoseRotationAxisAngle` which is also used by `archetypes::InstancePoses3D`.
138 ) && {
139 rotation_axis_angles = std::move(_rotation_axis_angles);
140 // See: https://github.com/rerun-io/rerun/issues/4027
141 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
142 }
143
144 /// Rotations via quaternion.
145 ///
146 /// If no rotation is specified, the axes of the ellipsoid align with the axes of the local coordinate system.
147 /// Note that this uses a `components::PoseRotationQuat` which is also used by `archetypes::InstancePoses3D`.
149 ) && {
150 quaternions = std::move(_quaternions);
151 // See: https://github.com/rerun-io/rerun/issues/4027
152 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
153 }
154
155 /// Optional colors for the ellipsoids.
157 colors = std::move(_colors);
158 // See: https://github.com/rerun-io/rerun/issues/4027
159 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
160 }
161
162 /// Optional radii for the lines used when the ellipsoid is rendered as a wireframe.
164 line_radii = std::move(_line_radii);
165 // See: https://github.com/rerun-io/rerun/issues/4027
166 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
167 }
168
169 /// Optionally choose whether the ellipsoids are drawn with lines or solid.
171 fill_mode = std::move(_fill_mode);
172 // See: https://github.com/rerun-io/rerun/issues/4027
173 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
174 }
175
176 /// Optional text labels for the ellipsoids.
178 labels = std::move(_labels);
179 // See: https://github.com/rerun-io/rerun/issues/4027
180 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
181 }
182
183 /// Optional class ID for the ellipsoids.
184 ///
185 /// The class ID provides colors and labels if not specified explicitly.
187 class_ids = std::move(_class_ids);
188 // See: https://github.com/rerun-io/rerun/issues/4027
189 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
190 }
191 };
192
193} // namespace rerun::archetypes
194
195namespace rerun {
196 /// \private
197 template <typename T>
198 struct AsComponents;
199
200 /// \private
201 template <>
202 struct AsComponents<archetypes::Ellipsoids3D> {
203 /// Serialize all set component batches.
204 static Result<std::vector<ComponentBatch>> serialize(
205 const archetypes::Ellipsoids3D& archetype
206 );
207 };
208} // namespace rerun
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:72
FillMode
Component: How a geometric shape is drawn and colored.
Definition fill_mode.hpp:24
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Archetype: 3D ellipsoids or spheres.
Definition ellipsoids3d.hpp:36
Collection< rerun::components::HalfSize3D > half_sizes
For each ellipsoid, half of its size on its three axes.
Definition ellipsoids3d.hpp:40
std::optional< Collection< rerun::components::PoseTranslation3D > > centers
Optional center positions of the ellipsoids.
Definition ellipsoids3d.hpp:46
static Ellipsoids3D from_centers_and_radii(const std::vector< datatypes::Vec3D > &centers, const std::vector< float > &radii)
Creates new Ellipsoids3D that are spheres, with half_sizes and centers created from centers and radii...
std::optional< Collection< rerun::components::ClassId > > class_ids
Optional class ID for the ellipsoids.
Definition ellipsoids3d.hpp:75
std::optional< Collection< rerun::components::Text > > labels
Optional text labels for the ellipsoids.
Definition ellipsoids3d.hpp:70
Ellipsoids3D with_rotation_axis_angles(Collection< rerun::components::PoseRotationAxisAngle > _rotation_axis_angles) &&
Rotations via axis + angle.
Definition ellipsoids3d.hpp:136
std::optional< rerun::components::FillMode > fill_mode
Optionally choose whether the ellipsoids are drawn with lines or solid.
Definition ellipsoids3d.hpp:67
Ellipsoids3D with_labels(Collection< rerun::components::Text > _labels) &&
Optional text labels for the ellipsoids.
Definition ellipsoids3d.hpp:177
Ellipsoids3D with_colors(Collection< rerun::components::Color > _colors) &&
Optional colors for the ellipsoids.
Definition ellipsoids3d.hpp:156
Ellipsoids3D with_centers(Collection< rerun::components::PoseTranslation3D > _centers) &&
Optional center positions of the ellipsoids.
Definition ellipsoids3d.hpp:126
Ellipsoids3D with_fill_mode(rerun::components::FillMode _fill_mode) &&
Optionally choose whether the ellipsoids are drawn with lines or solid.
Definition ellipsoids3d.hpp:170
static Ellipsoids3D from_centers_and_half_sizes(Collection< components::PoseTranslation3D > centers, Collection< components::HalfSize3D > half_sizes)
Creates new Ellipsoids3D with centers and half_sizes.
Definition ellipsoids3d.hpp:106
static Ellipsoids3D from_radii(const std::vector< float > &sizes)
Creates new Ellipsoids3D that are spheres, with half_sizes created from radii.
std::optional< Collection< rerun::components::PoseRotationAxisAngle > > rotation_axis_angles
Rotations via axis + angle.
Definition ellipsoids3d.hpp:52
Ellipsoids3D with_quaternions(Collection< rerun::components::PoseRotationQuat > _quaternions) &&
Rotations via quaternion.
Definition ellipsoids3d.hpp:148
Ellipsoids3D with_class_ids(Collection< rerun::components::ClassId > _class_ids) &&
Optional class ID for the ellipsoids.
Definition ellipsoids3d.hpp:186
static Ellipsoids3D from_half_sizes(Collection< components::HalfSize3D > half_sizes)
Creates new Ellipsoids3D with half_sizes centered around the local origin.
Definition ellipsoids3d.hpp:99
std::optional< Collection< rerun::components::Radius > > line_radii
Optional radii for the lines used when the ellipsoid is rendered as a wireframe.
Definition ellipsoids3d.hpp:64
std::optional< Collection< rerun::components::Color > > colors
Optional colors for the ellipsoids.
Definition ellipsoids3d.hpp:61
std::optional< Collection< rerun::components::PoseRotationQuat > > quaternions
Rotations via quaternion.
Definition ellipsoids3d.hpp:58
Ellipsoids3D with_line_radii(Collection< rerun::components::Radius > _line_radii) &&
Optional radii for the lines used when the ellipsoid is rendered as a wireframe.
Definition ellipsoids3d.hpp:163
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:30