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/build/re_type_definitions/rerun/encodings/view_coordinates.def.rs".
3
4#pragma once
5
6#include "../result.hpp"
7#include "view_dir.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::encodings {
20 /// **Encoding**: An orientation convention for three-dimensional coordinates.
21 ///
22 /// The three directions are always ordered as [x, y, z] and specify where each positive axis points.
23 /// For example, [Right, Down, Forward] means that +X points right, +Y points down, and +Z points forward.
24 ///
25 /// ⚠ [Rerun does not yet support left-handed coordinate systems](https://github.com/rerun-io/rerun/issues/5032).
26 ///
27 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
28 ///
30 /// The directions of the [x, y, z] axes.
31 std::array<rerun::encodings::ViewDir, 3> coordinates;
32
33 public: // START of extensions from view_coordinates_ext.cpp:
34 /// Construct `ViewCoordinates` from x/y/z values.
35 explicit constexpr ViewCoordinates(uint8_t axis0, uint8_t axis1, uint8_t axis2)
37 static_cast<rerun::encodings::ViewDir>(axis0),
38 static_cast<rerun::encodings::ViewDir>(axis1),
39 static_cast<rerun::encodings::ViewDir>(axis2)
40 } {}
41
42 /// Construct `ViewCoordinates` from x/y/z enum values.
43 explicit constexpr ViewCoordinates(
46 )
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<rerun::encodings::ViewDir, 3> coordinates_)
55 : coordinates(coordinates_) {}
56
57 ViewCoordinates& operator=(std::array<rerun::encodings::ViewDir, 3> coordinates_) {
58 coordinates = coordinates_;
59 return *this;
60 }
61 };
62} // namespace rerun::encodings
63
64namespace rerun {
65 template <typename T>
66 struct Loggable;
67
68 /// \private
69 template <>
70 struct Loggable<encodings::ViewCoordinates> {
71 static constexpr std::string_view ComponentType = "rerun.encodings.ViewCoordinates";
72
73 /// Returns the arrow data type this type corresponds to.
74 static const std::shared_ptr<arrow::DataType>& arrow_data_type();
75
76 /// Serializes an array of `rerun::encodings::ViewCoordinates` into an arrow array.
77 static Result<std::shared_ptr<arrow::Array>> to_arrow(
78 const encodings::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 encodings::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:103
All built-in encodings. See Types in the Rerun manual.
Definition rerun.hpp:96
ViewDir
Encoding: The six cardinal directions for 3D view-space.
Definition view_dir.hpp:27
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26
Archetype: Sets the default orientation for 3D views at or below this entity.
Definition view_coordinates.hpp:58
Encoding: An orientation convention for three-dimensional coordinates.
Definition view_coordinates.hpp:29
constexpr ViewCoordinates(uint8_t axis0, uint8_t axis1, uint8_t axis2)
Construct ViewCoordinates from x/y/z values.
Definition view_coordinates.hpp:35
constexpr ViewCoordinates(rerun::encodings::ViewDir axis0, rerun::encodings::ViewDir axis1, rerun::encodings::ViewDir axis2)
Construct ViewCoordinates from x/y/z enum values.
Definition view_coordinates.hpp:43
std::array< rerun::encodings::ViewDir, 3 > coordinates
The directions of the [x, y, z] axes.
Definition view_coordinates.hpp:31