Rerun C++ SDK
Loading...
Searching...
No Matches
pose_transform_mat3x3.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/components/transform_mat3x3.fbs".
3
4#pragma once
5
6#include "../datatypes/mat3x3.hpp"
7#include "../result.hpp"
8
9#include <array>
10#include <cstdint>
11#include <memory>
12
13namespace rerun::components {
14 /// **Component**: A 3x3 transformation matrix Matrix that doesn't propagate in the transform hierarchy.
15 ///
16 /// 3x3 matrixes are able to represent any affine transformation in 3D space,
17 /// i.e. rotation, scaling, shearing, reflection etc.
18 ///
19 /// Matrices in Rerun are stored as flat list of coefficients in column-major order:
20 /// ```text
21 /// column 0 column 1 column 2
22 /// -------------------------------------------------
23 /// row 0 | flat_columns[0] flat_columns[3] flat_columns[6]
24 /// row 1 | flat_columns[1] flat_columns[4] flat_columns[7]
25 /// row 2 | flat_columns[2] flat_columns[5] flat_columns[8]
26 /// ```
29
30 public:
31 PoseTransformMat3x3() = default;
32
33 PoseTransformMat3x3(rerun::datatypes::Mat3x3 matrix_) : matrix(matrix_) {}
34
36 matrix = matrix_;
37 return *this;
38 }
39
40 PoseTransformMat3x3(std::array<float, 9> flat_columns_) : matrix(flat_columns_) {}
41
42 PoseTransformMat3x3& operator=(std::array<float, 9> flat_columns_) {
43 matrix = flat_columns_;
44 return *this;
45 }
46
47 /// Cast to the underlying Mat3x3 datatype
48 operator rerun::datatypes::Mat3x3() const {
49 return matrix;
50 }
51 };
52} // namespace rerun::components
53
54namespace rerun {
55 static_assert(sizeof(rerun::datatypes::Mat3x3) == sizeof(components::PoseTransformMat3x3));
56
57 /// \private
58 template <>
59 struct Loggable<components::PoseTransformMat3x3> {
60 static constexpr const char Name[] = "rerun.components.PoseTransformMat3x3";
61
62 /// Returns the arrow data type this type corresponds to.
63 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
64 return Loggable<rerun::datatypes::Mat3x3>::arrow_datatype();
65 }
66
67 /// Serializes an array of `rerun::components::PoseTransformMat3x3` into an arrow array.
68 static Result<std::shared_ptr<arrow::Array>> to_arrow(
69 const components::PoseTransformMat3x3* instances, size_t num_instances
70 ) {
71 return Loggable<rerun::datatypes::Mat3x3>::to_arrow(&instances->matrix, num_instances);
72 }
73 };
74} // namespace rerun
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:75
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Component: A 3x3 transformation matrix Matrix that doesn't propagate in the transform hierarchy.
Definition pose_transform_mat3x3.hpp:27
Datatype: A 3x3 Matrix.
Definition mat3x3.hpp:31