Rerun C++ SDK
Loading...
Searching...
No Matches
view_coordinates.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/view_coordinates.fbs".
3
4#pragma once
5
6#include "../collection.hpp"
7#include "../components/view_coordinates.hpp"
8#include "../data_cell.hpp"
9#include "../indicator_component.hpp"
10#include "../result.hpp"
11
12#include <cstdint>
13#include <utility>
14#include <vector>
15
16namespace rerun::archetypes {
17 /// **Archetype**: How we interpret the coordinate system of an entity/space.
18 ///
19 /// For instance: What is "up"? What does the Z axis mean? Is this right-handed or left-handed?
20 ///
21 /// The three coordinates are always ordered as [x, y, z].
22 ///
23 /// For example [Right, Down, Forward] means that the X axis points to the right, the Y axis points
24 /// down, and the Z axis points forward.
25 ///
26 /// ## Example
27 ///
28 /// ### View coordinates for adjusting the eye camera
29 /// ![image](https://static.rerun.io/viewcoordinates/0833f0dc8616a676b7b2c566f2a6f613363680c5/full.png)
30 ///
31 /// ```cpp
32 /// #include <rerun.hpp>
33 ///
34 /// int main() {
35 /// const auto rec = rerun::RecordingStream("rerun_example_view_coordinates");
36 /// rec.spawn().exit_on_failure();
37 ///
38 /// rec.log_timeless("world", rerun::ViewCoordinates::RIGHT_HAND_Z_UP); // Set an up-axis
39 /// rec.log(
40 /// "world/xyz",
41 /// rerun::Arrows3D::from_vectors({{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}}
42 /// ).with_colors({{255, 0, 0}, {0, 255, 0}, {0, 0, 255}})
43 /// );
44 /// }
45 /// ```
48
49 public:
50 static constexpr const char IndicatorComponentName[] =
51 "rerun.components.ViewCoordinatesIndicator";
52
53 /// Indicator component, used to identify the archetype when converting to a list of components.
55
56 public:
57 // Extensions to generated type defined in 'view_coordinates_ext.cpp'
58
59 /// Construct Vec3D from x/y/z values.
60 constexpr ViewCoordinates(uint8_t axis0, uint8_t axis1, uint8_t axis2)
61 : xyz(rerun::components::ViewCoordinates(axis0, axis1, axis2)) {}
62
63 // <BEGIN_GENERATED:declarations>
64 // This section is generated by running `scripts/generate_view_coordinate_defs.py --cpp`
100 static const rerun::archetypes::ViewCoordinates BLD;
101 static const rerun::archetypes::ViewCoordinates DRF;
102 static const rerun::archetypes::ViewCoordinates DFR;
103 static const rerun::archetypes::ViewCoordinates RDF;
104 static const rerun::archetypes::ViewCoordinates RFD;
105 static const rerun::archetypes::ViewCoordinates FDR;
106 static const rerun::archetypes::ViewCoordinates FRD;
107 static const rerun::archetypes::ViewCoordinates DRB;
108 static const rerun::archetypes::ViewCoordinates DBR;
109 static const rerun::archetypes::ViewCoordinates RDB;
110 static const rerun::archetypes::ViewCoordinates RBD;
111 static const rerun::archetypes::ViewCoordinates BDR;
112 static const rerun::archetypes::ViewCoordinates BRD;
113 static const rerun::archetypes::ViewCoordinates RIGHT_HAND_X_UP;
114 static const rerun::archetypes::ViewCoordinates RIGHT_HAND_X_DOWN;
115 static const rerun::archetypes::ViewCoordinates RIGHT_HAND_Y_UP;
116 static const rerun::archetypes::ViewCoordinates RIGHT_HAND_Y_DOWN;
117 static const rerun::archetypes::ViewCoordinates RIGHT_HAND_Z_UP;
118 static const rerun::archetypes::ViewCoordinates RIGHT_HAND_Z_DOWN;
119 static const rerun::archetypes::ViewCoordinates LEFT_HAND_X_UP;
120 static const rerun::archetypes::ViewCoordinates LEFT_HAND_X_DOWN;
121 static const rerun::archetypes::ViewCoordinates LEFT_HAND_Y_UP;
122 static const rerun::archetypes::ViewCoordinates LEFT_HAND_Y_DOWN;
123 static const rerun::archetypes::ViewCoordinates LEFT_HAND_Z_UP;
124 static const rerun::archetypes::ViewCoordinates LEFT_HAND_Z_DOWN;
125 // <END_GENERATED:declarations>
126
127 public:
128 ViewCoordinates() = default;
129 ViewCoordinates(ViewCoordinates&& other) = default;
130
131 explicit ViewCoordinates(rerun::components::ViewCoordinates _xyz) : xyz(std::move(_xyz)) {}
132
133 /// Returns the number of primary instances of this archetype.
134 size_t num_instances() const {
135 return 1;
136 }
137 };
138
139} // namespace rerun::archetypes
140
141namespace rerun {
142 /// \private
143 template <typename T>
144 struct AsComponents;
145
146 /// \private
147 template <>
148 struct AsComponents<archetypes::ViewCoordinates> {
149 /// Serialize all set component batches.
150 static Result<std::vector<DataCell>> serialize(const archetypes::ViewCoordinates& archetype
151 );
152 };
153} // namespace rerun
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: How we interpret the coordinate system of an entity/space.
Definition view_coordinates.hpp:46
size_t num_instances() const
Returns the number of primary instances of this archetype.
Definition view_coordinates.hpp:134
constexpr ViewCoordinates(uint8_t axis0, uint8_t axis1, uint8_t axis2)
Construct Vec3D from x/y/z values.
Definition view_coordinates.hpp:60
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:23
Component: How we interpret the coordinate system of an entity/space.
Definition view_coordinates.hpp:35