Rerun C++ SDK
Loading...
Searching...
No Matches
visual_bounds2d.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/visual_bounds2d.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/visual_bounds2d.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**: Controls the visual bounds of a 2D view.
20 ///
21 /// Everything within these bounds are guaranteed to be visible.
22 /// Somethings outside of these bounds may also be visible due to letterboxing.
23 ///
24 /// If no visual bounds are set, it will be determined automatically,
25 /// based on the bounding-box of the data or other camera information present in the view.
27 /// Controls the visible range of a 2D view.
28 ///
29 /// Use this to control pan & zoom of the view.
30 std::optional<ComponentBatch> range;
31
32 public:
33 static constexpr const char IndicatorComponentName[] =
34 "rerun.blueprint.components.VisualBounds2DIndicator";
35
36 /// Indicator component, used to identify the archetype when converting to a list of components.
38 /// The name of the archetype as used in `ComponentDescriptor`s.
39 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.VisualBounds2D";
40
41 /// `ComponentDescriptor` for the `range` field.
42 static constexpr auto Descriptor_range = ComponentDescriptor(
43 ArchetypeName, "range",
45 );
46
47 public:
48 VisualBounds2D() = default;
49 VisualBounds2D(VisualBounds2D&& other) = default;
50 VisualBounds2D(const VisualBounds2D& other) = default;
51 VisualBounds2D& operator=(const VisualBounds2D& other) = default;
52 VisualBounds2D& operator=(VisualBounds2D&& other) = default;
53
55 : range(ComponentBatch::from_loggable(std::move(_range), Descriptor_range)
56 .value_or_throw()) {}
57
58 /// Update only some specific fields of a `VisualBounds2D`.
60 return VisualBounds2D();
61 }
62
63 /// Clear all the fields of a `VisualBounds2D`.
65
66 /// Controls the visible range of a 2D view.
67 ///
68 /// Use this to control pan & zoom of the view.
70 range = ComponentBatch::from_loggable(_range, Descriptor_range).value_or_throw();
71 return std::move(*this);
72 }
73
74 /// Partitions the component data into multiple sub-batches.
75 ///
76 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
77 /// instead, via `ComponentBatch::partitioned`.
78 ///
79 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
80 ///
81 /// The specified `lengths` must sum to the total length of the component batch.
83
84 /// Partitions the component data into unit-length sub-batches.
85 ///
86 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
87 /// where `n` is automatically guessed.
89 };
90
91} // namespace rerun::blueprint::archetypes
92
93namespace rerun {
94 /// \private
95 template <typename T>
96 struct AsComponents;
97
98 /// \private
99 template <>
100 struct AsComponents<blueprint::archetypes::VisualBounds2D> {
101 /// Serialize all set component batches.
102 static Result<Collection<ComponentBatch>> as_batches(
104 );
105 };
106} // 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: Controls the visual bounds of a 2D view.
Definition visual_bounds2d.hpp:26
static VisualBounds2D clear_fields()
Clear all the fields of a VisualBounds2D.
std::optional< ComponentBatch > range
Controls the visible range of a 2D view.
Definition visual_bounds2d.hpp:30
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
static constexpr auto Descriptor_range
ComponentDescriptor for the range field.
Definition visual_bounds2d.hpp:42
static VisualBounds2D update_fields()
Update only some specific fields of a VisualBounds2D.
Definition visual_bounds2d.hpp:59
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition visual_bounds2d.hpp:39
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
VisualBounds2D with_range(const rerun::blueprint::components::VisualBounds2D &_range) &&
Controls the visible range of a 2D view.
Definition visual_bounds2d.hpp:69
Component: Visual bounds in 2D space used for Spatial2DView.
Definition visual_bounds2d.hpp:15
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:32