Rerun C++ SDK
Loading...
Searching...
No Matches
line_strips3d.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/line_strips3d.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/line_strip3d.hpp"
12#include "../components/radius.hpp"
13#include "../components/show_labels.hpp"
14#include "../components/text.hpp"
15#include "../indicator_component.hpp"
16#include "../result.hpp"
17
18#include <cstdint>
19#include <optional>
20#include <utility>
21#include <vector>
22
23namespace rerun::archetypes {
24 /// **Archetype**: 3D line strips with positions and optional colors, radii, labels, etc.
25 ///
26 /// ## Examples
27 ///
28 /// ### Many strips
29 /// ![image](https://static.rerun.io/line_strip3d_batch/15e8ff18a6c95a3191acb0eae6eb04adea3b4874/full.png)
30 ///
31 /// ```cpp
32 /// #include <rerun.hpp>
33 ///
34 /// #include <vector>
35 ///
36 /// int main() {
37 /// const auto rec = rerun::RecordingStream("rerun_example_line_strip3d_batch");
38 /// rec.spawn().exit_on_failure();
39 ///
40 /// rerun::Collection<rerun::Vec3D> strip1 = {
41 /// {0.f, 0.f, 2.f},
42 /// {1.f, 0.f, 2.f},
43 /// {1.f, 1.f, 2.f},
44 /// {0.f, 1.f, 2.f},
45 /// };
46 /// rerun::Collection<rerun::Vec3D> strip2 = {
47 /// {0.f, 0.f, 0.f},
48 /// {0.f, 0.f, 1.f},
49 /// {1.f, 0.f, 0.f},
50 /// {1.f, 0.f, 1.f},
51 /// {1.f, 1.f, 0.f},
52 /// {1.f, 1.f, 1.f},
53 /// {0.f, 1.f, 0.f},
54 /// {0.f, 1.f, 1.f},
55 /// };
56 /// rec.log(
57 /// "strips",
58 /// rerun::LineStrips3D({strip1, strip2})
59 /// .with_colors({0xFF0000FF, 0x00FF00FF})
60 /// .with_radii({0.025f, 0.005f})
61 /// .with_labels({"one strip here", "and one strip there"})
62 /// );
63 /// }
64 /// ```
65 ///
66 /// ### Lines with scene & UI radius each
67 /// ![image](https://static.rerun.io/line_strip3d_ui_radius/36b98f47e45747b5a3601511ff39b8d74c61d120/full.png)
68 ///
69 /// ```cpp
70 /// #include <rerun.hpp>
71 ///
72 /// int main() {
73 /// const auto rec = rerun::RecordingStream("rerun_example_line_strip3d_ui_radius");
74 /// rec.spawn().exit_on_failure();
75 ///
76 /// // A blue line with a scene unit radii of 0.01.
77 /// rerun::LineStrip3D linestrip_blue(
78 /// {{0.f, 0.f, 0.f}, {0.f, 0.f, 1.f}, {1.f, 0.f, 0.f}, {1.f, 0.f, 1.f}}
79 /// );
80 /// rec.log(
81 /// "scene_unit_line",
82 /// rerun::LineStrips3D(linestrip_blue)
83 /// // By default, radii are interpreted as world-space units.
84 /// .with_radii(0.01f)
85 /// .with_colors(rerun::Color(0, 0, 255))
86 /// );
87 ///
88 /// // A red line with a ui point radii of 5.
89 /// // UI points are independent of zooming in Views, but are sensitive to the application UI scaling.
90 /// // For 100 % ui scaling, UI points are equal to pixels.
91 /// rerun::LineStrip3D linestrip_red(
92 /// {{3.f, 0.f, 0.f}, {3.f, 0.f, 1.f}, {4.f, 0.f, 0.f}, {4.f, 0.f, 1.f}}
93 /// );
94 /// rec.log(
95 /// "ui_points_line",
96 /// rerun::LineStrips3D(linestrip_red)
97 /// // By default, radii are interpreted as world-space units.
98 /// .with_radii(rerun::Radius::ui_points(5.0f))
99 /// .with_colors(rerun::Color(255, 0, 0))
100 /// );
101 /// }
102 /// ```
104 /// All the actual 3D line strips that make up the batch.
106
107 /// Optional radii for the line strips.
108 std::optional<Collection<rerun::components::Radius>> radii;
109
110 /// Optional colors for the line strips.
111 std::optional<Collection<rerun::components::Color>> colors;
112
113 /// Optional text labels for the line strips.
114 ///
115 /// If there's a single label present, it will be placed at the center of the entity.
116 /// Otherwise, each instance will have its own label.
117 std::optional<Collection<rerun::components::Text>> labels;
118
119 /// Optional choice of whether the text labels should be shown by default.
120 std::optional<rerun::components::ShowLabels> show_labels;
121
122 /// Optional `components::ClassId`s for the lines.
123 ///
124 /// The `components::ClassId` provides colors and labels if not specified explicitly.
125 std::optional<Collection<rerun::components::ClassId>> class_ids;
126
127 public:
128 static constexpr const char IndicatorComponentName[] =
129 "rerun.components.LineStrips3DIndicator";
130
131 /// Indicator component, used to identify the archetype when converting to a list of components.
133
134 public:
135 LineStrips3D() = default;
136 LineStrips3D(LineStrips3D&& other) = default;
137
139 : strips(std::move(_strips)) {}
140
141 /// Optional radii for the line strips.
143 radii = std::move(_radii);
144 // See: https://github.com/rerun-io/rerun/issues/4027
145 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
146 }
147
148 /// Optional colors for the line strips.
150 colors = std::move(_colors);
151 // See: https://github.com/rerun-io/rerun/issues/4027
152 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
153 }
154
155 /// Optional text labels for the line strips.
156 ///
157 /// If there's a single label present, it will be placed at the center of the entity.
158 /// Otherwise, each instance will have its own label.
160 labels = std::move(_labels);
161 // See: https://github.com/rerun-io/rerun/issues/4027
162 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
163 }
164
165 /// Optional choice of whether the text labels should be shown by default.
167 show_labels = std::move(_show_labels);
168 // See: https://github.com/rerun-io/rerun/issues/4027
169 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
170 }
171
172 /// Optional `components::ClassId`s for the lines.
173 ///
174 /// The `components::ClassId` provides colors and labels if not specified explicitly.
176 class_ids = std::move(_class_ids);
177 // See: https://github.com/rerun-io/rerun/issues/4027
178 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
179 }
180 };
181
182} // namespace rerun::archetypes
183
184namespace rerun {
185 /// \private
186 template <typename T>
187 struct AsComponents;
188
189 /// \private
190 template <>
191 struct AsComponents<archetypes::LineStrips3D> {
192 /// Serialize all set component batches.
193 static Result<std::vector<ComponentBatch>> serialize(
194 const archetypes::LineStrips3D& archetype
195 );
196 };
197} // 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
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Archetype: 3D line strips with positions and optional colors, radii, labels, etc.
Definition line_strips3d.hpp:103
LineStrips3D with_colors(Collection< rerun::components::Color > _colors) &&
Optional colors for the line strips.
Definition line_strips3d.hpp:149
std::optional< Collection< rerun::components::Radius > > radii
Optional radii for the line strips.
Definition line_strips3d.hpp:108
std::optional< Collection< rerun::components::Color > > colors
Optional colors for the line strips.
Definition line_strips3d.hpp:111
Collection< rerun::components::LineStrip3D > strips
All the actual 3D line strips that make up the batch.
Definition line_strips3d.hpp:105
std::optional< Collection< rerun::components::ClassId > > class_ids
Optional components::ClassIds for the lines.
Definition line_strips3d.hpp:125
std::optional< Collection< rerun::components::Text > > labels
Optional text labels for the line strips.
Definition line_strips3d.hpp:117
LineStrips3D with_labels(Collection< rerun::components::Text > _labels) &&
Optional text labels for the line strips.
Definition line_strips3d.hpp:159
std::optional< rerun::components::ShowLabels > show_labels
Optional choice of whether the text labels should be shown by default.
Definition line_strips3d.hpp:120
LineStrips3D with_class_ids(Collection< rerun::components::ClassId > _class_ids) &&
Optional components::ClassIds for the lines.
Definition line_strips3d.hpp:175
LineStrips3D with_radii(Collection< rerun::components::Radius > _radii) &&
Optional radii for the line strips.
Definition line_strips3d.hpp:142
LineStrips3D with_show_labels(rerun::components::ShowLabels _show_labels) &&
Optional choice of whether the text labels should be shown by default.
Definition line_strips3d.hpp:166
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