6#include "../datatypes/vec2d.hpp"
7#include "../result.hpp"
23 explicit Vector2D(
const float* xy) : vector{xy[0], xy[1]} {}
45 Vector2D(std::array<float, 2> xy_) : vector(xy_) {}
47 Vector2D& operator=(std::array<float, 2> xy_) {
64 struct Loggable<components::Vector2D> {
65 static constexpr const char Name[] =
"rerun.components.Vector2D";
68 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
69 return Loggable<rerun::datatypes::Vec2D>::arrow_datatype();
73 static Result<std::shared_ptr<arrow::Array>> to_arrow(
74 const components::Vector2D* instances,
size_t num_instances
76 if (num_instances == 0) {
77 return Loggable<rerun::datatypes::Vec2D>::to_arrow(
nullptr, 0);
78 }
else if (instances ==
nullptr) {
80 ErrorCode::UnexpectedNullArgument,
81 "Passed array instances is null when num_elements> 0."
84 return Loggable<rerun::datatypes::Vec2D>::to_arrow(
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: A vector in 2D space.
Definition vector2d.hpp:15
Vector2D(const float *xy)
Construct Vec2D from x/y float pointer.
Definition vector2d.hpp:23
Vector2D(float x, float y)
Construct Vector2D from x/y values.
Definition vector2d.hpp:20
Datatype: A vector in 2D space.
Definition vec2d.hpp:20