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? 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: // START of extensions from view_coordinates_ext.cpp:
40 /// Construct Vec3D from x/y/z values.
41 explicit constexpr ViewCoordinates(uint8_t axis0, uint8_t axis1, uint8_t axis2)
42 : coordinates{axis0, axis1, axis2} {}
43
44 // END of extensions from view_coordinates_ext.cpp, start of generated code:
45
46 public:
47 ViewCoordinates() = default;
48
49 ViewCoordinates(std::array<uint8_t, 3> coordinates_) : coordinates(coordinates_) {}
50
51 ViewCoordinates& operator=(std::array<uint8_t, 3> coordinates_) {
52 coordinates = coordinates_;
53 return *this;
54 }
55 };
56} // namespace rerun::datatypes
57
58namespace rerun {
59 template <typename T>
60 struct Loggable;
61
62 /// \private
63 template <>
64 struct Loggable<datatypes::ViewCoordinates> {
65 static constexpr const char Name[] = "rerun.datatypes.ViewCoordinates";
66
67 /// Returns the arrow data type this type corresponds to.
68 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
69
70 /// Serializes an array of `rerun::datatypes::ViewCoordinates` into an arrow array.
71 static Result<std::shared_ptr<arrow::Array>> to_arrow(
72 const datatypes::ViewCoordinates* instances, size_t num_instances
73 );
74
75 /// Fills an arrow array builder with an array of this type.
76 static rerun::Error fill_arrow_array_builder(
77 arrow::FixedSizeListBuilder* builder, const datatypes::ViewCoordinates* elements,
78 size_t num_elements
79 );
80 };
81} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:91
All built-in datatypes. See Types in the Rerun manual.
Definition rerun.hpp:78
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Archetype: How we interpret the coordinate system of an entity/space.
Definition view_coordinates.hpp:49
Datatype: How we interpret the coordinate system of an entity/space.
Definition view_coordinates.hpp:35
std::array< uint8_t, 3 > coordinates
The directions of the [x, y, z] axes.
Definition view_coordinates.hpp:37
constexpr ViewCoordinates(uint8_t axis0, uint8_t axis1, uint8_t axis2)
Construct Vec3D from x/y/z values.
Definition view_coordinates.hpp:41