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 "../../indicator_component.hpp"
11#include "../../result.hpp"
12
13#include <cstdint>
14#include <optional>
15#include <utility>
16#include <vector>
17
18namespace rerun::blueprint::archetypes {
19 /// **Archetype**: Override the visualizers for an entity.
20 ///
21 /// This archetype is a stop-gap mechanism based on the current implementation details
22 /// of the visualizer system. It is not intended to be a long-term solution, but provides
23 /// enough utility to be useful in the short term.
24 ///
25 /// The long-term solution is likely to be based off: <https://github.com/rerun-io/rerun/issues/6626>
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 static constexpr const char IndicatorComponentName[] =
38 "rerun.blueprint.components.VisualizerOverridesIndicator";
39
40 /// Indicator component, used to identify the archetype when converting to a list of components.
42 /// The name of the archetype as used in `ComponentDescriptor`s.
43 static constexpr const char ArchetypeName[] =
44 "rerun.blueprint.archetypes.VisualizerOverrides";
45
46 /// `ComponentDescriptor` for the `ranges` field.
47 static constexpr auto Descriptor_ranges = ComponentDescriptor(
48 ArchetypeName, "ranges",
50 );
51
52 public:
53 VisualizerOverrides() = default;
55 VisualizerOverrides(const VisualizerOverrides& other) = default;
56 VisualizerOverrides& operator=(const VisualizerOverrides& other) = default;
57 VisualizerOverrides& operator=(VisualizerOverrides&& other) = default;
58
59 explicit VisualizerOverrides(
61 )
62 : ranges(ComponentBatch::from_loggable(std::move(_ranges), Descriptor_ranges)
63 .value_or_throw()) {}
64
65 /// Update only some specific fields of a `VisualizerOverrides`.
67 return VisualizerOverrides();
68 }
69
70 /// Clear all the fields of a `VisualizerOverrides`.
72
73 /// Names of the visualizers that should be active.
76 ) && {
77 ranges = ComponentBatch::from_loggable(_ranges, Descriptor_ranges).value_or_throw();
78 return std::move(*this);
79 }
80
81 /// Partitions the component data into multiple sub-batches.
82 ///
83 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
84 /// instead, via `ComponentBatch::partitioned`.
85 ///
86 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
87 ///
88 /// The specified `lengths` must sum to the total length of the component batch.
90
91 /// Partitions the component data into unit-length sub-batches.
92 ///
93 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
94 /// where `n` is automatically guessed.
96 };
97
98} // namespace rerun::blueprint::archetypes
99
100namespace rerun {
101 /// \private
102 template <typename T>
103 struct AsComponents;
104
105 /// \private
106 template <>
107 struct AsComponents<blueprint::archetypes::VisualizerOverrides> {
108 /// Serialize all set component batches.
109 static Result<Collection<ComponentBatch>> as_batches(
111 );
112 };
113} // 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=rerun::Loggable< T >::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:14
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:47
VisualizerOverrides with_ranges(const Collection< rerun::blueprint::components::VisualizerOverride > &_ranges) &&
Names of the visualizers that should be active.
Definition visualizer_overrides.hpp:74
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition visualizer_overrides.hpp:43
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:66
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:32