Rerun C++ SDK
Loading...
Searching...
No Matches
visualizer_overrides.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/visualizer_overrides.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/visualizer_override.hpp"
7#include "../../collection.hpp"
8#include "../../component_batch.hpp"
9#include "../../component_column.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**: Override the visualizers for an entity.
19 ///
20 /// This archetype is a stop-gap mechanism based on the current implementation details
21 /// of the visualizer system. It is not intended to be a long-term solution, but provides
22 /// enough utility to be useful in the short term.
23 ///
24 /// **NOTE**: Rerun `v0.24` changed the behavior of `archetypes::VisualizerOverrides`, so that currently they only
25 /// work with time series views. We plan to bring this feature for all views in future versions.
26 ///
27 /// This can only be used as part of blueprints. It will have no effect if used
28 /// in a regular entity.
29 ///
30 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
31 ///
33 /// Names of the visualizers that should be active.
34 std::optional<ComponentBatch> ranges;
35
36 public:
37 /// The name of the archetype as used in `ComponentDescriptor`s.
38 static constexpr const char ArchetypeName[] =
39 "rerun.blueprint.archetypes.VisualizerOverrides";
40
41 /// `ComponentDescriptor` for the `ranges` field.
42 static constexpr auto Descriptor_ranges = ComponentDescriptor(
43 ArchetypeName, "VisualizerOverrides:ranges",
45 );
46
47 public:
48 VisualizerOverrides() = default;
50 VisualizerOverrides(const VisualizerOverrides& other) = default;
51 VisualizerOverrides& operator=(const VisualizerOverrides& other) = default;
52 VisualizerOverrides& operator=(VisualizerOverrides&& other) = default;
53
54 explicit VisualizerOverrides(
56 )
57 : ranges(ComponentBatch::from_loggable(std::move(_ranges), Descriptor_ranges)
58 .value_or_throw()) {}
59
60 /// Update only some specific fields of a `VisualizerOverrides`.
62 return VisualizerOverrides();
63 }
64
65 /// Clear all the fields of a `VisualizerOverrides`.
67
68 /// Names of the visualizers that should be active.
71 ) && {
72 ranges = ComponentBatch::from_loggable(_ranges, Descriptor_ranges).value_or_throw();
73 return std::move(*this);
74 }
75
76 /// Partitions the component data into multiple sub-batches.
77 ///
78 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
79 /// instead, via `ComponentBatch::partitioned`.
80 ///
81 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
82 ///
83 /// The specified `lengths` must sum to the total length of the component batch.
85
86 /// Partitions the component data into unit-length sub-batches.
87 ///
88 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
89 /// where `n` is automatically guessed.
91 };
92
93} // namespace rerun::blueprint::archetypes
94
95namespace rerun {
96 /// \private
97 template <typename T>
98 struct AsComponents;
99
100 /// \private
101 template <>
102 struct AsComponents<blueprint::archetypes::VisualizerOverrides> {
103 /// Serialize all set component batches.
104 static Result<Collection<ComponentBatch>> as_batches(
106 );
107 };
108} // 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
Arrow-encoded data of a single batch of components together with a component descriptor.
Definition component_batch.hpp:28
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: Override the visualizers for an entity.
Definition visualizer_overrides.hpp:32
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
static VisualizerOverrides clear_fields()
Clear all the fields of a VisualizerOverrides.
static constexpr auto Descriptor_ranges
ComponentDescriptor for the ranges field.
Definition visualizer_overrides.hpp:42
VisualizerOverrides with_ranges(const Collection< rerun::blueprint::components::VisualizerOverride > &_ranges) &&
Names of the visualizers that should be active.
Definition visualizer_overrides.hpp:69
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition visualizer_overrides.hpp:38
std::optional< ComponentBatch > ranges
Names of the visualizers that should be active.
Definition visualizer_overrides.hpp:34
static VisualizerOverrides update_fields()
Update only some specific fields of a VisualizerOverrides.
Definition visualizer_overrides.hpp:61
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.