Rerun C++ SDK
Loading...
Searching...
No Matches
geo_line_strings.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/geo_line_strings.fbs".
3
4#pragma once
5
6#include "../collection.hpp"
7#include "../component_batch.hpp"
8#include "../component_column.hpp"
9#include "../components/color.hpp"
10#include "../components/geo_line_string.hpp"
11#include "../components/radius.hpp"
12#include "../result.hpp"
13
14#include <cstdint>
15#include <optional>
16#include <utility>
17#include <vector>
18
19namespace rerun::archetypes {
20 /// **Archetype**: Geospatial line strings with positions expressed in [EPSG:4326](https://epsg.io/4326) altitude and longitude (North/East-positive degrees), and optional colors and radii.
21 ///
22 /// Also known as "line strips" or "polylines".
23 ///
24 /// ## Example
25 ///
26 /// ### Log a geospatial line string
27 /// ![image](https://static.rerun.io/geo_line_strings_simple/5669983eb10906ace303755b5b5039cad75b917f/full.png)
28 ///
29 /// ```cpp
30 /// #include <rerun.hpp>
31 ///
32 /// int main() {
33 /// const auto rec = rerun::RecordingStream("rerun_example_geo_line_strings");
34 /// rec.spawn().exit_on_failure();
35 ///
36 /// auto line_string = rerun::components::GeoLineString::from_lat_lon(
37 /// {{41.0000, -109.0452},
38 /// {41.0000, -102.0415},
39 /// {36.9931, -102.0415},
40 /// {36.9931, -109.0452},
41 /// {41.0000, -109.0452}}
42 /// );
43 ///
44 /// rec.log(
45 /// "colorado",
46 /// rerun::GeoLineStrings(line_string)
47 /// .with_radii(rerun::Radius::ui_points(2.0f))
48 /// .with_colors(rerun::Color(0, 0, 255))
49 /// );
50 /// }
51 /// ```
53 /// The line strings, expressed in [EPSG:4326](https://epsg.io/4326) coordinates (North/East-positive degrees).
54 std::optional<ComponentBatch> line_strings;
55
56 /// Optional radii for the line strings.
57 ///
58 /// *Note*: scene units radiii are interpreted as meters. Currently, the display scale only considers the latitude of
59 /// the first vertex of each line string (see [this issue](https://github.com/rerun-io/rerun/issues/8013)).
60 std::optional<ComponentBatch> radii;
61
62 /// Optional colors for the line strings.
63 std::optional<ComponentBatch> colors;
64
65 public:
66 /// The name of the archetype as used in `ComponentDescriptor`s.
67 static constexpr const char ArchetypeName[] = "rerun.archetypes.GeoLineStrings";
68
69 /// `ComponentDescriptor` for the `line_strings` field.
71 ArchetypeName, "GeoLineStrings:line_strings",
73 );
74 /// `ComponentDescriptor` for the `radii` field.
75 static constexpr auto Descriptor_radii = ComponentDescriptor(
76 ArchetypeName, "GeoLineStrings:radii",
78 );
79 /// `ComponentDescriptor` for the `colors` field.
80 static constexpr auto Descriptor_colors = ComponentDescriptor(
81 ArchetypeName, "GeoLineStrings:colors",
83 );
84
85 public:
86 GeoLineStrings() = default;
87 GeoLineStrings(GeoLineStrings&& other) = default;
88 GeoLineStrings(const GeoLineStrings& other) = default;
89 GeoLineStrings& operator=(const GeoLineStrings& other) = default;
90 GeoLineStrings& operator=(GeoLineStrings&& other) = default;
91
94 ComponentBatch::from_loggable(std::move(_line_strings), Descriptor_line_strings)
95 .value_or_throw()
96 ) {}
97
98 /// Update only some specific fields of a `GeoLineStrings`.
100 return GeoLineStrings();
101 }
102
103 /// Clear all the fields of a `GeoLineStrings`.
105
106 /// The line strings, expressed in [EPSG:4326](https://epsg.io/4326) coordinates (North/East-positive degrees).
109 ) && {
111 .value_or_throw();
112 return std::move(*this);
113 }
114
115 /// Optional radii for the line strings.
116 ///
117 /// *Note*: scene units radiii are interpreted as meters. Currently, the display scale only considers the latitude of
118 /// the first vertex of each line string (see [this issue](https://github.com/rerun-io/rerun/issues/8013)).
120 radii = ComponentBatch::from_loggable(_radii, Descriptor_radii).value_or_throw();
121 return std::move(*this);
122 }
123
124 /// Optional colors for the line strings.
126 colors = ComponentBatch::from_loggable(_colors, Descriptor_colors).value_or_throw();
127 return std::move(*this);
128 }
129
130 /// Partitions the component data into multiple sub-batches.
131 ///
132 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
133 /// instead, via `ComponentBatch::partitioned`.
134 ///
135 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
136 ///
137 /// The specified `lengths` must sum to the total length of the component batch.
139
140 /// Partitions the component data into unit-length sub-batches.
141 ///
142 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
143 /// where `n` is automatically guessed.
145 };
146
147} // namespace rerun::archetypes
148
149namespace rerun {
150 /// \private
151 template <typename T>
152 struct AsComponents;
153
154 /// \private
155 template <>
156 struct AsComponents<archetypes::GeoLineStrings> {
157 /// Serialize all set component batches.
158 static Result<Collection<ComponentBatch>> as_batches(
159 const archetypes::GeoLineStrings& archetype
160 );
161 };
162} // 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 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:23
Arrow-encoded data of a single batch of components together with a component descriptor.
Definition component_batch.hpp:28
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: Geospatial line strings with positions expressed in EPSG:4326 altitude and longitude (Nort...
Definition geo_line_strings.hpp:52
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static GeoLineStrings clear_fields()
Clear all the fields of a GeoLineStrings.
static constexpr auto Descriptor_radii
ComponentDescriptor for the radii field.
Definition geo_line_strings.hpp:75
static constexpr auto Descriptor_line_strings
ComponentDescriptor for the line_strings field.
Definition geo_line_strings.hpp:70
std::optional< ComponentBatch > line_strings
The line strings, expressed in EPSG:4326 coordinates (North/East-positive degrees).
Definition geo_line_strings.hpp:54
static constexpr auto Descriptor_colors
ComponentDescriptor for the colors field.
Definition geo_line_strings.hpp:80
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition geo_line_strings.hpp:67
GeoLineStrings with_line_strings(const Collection< rerun::components::GeoLineString > &_line_strings) &&
The line strings, expressed in EPSG:4326 coordinates (North/East-positive degrees).
Definition geo_line_strings.hpp:107
std::optional< ComponentBatch > colors
Optional colors for the line strings.
Definition geo_line_strings.hpp:63
GeoLineStrings with_colors(const Collection< rerun::components::Color > &_colors) &&
Optional colors for the line strings.
Definition geo_line_strings.hpp:125
GeoLineStrings with_radii(const Collection< rerun::components::Radius > &_radii) &&
Optional radii for the line strings.
Definition geo_line_strings.hpp:119
std::optional< ComponentBatch > radii
Optional radii for the line strings.
Definition geo_line_strings.hpp:60
static GeoLineStrings update_fields()
Update only some specific fields of a GeoLineStrings.
Definition geo_line_strings.hpp:99
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.