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/components/visual_bounds2d.fbs".
3
4#pragma once
5
6#include "../../datatypes/range2d.hpp"
7#include "../../result.hpp"
8
9#include <cstdint>
10#include <memory>
11
12namespace rerun::blueprint::components {
13 /// **Component**: Visual bounds in 2D space used for `Spatial2DView`.
14 ///
15 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
16 ///
18 /// X and y ranges that should be visible.
20
21 public:
22 VisualBounds2D() = default;
23
24 VisualBounds2D(rerun::datatypes::Range2D range2d_) : range2d(range2d_) {}
25
26 VisualBounds2D& operator=(rerun::datatypes::Range2D range2d_) {
27 range2d = range2d_;
28 return *this;
29 }
30
31 /// Cast to the underlying Range2D datatype
32 operator rerun::datatypes::Range2D() const {
33 return range2d;
34 }
35 };
36} // namespace rerun::blueprint::components
37
38namespace rerun {
39 static_assert(
41 );
42
43 /// \private
44 template <>
45 struct Loggable<blueprint::components::VisualBounds2D> {
46 static constexpr std::string_view ComponentType =
47 "rerun.blueprint.components.VisualBounds2D";
48
49 /// Returns the arrow data type this type corresponds to.
50 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
52 }
53
54 /// Serializes an array of `rerun::blueprint:: components::VisualBounds2D` into an arrow array.
55 static Result<std::shared_ptr<arrow::Array>> to_arrow(
56 const blueprint::components::VisualBounds2D* instances, size_t num_instances
57 ) {
58 if (num_instances == 0) {
59 return Loggable<rerun::datatypes::Range2D>::to_arrow(nullptr, 0);
60 } else if (instances == nullptr) {
61 return rerun::Error(
62 ErrorCode::UnexpectedNullArgument,
63 "Passed array instances is null when num_elements> 0."
64 );
65 } else {
66 return Loggable<rerun::datatypes::Range2D>::to_arrow(
67 &instances->range2d,
68 num_instances
69 );
70 }
71 }
72 };
73} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:99
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
A type of component that can be registered.
Definition component_type.hpp:19
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Component: Visual bounds in 2D space used for Spatial2DView.
Definition visual_bounds2d.hpp:17
rerun::datatypes::Range2D range2d
X and y ranges that should be visible.
Definition visual_bounds2d.hpp:19
Datatype: An Axis-Aligned Bounding Box in 2D space, implemented as the minimum and maximum corners.
Definition range2d.hpp:20