Rerun C++ SDK
Loading...
Searching...
No Matches
geo_points.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_points.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/lat_lon.hpp"
12#include "../components/radius.hpp"
13#include "../indicator_component.hpp"
14#include "../result.hpp"
15
16#include <cstdint>
17#include <optional>
18#include <utility>
19#include <vector>
20
21namespace rerun::archetypes {
22 /// **Archetype**: Geospatial points with positions expressed in [EPSG:4326](https://epsg.io/4326) latitude and longitude (North/East-positive degrees), and optional colors and radii.
23 ///
24 /// ## Example
25 ///
26 /// ### Log a geospatial point
27 /// ![image](https://static.rerun.io/geopoint_simple/b86ce83e5871837587bd33a0ad639358b96e9010/full.png)
28 ///
29 /// ```cpp
30 /// #include <rerun.hpp>
31 ///
32 /// int main() {
33 /// const auto rec = rerun::RecordingStream("rerun_example_geo_points");
34 /// rec.spawn().exit_on_failure();
35 ///
36 /// rec.log(
37 /// "rerun_hq",
38 /// rerun::GeoPoints::from_lat_lon({{59.319221, 18.075631}})
39 /// .with_radii(rerun::Radius::ui_points(10.0f))
40 /// .with_colors(rerun::Color(255, 0, 0))
41 /// );
42 /// }
43 /// ```
44 struct GeoPoints {
45 /// The [EPSG:4326](https://epsg.io/4326) coordinates for the points (North/East-positive degrees).
47
48 /// Optional radii for the points, effectively turning them into circles.
49 ///
50 /// *Note*: scene units radiii are interpreted as meters.
51 std::optional<Collection<rerun::components::Radius>> radii;
52
53 /// Optional colors for the points.
54 std::optional<Collection<rerun::components::Color>> colors;
55
56 /// Optional class Ids for the points.
57 ///
58 /// The `components::ClassId` provides colors if not specified explicitly.
59 std::optional<Collection<rerun::components::ClassId>> class_ids;
60
61 public:
62 static constexpr const char IndicatorComponentName[] =
63 "rerun.components.GeoPointsIndicator";
64
65 /// Indicator component, used to identify the archetype when converting to a list of components.
67
68 public: // START of extensions from geo_points_ext.cpp:
69 /// Creates a new GeoPoints object based on [EPSG:4326](https://epsg.io/4326) latitude and longitude (North/East-positive degrees).
71 GeoPoints points;
72 points.positions = std::move(positions_);
73 return points;
74 }
75
76 // END of extensions from geo_points_ext.cpp, start of generated code:
77
78 public:
79 GeoPoints() = default;
80 GeoPoints(GeoPoints&& other) = default;
81
83 : positions(std::move(_positions)) {}
84
85 /// Optional radii for the points, effectively turning them into circles.
86 ///
87 /// *Note*: scene units radiii are interpreted as meters.
89 radii = std::move(_radii);
90 // See: https://github.com/rerun-io/rerun/issues/4027
91 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
92 }
93
94 /// Optional colors for the points.
96 colors = std::move(_colors);
97 // See: https://github.com/rerun-io/rerun/issues/4027
98 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
99 }
100
101 /// Optional class Ids for the points.
102 ///
103 /// The `components::ClassId` provides colors if not specified explicitly.
105 class_ids = std::move(_class_ids);
106 // See: https://github.com/rerun-io/rerun/issues/4027
107 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
108 }
109 };
110
111} // namespace rerun::archetypes
112
113namespace rerun {
114 /// \private
115 template <typename T>
116 struct AsComponents;
117
118 /// \private
119 template <>
120 struct AsComponents<archetypes::GeoPoints> {
121 /// Serialize all set component batches.
122 static Result<std::vector<ComponentBatch>> serialize(const archetypes::GeoPoints& archetype
123 );
124 };
125} // 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:77
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Archetype: Geospatial points with positions expressed in EPSG:4326 latitude and longitude (North/East...
Definition geo_points.hpp:44
static GeoPoints from_lat_lon(Collection< components::LatLon > positions_)
Creates a new GeoPoints object based on EPSG:4326 latitude and longitude (North/East-positive degrees...
Definition geo_points.hpp:70
std::optional< Collection< rerun::components::ClassId > > class_ids
Optional class Ids for the points.
Definition geo_points.hpp:59
std::optional< Collection< rerun::components::Color > > colors
Optional colors for the points.
Definition geo_points.hpp:54
Collection< rerun::components::LatLon > positions
The EPSG:4326 coordinates for the points (North/East-positive degrees).
Definition geo_points.hpp:46
GeoPoints with_radii(Collection< rerun::components::Radius > _radii) &&
Optional radii for the points, effectively turning them into circles.
Definition geo_points.hpp:88
GeoPoints with_colors(Collection< rerun::components::Color > _colors) &&
Optional colors for the points.
Definition geo_points.hpp:95
std::optional< Collection< rerun::components::Radius > > radii
Optional radii for the points, effectively turning them into circles.
Definition geo_points.hpp:51
GeoPoints with_class_ids(Collection< rerun::components::ClassId > _class_ids) &&
Optional class Ids for the points.
Definition geo_points.hpp:104
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:32