Rerun C++ SDK
Loading...
Searching...
No Matches
pose_rotation_axis_angle.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/rotation_axis_angle.fbs".
3
4#pragma once
5
6#include "../component_descriptor.hpp"
7#include "../datatypes/rotation_axis_angle.hpp"
8#include "../result.hpp"
9
10#include <cstdint>
11#include <memory>
12
13namespace rerun::components {
14 /// **Component**: 3D rotation represented by a rotation around a given axis that doesn't propagate in the transform hierarchy.
15 ///
16 /// If normalization of the rotation axis fails the rotation is treated as an invalid transform, unless the
17 /// angle is zero in which case it is treated as an identity.
20
21 public:
22 PoseRotationAxisAngle() = default;
23
25 : rotation(rotation_) {}
26
28 rotation = rotation_;
29 return *this;
30 }
31
32 /// Cast to the underlying RotationAxisAngle datatype
34 return rotation;
35 }
36 };
37} // namespace rerun::components
38
39namespace rerun {
40 static_assert(
41 sizeof(rerun::datatypes::RotationAxisAngle) == sizeof(components::PoseRotationAxisAngle)
42 );
43
44 /// \private
45 template <>
46 struct Loggable<components::PoseRotationAxisAngle> {
47 static constexpr ComponentDescriptor Descriptor = "rerun.components.PoseRotationAxisAngle";
48
49 /// Returns the arrow data type this type corresponds to.
50 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
51 return Loggable<rerun::datatypes::RotationAxisAngle>::arrow_datatype();
52 }
53
54 /// Serializes an array of `rerun::components::PoseRotationAxisAngle` into an arrow array.
55 static Result<std::shared_ptr<arrow::Array>> to_arrow(
56 const components::PoseRotationAxisAngle* instances, size_t num_instances
57 ) {
58 if (num_instances == 0) {
59 return Loggable<rerun::datatypes::RotationAxisAngle>::to_arrow(nullptr, 0);
60 } else if (instances == nullptr) {
61 return rerun::Error(
62 ErrorCode::UnexpectedNullArgument,
63 "Passed array instances is null when num_elements> 0."
64 );
65 } else {
66 return Loggable<rerun::datatypes::RotationAxisAngle>::to_arrow(
67 &instances->rotation,
68 num_instances
69 );
70 }
71 }
72 };
73} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:96
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:79
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Component: 3D rotation represented by a rotation around a given axis that doesn't propagate in the tr...
Definition pose_rotation_axis_angle.hpp:18
Datatype: 3D rotation represented by a rotation around a given axis.
Definition rotation_axis_angle.hpp:22