Rerun C++ SDK
Loading...
Searching...
No Matches
pose_rotation_quat.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_quat.fbs".
3
4#pragma once
5
6#include "../datatypes/quaternion.hpp"
7#include "../result.hpp"
8
9#include <cstdint>
10#include <memory>
11
12namespace rerun::components {
13 /// **Component**: A 3D rotation expressed as a quaternion that doesn't propagate in the transform hierarchy.
14 ///
15 /// Note: although the x,y,z,w components of the quaternion will be passed through to the
16 /// datastore as provided, when used in the Viewer, quaternions will always be normalized.
19
20 public:
21 PoseRotationQuat() = default;
22
23 PoseRotationQuat(rerun::datatypes::Quaternion quaternion_) : quaternion(quaternion_) {}
24
25 PoseRotationQuat& operator=(rerun::datatypes::Quaternion quaternion_) {
26 quaternion = quaternion_;
27 return *this;
28 }
29
30 /// Cast to the underlying Quaternion datatype
32 return quaternion;
33 }
34 };
35} // namespace rerun::components
36
37namespace rerun {
38 static_assert(sizeof(rerun::datatypes::Quaternion) == sizeof(components::PoseRotationQuat));
39
40 /// \private
41 template <>
42 struct Loggable<components::PoseRotationQuat> {
43 static constexpr const char Name[] = "rerun.components.PoseRotationQuat";
44
45 /// Returns the arrow data type this type corresponds to.
46 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
47 return Loggable<rerun::datatypes::Quaternion>::arrow_datatype();
48 }
49
50 /// Serializes an array of `rerun::components::PoseRotationQuat` into an arrow array.
51 static Result<std::shared_ptr<arrow::Array>> to_arrow(
52 const components::PoseRotationQuat* instances, size_t num_instances
53 ) {
54 if (num_instances == 0) {
55 return Loggable<rerun::datatypes::Quaternion>::to_arrow(nullptr, 0);
56 } else if (instances == nullptr) {
57 return rerun::Error(
58 ErrorCode::UnexpectedNullArgument,
59 "Passed array instances is null when num_elements> 0."
60 );
61 } else {
62 return Loggable<rerun::datatypes::Quaternion>::to_arrow(
63 &instances->quaternion,
64 num_instances
65 );
66 }
67 }
68 };
69} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
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:22
Component: A 3D rotation expressed as a quaternion that doesn't propagate in the transform hierarchy.
Definition pose_rotation_quat.hpp:17
Datatype: A Quaternion represented by 4 real numbers.
Definition quaternion.hpp:24