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.
26 ///
27 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
28 ///
30 /// Controls the visible range of a 2D view.
31 ///
32 /// Use this to control pan & zoom of the view.
33 std::optional<ComponentBatch> range;
34
35 public:
36 static constexpr const char IndicatorComponentName[] =
37 "rerun.blueprint.components.VisualBounds2DIndicator";
38
39 /// Indicator component, used to identify the archetype when converting to a list of components.
41 /// The name of the archetype as used in `ComponentDescriptor`s.
42 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.VisualBounds2D";
43
44 /// `ComponentDescriptor` for the `range` field.
45 static constexpr auto Descriptor_range = ComponentDescriptor(
46 ArchetypeName, "range",
48 );
49
50 public:
51 VisualBounds2D() = default;
52 VisualBounds2D(VisualBounds2D&& other) = default;
53 VisualBounds2D(const VisualBounds2D& other) = default;
54 VisualBounds2D& operator=(const VisualBounds2D& other) = default;
55 VisualBounds2D& operator=(VisualBounds2D&& other) = default;
56
58 : range(ComponentBatch::from_loggable(std::move(_range), Descriptor_range)
59 .value_or_throw()) {}
60
61 /// Update only some specific fields of a `VisualBounds2D`.
63 return VisualBounds2D();
64 }
65
66 /// Clear all the fields of a `VisualBounds2D`.
68
69 /// Controls the visible range of a 2D view.
70 ///
71 /// Use this to control pan & zoom of the view.
73 range = ComponentBatch::from_loggable(_range, Descriptor_range).value_or_throw();
74 return std::move(*this);
75 }
76
77 /// Partitions the component data into multiple sub-batches.
78 ///
79 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
80 /// instead, via `ComponentBatch::partitioned`.
81 ///
82 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
83 ///
84 /// The specified `lengths` must sum to the total length of the component batch.
86
87 /// Partitions the component data into unit-length sub-batches.
88 ///
89 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
90 /// where `n` is automatically guessed.
92 };
93
94} // namespace rerun::blueprint::archetypes
95
96namespace rerun {
97 /// \private
98 template <typename T>
99 struct AsComponents;
100
101 /// \private
102 template <>
103 struct AsComponents<blueprint::archetypes::VisualBounds2D> {
104 /// Serialize all set component batches.
105 static Result<Collection<ComponentBatch>> as_batches(
107 );
108 };
109} // 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:29
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:33
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:45
static VisualBounds2D update_fields()
Update only some specific fields of a VisualBounds2D.
Definition visual_bounds2d.hpp:62
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition visual_bounds2d.hpp:42
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:72
Component: Visual bounds in 2D space used for Spatial2DView.
Definition visual_bounds2d.hpp:18
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:32