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