Rerun C++ SDK
Loading...
Searching...
No Matches
view_coordinates.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/datatypes/view_coordinates.fbs".
3
4#pragma once
5
6#include "../component_descriptor.hpp"
7#include "../result.hpp"
8
9#include <array>
10#include <cstdint>
11#include <memory>
12
13namespace arrow {
14 class Array;
15 class DataType;
16 class FixedSizeListBuilder;
17} // namespace arrow
18
19namespace rerun::datatypes {
20 /// **Datatype**: How we interpret the coordinate system of an entity/space.
21 ///
22 /// For instance: What is "up"? What does the Z axis mean?
23 ///
24 /// The three coordinates are always ordered as [x, y, z].
25 ///
26 /// For example [Right, Down, Forward] means that the X axis points to the right, the Y axis points
27 /// down, and the Z axis points forward.
28 ///
29 /// ⚠ [Rerun does not yet support left-handed coordinate systems](https://github.com/rerun-io/rerun/issues/5032).
30 ///
31 /// The following constants are used to represent the different directions:
32 /// * Up = 1
33 /// * Down = 2
34 /// * Right = 3
35 /// * Left = 4
36 /// * Forward = 5
37 /// * Back = 6
38 ///
39 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
40 ///
42 /// The directions of the [x, y, z] axes.
43 std::array<uint8_t, 3> coordinates;
44
45 public: // START of extensions from view_coordinates_ext.cpp:
46 /// Construct Vec3D from x/y/z values.
47 explicit constexpr ViewCoordinates(uint8_t axis0, uint8_t axis1, uint8_t axis2)
48 : coordinates{axis0, axis1, axis2} {}
49
50 // END of extensions from view_coordinates_ext.cpp, start of generated code:
51
52 public:
53 ViewCoordinates() = default;
54
55 ViewCoordinates(std::array<uint8_t, 3> coordinates_) : coordinates(coordinates_) {}
56
57 ViewCoordinates& operator=(std::array<uint8_t, 3> coordinates_) {
58 coordinates = coordinates_;
59 return *this;
60 }
61 };
62} // namespace rerun::datatypes
63
64namespace rerun {
65 template <typename T>
66 struct Loggable;
67
68 /// \private
69 template <>
70 struct Loggable<datatypes::ViewCoordinates> {
71 static constexpr ComponentDescriptor Descriptor = "rerun.datatypes.ViewCoordinates";
72
73 /// Returns the arrow data type this type corresponds to.
74 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
75
76 /// Serializes an array of `rerun::datatypes::ViewCoordinates` into an arrow array.
77 static Result<std::shared_ptr<arrow::Array>> to_arrow(
78 const datatypes::ViewCoordinates* instances, size_t num_instances
79 );
80
81 /// Fills an arrow array builder with an array of this type.
82 static rerun::Error fill_arrow_array_builder(
83 arrow::FixedSizeListBuilder* builder, const datatypes::ViewCoordinates* elements,
84 size_t num_elements
85 );
86 };
87} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:99
All built-in datatypes. See Types in the Rerun manual.
Definition rerun.hpp:82
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Archetype: How we interpret the coordinate system of an entity/space.
Definition view_coordinates.hpp:56
Datatype: How we interpret the coordinate system of an entity/space.
Definition view_coordinates.hpp:41
std::array< uint8_t, 3 > coordinates
The directions of the [x, y, z] axes.
Definition view_coordinates.hpp:43
constexpr ViewCoordinates(uint8_t axis0, uint8_t axis1, uint8_t axis2)
Construct Vec3D from x/y/z values.
Definition view_coordinates.hpp:47