Rerun C++ SDK
Loading...
Searching...
No Matches
translation_and_mat3x3.hpp
1// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/re_types/definitions/rerun/datatypes/translation_and_mat3x3.fbs".
3
4#pragma once
5
6#include "../result.hpp"
7#include "mat3x3.hpp"
8#include "vec3d.hpp"
9
10#include <cstdint>
11#include <memory>
12#include <optional>
13
14namespace arrow {
15 class Array;
16 class DataType;
17 class StructBuilder;
18} // namespace arrow
19
20namespace rerun::datatypes {
21 /// **Datatype**: Representation of an affine transform via a 3x3 affine matrix paired with a translation.
22 ///
23 /// First applies the matrix, then the translation.
25 /// 3D translation, applied after the matrix.
26 std::optional<rerun::datatypes::Vec3D> translation;
27
28 /// 3x3 matrix for scale, rotation & shear.
29 std::optional<rerun::datatypes::Mat3x3> mat3x3;
30
31 /// If true, this transform is from the parent space to the space where the transform was logged.
32 ///
33 /// If false (default), the transform maps from this space to its parent,
34 /// i.e. the translation is the position in the parent space.
36
37 public:
38 // Extensions to generated type defined in 'translation_and_mat3x3_ext.cpp'
39
40 /// Identity transformation.
41 ///
42 /// Applying this transform does not alter an entity's transformation.
43 /// It has all optional fields set to `std::nullopt`.
45
46 /// Creates a new 3D transform from translation/matrix.
47 ///
48 /// \param translation_ \copydoc TranslationAndMat3x3::translation
49 /// \param mat3x3_ \copydoc TranslationAndMat3x3::mat3x3
50 /// \param from_parent_ \copydoc TranslationAndMat3x3::from_parent
52 const std::optional<Vec3D>& translation_, const std::optional<Mat3x3>& mat3x3_,
53 bool from_parent_
54 )
55 : translation(translation_), mat3x3(mat3x3_), from_parent(from_parent_) {}
56
57 /// From rotation only.
58 ///
59 /// \param mat3x3_ \copydoc TranslationAndMat3x3::mat3x3
60 /// \param from_parent_ \copydoc TranslationAndMat3x3::from_parent
61 TranslationAndMat3x3(const Mat3x3& mat3x3_, bool from_parent_ = false)
62 : translation(std::nullopt), mat3x3(mat3x3_), from_parent(from_parent_) {}
63
64 /// From translation only.
65 ///
66 /// \param translation_ \copydoc TranslationAndMat3x3::translation
67 /// \param from_parent_ \copydoc TranslationAndMat3x3::from_parent
68 TranslationAndMat3x3(const Vec3D& translation_, bool from_parent_ = false)
69 : translation(translation_), mat3x3(std::nullopt), from_parent(from_parent_) {}
70
71 public:
72 TranslationAndMat3x3() = default;
73 };
74} // namespace rerun::datatypes
75
76namespace rerun {
77 template <typename T>
78 struct Loggable;
79
80 /// \private
81 template <>
82 struct Loggable<datatypes::TranslationAndMat3x3> {
83 static constexpr const char Name[] = "rerun.datatypes.TranslationAndMat3x3";
84
85 /// Returns the arrow data type this type corresponds to.
86 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
87
88 /// Fills an arrow array builder with an array of this type.
89 static rerun::Error fill_arrow_array_builder(
90 arrow::StructBuilder* builder, const datatypes::TranslationAndMat3x3* elements,
91 size_t num_elements
92 );
93
94 /// Serializes an array of `rerun::datatypes::TranslationAndMat3x3` into an arrow array.
95 static Result<std::shared_ptr<arrow::Array>> to_arrow(
96 const datatypes::TranslationAndMat3x3* instances, size_t num_instances
97 );
98 };
99} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:87
All built-in datatypes. See Types in the Rerun manual.
Definition rerun.hpp:72
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:20
Datatype: A 3x3 Matrix.
Definition mat3x3.hpp:30
Datatype: Representation of an affine transform via a 3x3 affine matrix paired with a translation.
Definition translation_and_mat3x3.hpp:24
std::optional< rerun::datatypes::Vec3D > translation
3D translation, applied after the matrix.
Definition translation_and_mat3x3.hpp:26
static const TranslationAndMat3x3 IDENTITY
Identity transformation.
Definition translation_and_mat3x3.hpp:44
std::optional< rerun::datatypes::Mat3x3 > mat3x3
3x3 matrix for scale, rotation & shear.
Definition translation_and_mat3x3.hpp:29
TranslationAndMat3x3(const Vec3D &translation_, bool from_parent_=false)
From translation only.
Definition translation_and_mat3x3.hpp:68
TranslationAndMat3x3(const std::optional< Vec3D > &translation_, const std::optional< Mat3x3 > &mat3x3_, bool from_parent_)
Creates a new 3D transform from translation/matrix.
Definition translation_and_mat3x3.hpp:51
TranslationAndMat3x3(const Mat3x3 &mat3x3_, bool from_parent_=false)
From rotation only.
Definition translation_and_mat3x3.hpp:61
bool from_parent
If true, this transform is from the parent space to the space where the transform was logged.
Definition translation_and_mat3x3.hpp:35
Datatype: A vector in 3D space.
Definition vec3d.hpp:20