6#include "../datatypes/vec2d.hpp"
7#include "../result.hpp"
38 HalfSize2D() =
default;
47 HalfSize2D(std::array<float, 2> xy_) : xy(xy_) {}
49 HalfSize2D& operator=(std::array<float, 2> xy_) {
66 struct Loggable<components::HalfSize2D> {
67 static constexpr const char Name[] =
"rerun.components.HalfSize2D";
70 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
71 return Loggable<rerun::datatypes::Vec2D>::arrow_datatype();
75 static Result<std::shared_ptr<arrow::Array>> to_arrow(
76 const components::HalfSize2D* instances,
size_t num_instances
78 if (num_instances == 0) {
79 return Loggable<rerun::datatypes::Vec2D>::to_arrow(
nullptr, 0);
80 }
else if (instances ==
nullptr) {
82 ErrorCode::UnexpectedNullArgument,
83 "Passed array instances is null when num_elements> 0."
86 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:79
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Component: Half-size (radius) of a 2D box.
Definition half_size2d.hpp:20
HalfSize2D(float x, float y)
Construct HalfSize2D from x/y values.
Definition half_size2d.hpp:25
Datatype: A vector in 2D space.
Definition vec2d.hpp:20