6#include "../component_descriptor.hpp"
7#include "../datatypes/vec3d.hpp"
8#include "../result.hpp"
25 Scale3D(
float x,
float y,
float z) : scale{x, y, z} {}
28 explicit Scale3D(
const float* xyz) : scale{xyz[0], xyz[1], xyz[2]} {}
32 :
Scale3D(datatypes::
Vec3D{uniform_scale, uniform_scale, uniform_scale}) {}
56 Scale3D(std::array<float, 3> xyz_) : scale(xyz_) {}
58 Scale3D& operator=(std::array<float, 3> xyz_) {
75 struct Loggable<components::Scale3D> {
76 static constexpr ComponentDescriptor Descriptor =
"rerun.components.Scale3D";
79 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
80 return Loggable<rerun::datatypes::Vec3D>::arrow_datatype();
84 static Result<std::shared_ptr<arrow::Array>> to_arrow(
85 const components::Scale3D* instances,
size_t num_instances
87 if (num_instances == 0) {
88 return Loggable<rerun::datatypes::Vec3D>::to_arrow(
nullptr, 0);
89 }
else if (instances ==
nullptr) {
91 ErrorCode::UnexpectedNullArgument,
92 "Passed array instances is null when num_elements> 0."
95 return Loggable<rerun::datatypes::Vec3D>::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:80
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Component: A 3D scale factor.
Definition scale3d.hpp:20
Scale3D(const float *xyz)
Construct Scale3D from x/y/z float pointer.
Definition scale3d.hpp:28
Scale3D(float x, float y, float z)
Construct Scale3D from x/y/z values.
Definition scale3d.hpp:25
Scale3D(float uniform_scale)
Construct a Scale3D from a uniform scale factor.
Definition scale3d.hpp:31
static Scale3D uniform(float uniform_scale)
Explicitly construct a Scale3D from a uniform scale factor.
Definition scale3d.hpp:35
static Scale3D three_d(datatypes::Vec3D scale)
Explicitly construct a Scale3D from a 3D scale factor.
Definition scale3d.hpp:40
Datatype: A vector in 3D space.
Definition vec3d.hpp:21