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 "../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::datatypes {
19 /// **Datatype**: How we interpret the coordinate system of an entity/space.
20 ///
21 /// For instance: What is "up"? What does the Z axis mean?
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 /// ⚠ [Rerun does not yet support left-handed coordinate systems](https://github.com/rerun-io/rerun/issues/5032).
29 ///
30 /// The following constants are used to represent the different directions:
31 /// * Up = 1
32 /// * Down = 2
33 /// * Right = 3
34 /// * Left = 4
35 /// * Forward = 5
36 /// * Back = 6
37 ///
38 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
39 ///
41 /// The directions of the [x, y, z] axes.
42 std::array<uint8_t, 3> coordinates;
43
44 public: // START of extensions from view_coordinates_ext.cpp:
45 /// Construct Vec3D from x/y/z values.
46 explicit constexpr ViewCoordinates(uint8_t axis0, uint8_t axis1, uint8_t axis2)
47 : coordinates{axis0, axis1, axis2} {}
48
49 // END of extensions from view_coordinates_ext.cpp, start of generated code:
50
51 public:
52 ViewCoordinates() = default;
53
54 ViewCoordinates(std::array<uint8_t, 3> coordinates_) : coordinates(coordinates_) {}
55
56 ViewCoordinates& operator=(std::array<uint8_t, 3> coordinates_) {
57 coordinates = coordinates_;
58 return *this;
59 }
60 };
61} // namespace rerun::datatypes
62
63namespace rerun {
64 template <typename T>
65 struct Loggable;
66
67 /// \private
68 template <>
69 struct Loggable<datatypes::ViewCoordinates> {
70 static constexpr std::string_view ComponentType = "rerun.datatypes.ViewCoordinates";
71
72 /// Returns the arrow data type this type corresponds to.
73 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
74
75 /// Serializes an array of `rerun::datatypes::ViewCoordinates` into an arrow array.
76 static Result<std::shared_ptr<arrow::Array>> to_arrow(
77 const datatypes::ViewCoordinates* instances, size_t num_instances
78 );
79
80 /// Fills an arrow array builder with an array of this type.
81 static rerun::Error fill_arrow_array_builder(
82 arrow::FixedSizeListBuilder* builder, const datatypes::ViewCoordinates* elements,
83 size_t num_elements
84 );
85 };
86} // 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:55
Datatype: How we interpret the coordinate system of an entity/space.
Definition view_coordinates.hpp:40
std::array< uint8_t, 3 > coordinates
The directions of the [x, y, z] axes.
Definition view_coordinates.hpp:42
constexpr ViewCoordinates(uint8_t axis0, uint8_t axis1, uint8_t axis2)
Construct Vec3D from x/y/z values.
Definition view_coordinates.hpp:46