Rerun C++ SDK
Loading...
Searching...
No Matches
plot_interaction.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/build/re_type_definitions/rerun/blueprint/archetypes/plot_interaction.def.rs".
3
4#pragma once
5
6#include "../../archetype_utils.hpp"
7#include "../../blueprint/components/points_display.hpp"
8#include "../../blueprint/components/tooltip_mode.hpp"
9#include "../../collection.hpp"
10#include "../../component_batch.hpp"
11#include "../../component_column.hpp"
12#include "../../result.hpp"
13
14#include <cstdint>
15#include <optional>
16#include <utility>
17#include <vector>
18
19namespace rerun::blueprint::archetypes {
20 /// **Archetype**: Configuration for plot interaction behavior.
21 ///
22 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
23 ///
25 /// How the tooltip behaves when hovering over the plot.
26 std::optional<ComponentBatch> tooltip_mode;
27
28 /// When data point markers are displayed on line series.
29 std::optional<ComponentBatch> points_display;
30
31 public:
32 /// The name of the archetype as used in `ComponentDescriptor`s.
33 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.PlotInteraction";
34
35 /// `ComponentDescriptor` for the `tooltip_mode` field.
37 ArchetypeName, "PlotInteraction:tooltip_mode",
39 );
40 /// `ComponentDescriptor` for the `points_display` field.
42 ArchetypeName, "PlotInteraction:points_display",
44 );
45
46 public:
47 PlotInteraction() = default;
48 PlotInteraction(PlotInteraction&& other) = default;
49 PlotInteraction(const PlotInteraction& other) = default;
50 PlotInteraction& operator=(const PlotInteraction& other) = default;
51 PlotInteraction& operator=(PlotInteraction&& other) = default;
52
53 /// Update only some specific fields of a `PlotInteraction`.
55 return PlotInteraction();
56 }
57
58 /// Clear all the fields of a `PlotInteraction`.
60
61 /// How the tooltip behaves when hovering over the plot.
63 const rerun::blueprint::components::TooltipMode& _tooltip_mode
64 ) && {
66 .value_or_throw();
67 return std::move(*this);
68 }
69
70 /// When data point markers are displayed on line series.
72 const rerun::blueprint::components::PointsDisplay& _points_display
73 ) && {
76 .value_or_throw();
77 return std::move(*this);
78 }
79
80 /// Partitions the component data into multiple sub-batches.
81 ///
82 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
83 /// instead, via `ComponentBatch::partitioned`.
84 ///
85 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
86 ///
87 /// The specified `lengths` must sum to the total length of the component batch.
89 return detail::partition_batches({&tooltip_mode, &points_display}, lengths_)
90 .value_or_throw();
91 }
92
93 /// Partitions the component data into unit-length sub-batches.
94 ///
95 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
96 /// where `n` is automatically guessed.
98 return detail::partition_batches_of_unit_length({&tooltip_mode, &points_display})
99 .value_or_throw();
100 }
101 };
102
103} // namespace rerun::blueprint::archetypes
104
105namespace rerun {
106 /// \private
107 template <typename T>
108 struct AsComponents;
109
110 /// \private
111 template <>
112 struct AsComponents<blueprint::archetypes::PlotInteraction> {
113 /// Serialize all set component batches.
114 static Result<Collection<ComponentBatch>> as_batches(
116 ) {
117 return detail::collect_batches({&archetype.tooltip_mode, &archetype.points_display});
118 }
119 };
120} // 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:26
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 for plot interaction behavior.
Definition plot_interaction.hpp:24
static constexpr auto Descriptor_tooltip_mode
ComponentDescriptor for the tooltip_mode field.
Definition plot_interaction.hpp:36
std::optional< ComponentBatch > tooltip_mode
How the tooltip behaves when hovering over the plot.
Definition plot_interaction.hpp:26
PlotInteraction with_tooltip_mode(const rerun::blueprint::components::TooltipMode &_tooltip_mode) &&
How the tooltip behaves when hovering over the plot.
Definition plot_interaction.hpp:62
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition plot_interaction.hpp:88
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition plot_interaction.hpp:33
std::optional< ComponentBatch > points_display
When data point markers are displayed on line series.
Definition plot_interaction.hpp:29
static PlotInteraction clear_fields()
Clear all the fields of a PlotInteraction.
static constexpr auto Descriptor_points_display
ComponentDescriptor for the points_display field.
Definition plot_interaction.hpp:41
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition plot_interaction.hpp:97
PlotInteraction with_points_display(const rerun::blueprint::components::PointsDisplay &_points_display) &&
When data point markers are displayed on line series.
Definition plot_interaction.hpp:71
static PlotInteraction update_fields()
Update only some specific fields of a PlotInteraction.
Definition plot_interaction.hpp:54