Rerun C++ SDK
Loading...
Searching...
No Matches
rotation3d.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/components/rotation3d.fbs".
3
4#pragma once
5
6#include "../datatypes/rotation3d.hpp"
7#include "../rerun_sdk_export.hpp"
8#include "../result.hpp"
9
10#include <cstdint>
11#include <memory>
12
13namespace rerun::components {
14 /// **Component**: A 3D rotation, represented either by a quaternion or a rotation around axis.
15 struct Rotation3D {
16 /// Representation of the rotation.
18
19 public:
20 // Extensions to generated type defined in 'rotation3d_ext.cpp'
21
22 RERUN_SDK_EXPORT static const Rotation3D IDENTITY;
23
24 /// Construct Rotation3d from Quaternion.
25 Rotation3D(datatypes::Quaternion quaternion) : repr{quaternion} {}
26
27 /// Construct Rotation3d from axis-angle
28 Rotation3D(datatypes::RotationAxisAngle axis_angle) : repr{axis_angle} {}
29
30 public:
31 Rotation3D() = default;
32
34
36 repr = repr_;
37 return *this;
38 }
39
40 /// Cast to the underlying Rotation3D datatype
42 return repr;
43 }
44 };
45} // namespace rerun::components
46
47namespace rerun {
48 static_assert(sizeof(rerun::datatypes::Rotation3D) == sizeof(components::Rotation3D));
49
50 /// \private
51 template <>
52 struct Loggable<components::Rotation3D> {
53 static constexpr const char Name[] = "rerun.components.Rotation3D";
54
55 /// Returns the arrow data type this type corresponds to.
56 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
57 return Loggable<rerun::datatypes::Rotation3D>::arrow_datatype();
58 }
59
60 /// Serializes an array of `rerun::components::Rotation3D` into an arrow array.
61 static Result<std::shared_ptr<arrow::Array>> to_arrow(
62 const components::Rotation3D* instances, size_t num_instances
63 ) {
64 return Loggable<rerun::datatypes::Rotation3D>::to_arrow(
65 &instances->repr,
66 num_instances
67 );
68 }
69 };
70} // 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:21
Component: A 3D rotation, represented either by a quaternion or a rotation around axis.
Definition rotation3d.hpp:15
Rotation3D(datatypes::Quaternion quaternion)
Construct Rotation3d from Quaternion.
Definition rotation3d.hpp:25
rerun::datatypes::Rotation3D repr
Representation of the rotation.
Definition rotation3d.hpp:17
Rotation3D(datatypes::RotationAxisAngle axis_angle)
Construct Rotation3d from axis-angle.
Definition rotation3d.hpp:28
Datatype: A Quaternion represented by 4 real numbers.
Definition quaternion.hpp:24
Datatype: A 3D rotation.
Definition rotation3d.hpp:60
Datatype: 3D rotation represented by a rotation around a given axis.
Definition rotation_axis_angle.hpp:21