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/components/material.fbs".
3
4#pragma once
5
6#include "../datatypes/material.hpp"
7#include "../datatypes/rgba32.hpp"
8#include "../result.hpp"
9
10#include <cstdint>
11#include <memory>
12#include <optional>
13
14namespace arrow {
15 class Array;
16 class DataType;
17 class StructBuilder;
18} // namespace arrow
19
20namespace rerun::components {
21 /// **Component**: Material properties of a mesh.
22 struct Material {
24
25 public:
26 // Extensions to generated type defined in 'material_ext.cpp'
27
28 static Material from_albedo_factor(rerun::datatypes::Rgba32 color) {
29 return Material(color);
30 }
31
32 public:
33 Material() = default;
34
35 Material(rerun::datatypes::Material material_) : material(material_) {}
36
37 Material& operator=(rerun::datatypes::Material material_) {
38 material = material_;
39 return *this;
40 }
41
42 Material(std::optional<rerun::datatypes::Rgba32> albedo_factor_)
43 : material(albedo_factor_) {}
44
45 Material& operator=(std::optional<rerun::datatypes::Rgba32> albedo_factor_) {
46 material = albedo_factor_;
47 return *this;
48 }
49
50 /// Cast to the underlying Material datatype
51 operator rerun::datatypes::Material() const {
52 return material;
53 }
54 };
55} // namespace rerun::components
56
57namespace rerun {
58 template <typename T>
59 struct Loggable;
60
61 /// \private
62 template <>
63 struct Loggable<components::Material> {
64 static constexpr const char Name[] = "rerun.components.Material";
65
66 /// Returns the arrow data type this type corresponds to.
67 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
68
69 /// Fills an arrow array builder with an array of this type.
70 static rerun::Error fill_arrow_array_builder(
71 arrow::StructBuilder* builder, const components::Material* elements, size_t num_elements
72 );
73
74 /// Serializes an array of `rerun::components::Material` into an arrow array.
75 static Result<std::shared_ptr<arrow::Array>> to_arrow(
76 const components::Material* instances, size_t num_instances
77 );
78 };
79} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:87
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:69
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
Datatype: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition rgba32.hpp:27