Rerun C++ SDK
Loading...
Searching...
No Matches
half_sizes3d.hpp
1// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/re_types/definitions/rerun/components/half_sizes3d.fbs".
3
4#pragma once
5
6#include "../datatypes/vec3d.hpp"
7#include "../result.hpp"
8
9#include <array>
10#include <cstdint>
11#include <memory>
12
13namespace arrow {
14 class Array;
15 class DataType;
16 class FixedSizeListBuilder;
17} // namespace arrow
18
19namespace rerun::components {
20 /// **Component**: Half-sizes (extents) of a 3D box along its local axis, starting at its local origin/center.
21 ///
22 /// The box extends both in negative and positive direction along each axis.
23 /// Negative sizes indicate that the box is flipped along the respective axis, but this has no effect on how it is displayed.
24 struct HalfSizes3D {
26
27 public:
28 // Extensions to generated type defined in 'half_sizes3d_ext.cpp'
29
30 /// Construct HalfSizes3D from x/y/z values.
31 HalfSizes3D(float x, float y, float z) : xyz{x, y, z} {}
32
33 float x() const {
34 return xyz.x();
35 }
36
37 float y() const {
38 return xyz.y();
39 }
40
41 float z() const {
42 return xyz.z();
43 }
44
45 public:
46 HalfSizes3D() = default;
47
48 HalfSizes3D(rerun::datatypes::Vec3D xyz_) : xyz(xyz_) {}
49
50 HalfSizes3D& operator=(rerun::datatypes::Vec3D xyz_) {
51 xyz = xyz_;
52 return *this;
53 }
54
55 HalfSizes3D(std::array<float, 3> xyz_) : xyz(xyz_) {}
56
57 HalfSizes3D& operator=(std::array<float, 3> xyz_) {
58 xyz = xyz_;
59 return *this;
60 }
61
62 /// Cast to the underlying Vec3D datatype
63 operator rerun::datatypes::Vec3D() const {
64 return xyz;
65 }
66 };
67} // namespace rerun::components
68
69namespace rerun {
70 template <typename T>
71 struct Loggable;
72
73 /// \private
74 template <>
75 struct Loggable<components::HalfSizes3D> {
76 static constexpr const char Name[] = "rerun.components.HalfSizes3D";
77
78 /// Returns the arrow data type this type corresponds to.
79 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
80
81 /// Fills an arrow array builder with an array of this type.
82 static rerun::Error fill_arrow_array_builder(
83 arrow::FixedSizeListBuilder* builder, const components::HalfSizes3D* elements,
84 size_t num_elements
85 );
86
87 /// Serializes an array of `rerun::components::HalfSizes3D` into an arrow array.
88 static Result<std::shared_ptr<arrow::Array>> to_arrow(
89 const components::HalfSizes3D* instances, size_t num_instances
90 );
91 };
92} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:87
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:69
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:20
Component: Half-sizes (extents) of a 3D box along its local axis, starting at its local origin/center...
Definition half_sizes3d.hpp:24
HalfSizes3D(float x, float y, float z)
Construct HalfSizes3D from x/y/z values.
Definition half_sizes3d.hpp:31
Datatype: A vector in 3D space.
Definition vec3d.hpp:20