Rerun C++ SDK
Loading...
Searching...
No Matches
line_strips3d.hpp
1// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/re_types/definitions/rerun/archetypes/line_strips3d.fbs".
3
4#pragma once
5
6#include "../collection.hpp"
7#include "../compiler_utils.hpp"
8#include "../components/class_id.hpp"
9#include "../components/color.hpp"
10#include "../components/instance_key.hpp"
11#include "../components/line_strip3d.hpp"
12#include "../components/radius.hpp"
13#include "../components/text.hpp"
14#include "../data_cell.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 /// ## Example
27 ///
28 /// ### Many strips
29 /// ![image](https://static.rerun.io/line_strip3d_batch/102e5ec5271475657fbc76b469267e4ec8e84337/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");
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 struct LineStrips3D {
66 /// All the actual 3D line strips that make up the batch.
68
69 /// Optional radii for the line strips.
70 std::optional<Collection<rerun::components::Radius>> radii;
71
72 /// Optional colors for the line strips.
73 std::optional<Collection<rerun::components::Color>> colors;
74
75 /// Optional text labels for the line strips.
76 std::optional<Collection<rerun::components::Text>> labels;
77
78 /// Optional `ClassId`s for the lines.
79 ///
80 /// The class ID provides colors and labels if not specified explicitly.
81 std::optional<Collection<rerun::components::ClassId>> class_ids;
82
83 /// Unique identifiers for each individual line strip in the batch.
84 std::optional<Collection<rerun::components::InstanceKey>> instance_keys;
85
86 public:
87 static constexpr const char IndicatorComponentName[] =
88 "rerun.components.LineStrips3DIndicator";
89
90 /// Indicator component, used to identify the archetype when converting to a list of components.
92
93 public:
94 LineStrips3D() = default;
95 LineStrips3D(LineStrips3D&& other) = default;
96
98 : strips(std::move(_strips)) {}
99
100 /// Optional radii for the line strips.
102 radii = std::move(_radii);
103 // See: https://github.com/rerun-io/rerun/issues/4027
104 RERUN_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
105 }
106
107 /// Optional colors for the line strips.
109 colors = std::move(_colors);
110 // See: https://github.com/rerun-io/rerun/issues/4027
111 RERUN_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
112 }
113
114 /// Optional text labels for the line strips.
116 labels = std::move(_labels);
117 // See: https://github.com/rerun-io/rerun/issues/4027
118 RERUN_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
119 }
120
121 /// Optional `ClassId`s for the lines.
122 ///
123 /// The class ID provides colors and labels if not specified explicitly.
125 class_ids = std::move(_class_ids);
126 // See: https://github.com/rerun-io/rerun/issues/4027
127 RERUN_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
128 }
129
130 /// Unique identifiers for each individual line strip in the batch.
132 ) && {
133 instance_keys = std::move(_instance_keys);
134 // See: https://github.com/rerun-io/rerun/issues/4027
135 RERUN_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
136 }
137
138 /// Returns the number of primary instances of this archetype.
139 size_t num_instances() const {
140 return strips.size();
141 }
142 };
143
144} // namespace rerun::archetypes
145
146namespace rerun {
147 /// \private
148 template <typename T>
149 struct AsComponents;
150
151 /// \private
152 template <>
153 struct AsComponents<archetypes::LineStrips3D> {
154 /// Serialize all set component batches.
155 static Result<std::vector<DataCell>> serialize(const archetypes::LineStrips3D& archetype);
156 };
157} // namespace rerun
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:47
size_t size() const
Returns the number of instances in this collection.
Definition collection.hpp:254
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:66
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:20
Archetype: 3D line strips with positions and optional colors, radii, labels, etc.
Definition line_strips3d.hpp:65
LineStrips3D with_colors(Collection< rerun::components::Color > _colors) &&
Optional colors for the line strips.
Definition line_strips3d.hpp:108
std::optional< Collection< rerun::components::Radius > > radii
Optional radii for the line strips.
Definition line_strips3d.hpp:70
std::optional< Collection< rerun::components::Color > > colors
Optional colors for the line strips.
Definition line_strips3d.hpp:73
size_t num_instances() const
Returns the number of primary instances of this archetype.
Definition line_strips3d.hpp:139
Collection< rerun::components::LineStrip3D > strips
All the actual 3D line strips that make up the batch.
Definition line_strips3d.hpp:67
LineStrips3D with_instance_keys(Collection< rerun::components::InstanceKey > _instance_keys) &&
Unique identifiers for each individual line strip in the batch.
Definition line_strips3d.hpp:131
std::optional< Collection< rerun::components::ClassId > > class_ids
Optional ClassIds for the lines.
Definition line_strips3d.hpp:81
std::optional< Collection< rerun::components::Text > > labels
Optional text labels for the line strips.
Definition line_strips3d.hpp:76
LineStrips3D with_labels(Collection< rerun::components::Text > _labels) &&
Optional text labels for the line strips.
Definition line_strips3d.hpp:115
LineStrips3D with_class_ids(Collection< rerun::components::ClassId > _class_ids) &&
Optional ClassIds for the lines.
Definition line_strips3d.hpp:124
std::optional< Collection< rerun::components::InstanceKey > > instance_keys
Unique identifiers for each individual line strip in the batch.
Definition line_strips3d.hpp:84
LineStrips3D with_radii(Collection< rerun::components::Radius > _radii) &&
Optional radii for the line strips.
Definition line_strips3d.hpp:101
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:23