Rerun C++ SDK
Loading...
Searching...
No Matches
material.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/datatypes/material.fbs".
3
4#pragma once
5
6#include "../result.hpp"
7#include "rgba32.hpp"
8
9#include <cstdint>
10#include <memory>
11#include <optional>
12
13namespace arrow {
14 class Array;
15 class DataType;
16 class StructBuilder;
17} // namespace arrow
18
19namespace rerun::datatypes {
20 /// **Datatype**: Material properties of a mesh.
21 struct Material {
22 /// Optional color multiplier.
23 std::optional<rerun::datatypes::Rgba32> albedo_factor;
24
25 public:
26 Material() = default;
27
28 Material(std::optional<rerun::datatypes::Rgba32> albedo_factor_)
29 : albedo_factor(albedo_factor_) {}
30
31 Material& operator=(std::optional<rerun::datatypes::Rgba32> albedo_factor_) {
32 albedo_factor = albedo_factor_;
33 return *this;
34 }
35
36 Material(uint32_t rgba_) : albedo_factor(rgba_) {}
37
38 Material& operator=(uint32_t rgba_) {
39 albedo_factor = rgba_;
40 return *this;
41 }
42 };
43} // namespace rerun::datatypes
44
45namespace rerun {
46 template <typename T>
47 struct Loggable;
48
49 /// \private
50 template <>
51 struct Loggable<datatypes::Material> {
52 static constexpr const char Name[] = "rerun.datatypes.Material";
53
54 /// Returns the arrow data type this type corresponds to.
55 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
56
57 /// Fills an arrow array builder with an array of this type.
58 static rerun::Error fill_arrow_array_builder(
59 arrow::StructBuilder* builder, const datatypes::Material* elements, size_t num_elements
60 );
61
62 /// Serializes an array of `rerun::datatypes::Material` into an arrow array.
63 static Result<std::shared_ptr<arrow::Array>> to_arrow(
64 const datatypes::Material* instances, size_t num_instances
65 );
66 };
67} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:87
All built-in datatypes. See Types in the Rerun manual.
Definition rerun.hpp:72
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:20
Component: Material properties of a mesh.
Definition material.hpp:22
Datatype: Material properties of a mesh.
Definition material.hpp:21
std::optional< rerun::datatypes::Rgba32 > albedo_factor
Optional color multiplier.
Definition material.hpp:23