// 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/material.fbs".

#pragma once

#include "../result.hpp"
#include "rgba32.hpp"

#include <cstdint>
#include <memory>
#include <optional>

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

namespace rerun {
    namespace datatypes {
        /// **Datatype**: Material properties of a mesh.
        struct Material {
            /// Optional color multiplier.
            std::optional<rerun::datatypes::Rgba32> albedo_factor;

          public:
            Material() = default;

            Material(std::optional<rerun::datatypes::Rgba32> albedo_factor_)
                : albedo_factor(albedo_factor_) {}

            Material& operator=(std::optional<rerun::datatypes::Rgba32> albedo_factor_) {
                albedo_factor = albedo_factor_;
                return *this;
            }

            Material(uint32_t rgba_) : albedo_factor(rgba_) {}

            Material& operator=(uint32_t rgba_) {
                albedo_factor = rgba_;
                return *this;
            }

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

            /// Creates a new array builder with an array of this type.
            static Result<std::shared_ptr<arrow::StructBuilder>> new_arrow_array_builder(
                arrow::MemoryPool* memory_pool
            );

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