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/components/view_coordinates.fbs".
3
4#pragma once
5
6#include "../result.hpp"
7
8#include <array>
9#include <cstdint>
10#include <memory>
11
12namespace arrow {
13 class Array;
14 class DataType;
15 class FixedSizeListBuilder;
16} // namespace arrow
17
18namespace rerun::components {
19 /// **Component**: How we interpret the coordinate system of an entity/space.
20 ///
21 /// For instance: What is "up"? What does the Z axis mean? Is this right-handed or left-handed?
22 ///
23 /// The three coordinates are always ordered as [x, y, z].
24 ///
25 /// For example [Right, Down, Forward] means that the X axis points to the right, the Y axis points
26 /// down, and the Z axis points forward.
27 ///
28 /// The following constants are used to represent the different directions:
29 /// * Up = 1
30 /// * Down = 2
31 /// * Right = 3
32 /// * Left = 4
33 /// * Forward = 5
34 /// * Back = 6
36 /// The directions of the [x, y, z] axes.
37 std::array<uint8_t, 3> coordinates;
38
39 public:
40 // Extensions to generated type defined in 'view_coordinates_ext.cpp'
41
42 enum ViewDir : uint8_t {
43 Up = 1,
44 Down = 2,
45 Right = 3,
46 Left = 4,
47 Forward = 5,
48 Back = 6,
49 };
50
51 /// Construct Vec3D from x/y/z values.
52 constexpr ViewCoordinates(uint8_t axis0, uint8_t axis1, uint8_t axis2)
53 : coordinates{axis0, axis1, axis2} {}
54
55 /// Construct Vec3D from x/y/z values.
56 constexpr ViewCoordinates(ViewDir axis0, ViewDir axis1, ViewDir axis2)
57 : coordinates{axis0, axis1, axis2} {}
58
59 // <BEGIN_GENERATED:declarations>
60 // This section is generated by running `scripts/generate_view_coordinate_defs.py --cpp`
100 static const rerun::components::ViewCoordinates RFD;
101 static const rerun::components::ViewCoordinates FDR;
102 static const rerun::components::ViewCoordinates FRD;
103 static const rerun::components::ViewCoordinates DRB;
104 static const rerun::components::ViewCoordinates DBR;
105 static const rerun::components::ViewCoordinates RDB;
106 static const rerun::components::ViewCoordinates RBD;
107 static const rerun::components::ViewCoordinates BDR;
108 static const rerun::components::ViewCoordinates BRD;
109 static const rerun::components::ViewCoordinates RIGHT_HAND_X_UP;
110 static const rerun::components::ViewCoordinates RIGHT_HAND_X_DOWN;
111 static const rerun::components::ViewCoordinates RIGHT_HAND_Y_UP;
112 static const rerun::components::ViewCoordinates RIGHT_HAND_Y_DOWN;
113 static const rerun::components::ViewCoordinates RIGHT_HAND_Z_UP;
114 static const rerun::components::ViewCoordinates RIGHT_HAND_Z_DOWN;
115 static const rerun::components::ViewCoordinates LEFT_HAND_X_UP;
116 static const rerun::components::ViewCoordinates LEFT_HAND_X_DOWN;
117 static const rerun::components::ViewCoordinates LEFT_HAND_Y_UP;
118 static const rerun::components::ViewCoordinates LEFT_HAND_Y_DOWN;
119 static const rerun::components::ViewCoordinates LEFT_HAND_Z_UP;
120 static const rerun::components::ViewCoordinates LEFT_HAND_Z_DOWN;
121 // <END_GENERATED:declarations>
122
123 public:
124 ViewCoordinates() = default;
125
126 ViewCoordinates(std::array<uint8_t, 3> coordinates_) : coordinates(coordinates_) {}
127
128 ViewCoordinates& operator=(std::array<uint8_t, 3> coordinates_) {
129 coordinates = coordinates_;
130 return *this;
131 }
132 };
133} // namespace rerun::components
134
135namespace rerun {
136 template <typename T>
137 struct Loggable;
138
139 /// \private
140 template <>
141 struct Loggable<components::ViewCoordinates> {
142 static constexpr const char Name[] = "rerun.components.ViewCoordinates";
143
144 /// Returns the arrow data type this type corresponds to.
145 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
146
147 /// Fills an arrow array builder with an array of this type.
148 static rerun::Error fill_arrow_array_builder(
149 arrow::FixedSizeListBuilder* builder, const components::ViewCoordinates* elements,
150 size_t num_elements
151 );
152
153 /// Serializes an array of `rerun::components::ViewCoordinates` into an arrow array.
154 static Result<std::shared_ptr<arrow::Array>> to_arrow(
155 const components::ViewCoordinates* instances, size_t num_instances
156 );
157 };
158} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:87
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:69
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
Component: How we interpret the coordinate system of an entity/space.
Definition view_coordinates.hpp:35
constexpr ViewCoordinates(uint8_t axis0, uint8_t axis1, uint8_t axis2)
Construct Vec3D from x/y/z values.
Definition view_coordinates.hpp:52
constexpr ViewCoordinates(ViewDir axis0, ViewDir axis1, ViewDir axis2)
Construct Vec3D from x/y/z values.
Definition view_coordinates.hpp:56
std::array< uint8_t, 3 > coordinates
The directions of the [x, y, z] axes.
Definition view_coordinates.hpp:37