Rerun C++ SDK
Loading...
Searching...
No Matches
graph_background.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/blueprint/archetypes/background.fbs".
3
4#pragma once
5
6#include "../../collection.hpp"
7#include "../../component_batch.hpp"
8#include "../../component_column.hpp"
9#include "../../components/color.hpp"
10#include "../../result.hpp"
11
12#include <cstdint>
13#include <optional>
14#include <utility>
15#include <vector>
16
17namespace rerun::blueprint::archetypes {
18 /// **Archetype**: Configuration of a background in a graph view.
19 ///
20 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
21 ///
23 /// Color used for the background.
24 std::optional<ComponentBatch> color;
25
26 public:
27 /// The name of the archetype as used in `ComponentDescriptor`s.
28 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.GraphBackground";
29
30 /// `ComponentDescriptor` for the `color` field.
31 static constexpr auto Descriptor_color = ComponentDescriptor(
32 ArchetypeName, "GraphBackground:color",
34 );
35
36 public:
37 GraphBackground() = default;
38 GraphBackground(GraphBackground&& other) = default;
39 GraphBackground(const GraphBackground& other) = default;
40 GraphBackground& operator=(const GraphBackground& other) = default;
41 GraphBackground& operator=(GraphBackground&& other) = default;
42
43 /// Update only some specific fields of a `GraphBackground`.
45 return GraphBackground();
46 }
47
48 /// Clear all the fields of a `GraphBackground`.
50
51 /// Color used for the background.
53 color = ComponentBatch::from_loggable(_color, Descriptor_color).value_or_throw();
54 return std::move(*this);
55 }
56
57 /// Partitions the component data into multiple sub-batches.
58 ///
59 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
60 /// instead, via `ComponentBatch::partitioned`.
61 ///
62 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
63 ///
64 /// The specified `lengths` must sum to the total length of the component batch.
66
67 /// Partitions the component data into unit-length sub-batches.
68 ///
69 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
70 /// where `n` is automatically guessed.
72 };
73
74} // namespace rerun::blueprint::archetypes
75
76namespace rerun {
77 /// \private
78 template <typename T>
79 struct AsComponents;
80
81 /// \private
82 template <>
83 struct AsComponents<blueprint::archetypes::GraphBackground> {
84 /// Serialize all set component batches.
85 static Result<Collection<ComponentBatch>> as_batches(
87 );
88 };
89} // namespace rerun
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
A class for representing either a usable value, or an error.
Definition result.hpp:14
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
static Result< ComponentBatch > from_loggable(const rerun::Collection< T > &components, const ComponentDescriptor &descriptor)
Creates a new component batch from a collection of component instances.
Definition component_batch.hpp:46
A ComponentDescriptor fully describes the semantics of a column of data.
Definition component_descriptor.hpp:16
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Archetype: Configuration of a background in a graph view.
Definition graph_background.hpp:22
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition graph_background.hpp:28
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
std::optional< ComponentBatch > color
Color used for the background.
Definition graph_background.hpp:24
GraphBackground with_color(const rerun::components::Color &_color) &&
Color used for the background.
Definition graph_background.hpp:52
static GraphBackground clear_fields()
Clear all the fields of a GraphBackground.
static GraphBackground update_fields()
Update only some specific fields of a GraphBackground.
Definition graph_background.hpp:44
static constexpr auto Descriptor_color
ComponentDescriptor for the color field.
Definition graph_background.hpp:31
Component: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition color.hpp:17