6#include "../component_descriptor.hpp"
7#include "../datatypes/vec2d.hpp"
8#include "../result.hpp"
39 HalfSize2D() =
default;
48 HalfSize2D(std::array<float, 2> xy_) : xy(xy_) {}
50 HalfSize2D& operator=(std::array<float, 2> xy_) {
67 struct Loggable<components::HalfSize2D> {
68 static constexpr ComponentDescriptor Descriptor =
"rerun.components.HalfSize2D";
71 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
72 return Loggable<rerun::datatypes::Vec2D>::arrow_datatype();
76 static Result<std::shared_ptr<arrow::Array>> to_arrow(
77 const components::HalfSize2D* instances,
size_t num_instances
79 if (num_instances == 0) {
80 return Loggable<rerun::datatypes::Vec2D>::to_arrow(
nullptr, 0);
81 }
else if (instances ==
nullptr) {
83 ErrorCode::UnexpectedNullArgument,
84 "Passed array instances is null when num_elements> 0."
87 return Loggable<rerun::datatypes::Vec2D>::to_arrow(&instances->xy, num_instances);
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:80
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Component: Half-size (radius) of a 2D box.
Definition half_size2d.hpp:21
HalfSize2D(float x, float y)
Construct HalfSize2D from x/y values.
Definition half_size2d.hpp:26
Datatype: A vector in 2D space.
Definition vec2d.hpp:21