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 "../../result.hpp"
11
12#include <cstdint>
13#include <optional>
14#include <utility>
15#include <vector>
16
17namespace rerun::blueprint::archetypes {
18 /// **Archetype**: Controls the visual bounds of a 2D view.
19 ///
20 /// Everything within these bounds are guaranteed to be visible.
21 /// Somethings outside of these bounds may also be visible due to letterboxing.
22 ///
23 /// If no visual bounds are set, it will be determined automatically,
24 /// based on the bounding-box of the data or other camera information present in the view.
25 ///
26 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
27 ///
29 /// Controls the visible range of a 2D view.
30 ///
31 /// Use this to control pan & zoom of the view.
32 std::optional<ComponentBatch> range;
33
34 public:
35 /// The name of the archetype as used in `ComponentDescriptor`s.
36 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.VisualBounds2D";
37
38 /// `ComponentDescriptor` for the `range` field.
39 static constexpr auto Descriptor_range = ComponentDescriptor(
40 ArchetypeName, "VisualBounds2D:range",
42 );
43
44 public:
45 VisualBounds2D() = default;
46 VisualBounds2D(VisualBounds2D&& other) = default;
47 VisualBounds2D(const VisualBounds2D& other) = default;
48 VisualBounds2D& operator=(const VisualBounds2D& other) = default;
49 VisualBounds2D& operator=(VisualBounds2D&& other) = default;
50
52 : range(ComponentBatch::from_loggable(std::move(_range), Descriptor_range)
53 .value_or_throw()) {}
54
55 /// Update only some specific fields of a `VisualBounds2D`.
57 return VisualBounds2D();
58 }
59
60 /// Clear all the fields of a `VisualBounds2D`.
62
63 /// Controls the visible range of a 2D view.
64 ///
65 /// Use this to control pan & zoom of the view.
67 range = ComponentBatch::from_loggable(_range, Descriptor_range).value_or_throw();
68 return std::move(*this);
69 }
70
71 /// Partitions the component data into multiple sub-batches.
72 ///
73 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
74 /// instead, via `ComponentBatch::partitioned`.
75 ///
76 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
77 ///
78 /// The specified `lengths` must sum to the total length of the component batch.
80
81 /// Partitions the component data into unit-length sub-batches.
82 ///
83 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
84 /// where `n` is automatically guessed.
86 };
87
88} // namespace rerun::blueprint::archetypes
89
90namespace rerun {
91 /// \private
92 template <typename T>
93 struct AsComponents;
94
95 /// \private
96 template <>
97 struct AsComponents<blueprint::archetypes::VisualBounds2D> {
98 /// Serialize all set component batches.
99 static Result<Collection<ComponentBatch>> as_batches(
101 );
102 };
103} // 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: Controls the visual bounds of a 2D view.
Definition visual_bounds2d.hpp:28
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:32
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:39
static VisualBounds2D update_fields()
Update only some specific fields of a VisualBounds2D.
Definition visual_bounds2d.hpp:56
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition visual_bounds2d.hpp:36
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:66
Component: Visual bounds in 2D space used for Spatial2DView.
Definition visual_bounds2d.hpp:17