// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/cpp/mod.rs
// Based on "crates/re_types/definitions/rerun/datatypes/rotation_axis_angle.fbs".

#pragma once

#include "../result.hpp"
#include "angle.hpp"
#include "vec3d.hpp"

#include <cstdint>
#include <memory>

namespace arrow {
    class Array;
    class DataType;
    class StructBuilder;
} // namespace arrow

namespace rerun::datatypes {
    /// **Datatype**: 3D rotation represented by a rotation around a given axis.
    struct RotationAxisAngle {
        /// Axis to rotate around.
        ///
        /// This is not required to be normalized.
        /// If normalization fails (typically because the vector is length zero), the rotation is silently
        /// ignored.
        rerun::datatypes::Vec3D axis;

        /// How much to rotate around the axis.
        rerun::datatypes::Angle angle;

      public:
        // Extensions to generated type defined in 'rotation_axis_angle_ext.cpp'

        RotationAxisAngle(const Vec3D& _axis, const Angle& _angle) : axis(_axis), angle(_angle) {}

      public:
        RotationAxisAngle() = default;
    };
} // namespace rerun::datatypes

namespace rerun {
    template <typename T>
    struct Loggable;

    /// \private
    template <>
    struct Loggable<datatypes::RotationAxisAngle> {
        static constexpr const char Name[] = "rerun.datatypes.RotationAxisAngle";

        /// Returns the arrow data type this type corresponds to.
        static const std::shared_ptr<arrow::DataType>& arrow_datatype();

        /// Serializes an array of `rerun::datatypes::RotationAxisAngle` into an arrow array.
        static Result<std::shared_ptr<arrow::Array>> to_arrow(
            const datatypes::RotationAxisAngle* instances, size_t num_instances
        );

        /// Fills an arrow array builder with an array of this type.
        static rerun::Error fill_arrow_array_builder(
            arrow::StructBuilder* builder, const datatypes::RotationAxisAngle* elements,
            size_t num_elements
        );
    };
} // namespace rerun
