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`.
15 /// X and y ranges that should be visible.
17
18 public:
19 VisualBounds2D() = default;
20
21 VisualBounds2D(rerun::datatypes::Range2D range2d_) : range2d(range2d_) {}
22
23 VisualBounds2D& operator=(rerun::datatypes::Range2D range2d_) {
24 range2d = range2d_;
25 return *this;
26 }
27
28 /// Cast to the underlying Range2D datatype
29 operator rerun::datatypes::Range2D() const {
30 return range2d;
31 }
32 };
33} // namespace rerun::blueprint::components
34
35namespace rerun {
36 static_assert(
38 );
39
40 /// \private
41 template <>
42 struct Loggable<blueprint::components::VisualBounds2D> {
43 static constexpr const char Name[] = "rerun.blueprint.components.VisualBounds2D";
44
45 /// Returns the arrow data type this type corresponds to.
46 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
48 }
49
50 /// Serializes an array of `rerun::blueprint:: components::VisualBounds2D` into an arrow array.
51 static Result<std::shared_ptr<arrow::Array>> to_arrow(
52 const blueprint::components::VisualBounds2D* instances, size_t num_instances
53 ) {
54 if (num_instances == 0) {
55 return Loggable<rerun::datatypes::Range2D>::to_arrow(nullptr, 0);
56 } else if (instances == nullptr) {
57 return rerun::Error(
58 ErrorCode::UnexpectedNullArgument,
59 "Passed array instances is null when num_elements> 0."
60 );
61 } else {
62 return Loggable<rerun::datatypes::Range2D>::to_arrow(
63 &instances->range2d,
64 num_instances
65 );
66 }
67 }
68 };
69} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
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:14
rerun::datatypes::Range2D range2d
X and y ranges that should be visible.
Definition visual_bounds2d.hpp:16
Datatype: An Axis-Aligned Bounding Box in 2D space, implemented as the minimum and maximum corners.
Definition range2d.hpp:20