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