6#include "../archetype_utils.hpp"
7#include "../collection.hpp"
8#include "../component_batch.hpp"
9#include "../component_column.hpp"
10#include "../components/class_id.hpp"
11#include "../components/color.hpp"
12#include "../components/fill_mode.hpp"
13#include "../components/half_size3d.hpp"
14#include "../components/radius.hpp"
15#include "../components/rotation_axis_angle.hpp"
16#include "../components/rotation_quat.hpp"
17#include "../components/show_labels.hpp"
18#include "../components/text.hpp"
19#include "../components/translation3d.hpp"
20#include "../result.hpp"
89 std::optional<ComponentBatch>
colors;
92 std::optional<ComponentBatch>
radii;
195 const std::vector<encodings::Vec3D>& sizes
207 const std::vector<encodings::Vec3D>& mins,
const std::vector<encodings::Vec3D>& sizes
231 return std::move(*
this);
239 return std::move(*
this);
249 _rotation_axis_angles,
253 return std::move(*
this);
263 return std::move(*
this);
271 return std::move(*
this);
277 return std::move(*
this);
284 return std::move(*
this);
294 return std::move(*
this);
303 return std::move(*
this);
313 return std::move(*
this);
324 return std::move(*
this);
333 return std::move(*
this);
345 return detail::partition_batches(
366 return detail::partition_batches_of_unit_length({&
half_sizes,
384 template <
typename T>
389 struct AsComponents<archetypes::Boxes3D> {
391 static Result<Collection<ComponentBatch>> as_batches(
const archetypes::Boxes3D& archetype) {
392 return detail::collect_batches(
393 {&archetype.half_sizes,
395 &archetype.rotation_axis_angles,
396 &archetype.quaternions,
399 &archetype.fill_mode,
401 &archetype.show_labels,
402 &archetype.class_ids}
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:90
FillMode
Component: How a geometric shape is drawn and colored.
Definition fill_mode.hpp:24
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26
static Result< ComponentBatch > from_loggable(const rerun::Collection< T > &components, const ComponentDescriptor &descriptor)
Creates a new component batch from a collection of component instances.
Definition component_batch.hpp:46
A ComponentDescriptor fully describes the semantics of a column of data.
Definition component_descriptor.hpp:16
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Archetype: 3D boxes with half-extents and optional center, rotations, colors etc.
Definition boxes3d.hpp:67
static constexpr auto Descriptor_class_ids
ComponentDescriptor for the class_ids field.
Definition boxes3d.hpp:160
static constexpr auto Descriptor_radii
ComponentDescriptor for the radii field.
Definition boxes3d.hpp:143
static Boxes3D from_centers_and_sizes(Collection< components::Translation3D > centers, const std::vector< encodings::Vec3D > &sizes)
Creates new Boxes3D with centers and half_sizes created from centers and (full) sizes.
Definition boxes3d.hpp:193
Boxes3D with_many_fill_mode(const Collection< rerun::components::FillMode > &_fill_mode) &&
This method makes it possible to pack multiple fill_mode in a single component batch.
Definition boxes3d.hpp:291
static constexpr auto Descriptor_colors
ComponentDescriptor for the colors field.
Definition boxes3d.hpp:139
Boxes3D with_centers(const Collection< rerun::components::Translation3D > &_centers) &&
Optional center positions of the boxes.
Definition boxes3d.hpp:237
std::optional< ComponentBatch > labels
Optional text labels for the boxes.
Definition boxes3d.hpp:101
static Boxes3D from_half_sizes(Collection< components::HalfSize3D > half_sizes)
Creates new Boxes3D with half_sizes centered around the local origin.
Definition boxes3d.hpp:166
std::optional< ComponentBatch > half_sizes
All half-extents that make up the batch of boxes.
Definition boxes3d.hpp:69
static constexpr auto Descriptor_fill_mode
ComponentDescriptor for the fill_mode field.
Definition boxes3d.hpp:147
static constexpr auto Descriptor_half_sizes
ComponentDescriptor for the half_sizes field.
Definition boxes3d.hpp:119
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition boxes3d.hpp:116
Boxes3D with_colors(const Collection< rerun::components::Color > &_colors) &&
Optional colors for the boxes.
Definition boxes3d.hpp:269
Boxes3D with_half_sizes(const Collection< rerun::components::HalfSize3D > &_half_sizes) &&
All half-extents that make up the batch of boxes.
Definition boxes3d.hpp:228
std::optional< ComponentBatch > show_labels
Whether the text labels should be shown.
Definition boxes3d.hpp:107
static constexpr auto Descriptor_quaternions
ComponentDescriptor for the quaternions field.
Definition boxes3d.hpp:134
std::optional< ComponentBatch > centers
Optional center positions of the boxes.
Definition boxes3d.hpp:74
static Boxes3D from_centers_and_half_sizes(Collection< components::Translation3D > centers, Collection< components::HalfSize3D > half_sizes)
Creates new Boxes3D with centers and half_sizes.
Definition boxes3d.hpp:171
static Boxes3D from_sizes(const std::vector< encodings::Vec3D > &sizes)
Creates new Boxes3D with half_sizes created from (full) sizes.
std::optional< ComponentBatch > fill_mode
Optionally choose whether the boxes are drawn with lines or solid.
Definition boxes3d.hpp:95
Boxes3D with_show_labels(const rerun::components::ShowLabels &_show_labels) &&
Whether the text labels should be shown.
Definition boxes3d.hpp:310
Boxes3D with_class_ids(const Collection< rerun::components::ClassId > &_class_ids) &&
Optional components::ClassIds for the boxes.
Definition boxes3d.hpp:330
Boxes3D with_many_show_labels(const Collection< rerun::components::ShowLabels > &_show_labels) &&
This method makes it possible to pack multiple show_labels in a single component batch.
Definition boxes3d.hpp:320
std::optional< ComponentBatch > quaternions
Rotations via quaternion.
Definition boxes3d.hpp:84
static constexpr auto Descriptor_show_labels
ComponentDescriptor for the show_labels field.
Definition boxes3d.hpp:155
static Boxes3D from_mins_and_sizes(const std::vector< encodings::Vec3D > &mins, const std::vector< encodings::Vec3D > &sizes)
Creates new Boxes3D with half_sizes and centers created from minimums and (full) sizes.
std::optional< ComponentBatch > class_ids
Optional components::ClassIds for the boxes.
Definition boxes3d.hpp:112
std::optional< ComponentBatch > rotation_axis_angles
Rotations via axis + angle.
Definition boxes3d.hpp:79
Boxes3D with_quaternions(const Collection< rerun::components::RotationQuat > &_quaternions) &&
Rotations via quaternion.
Definition boxes3d.hpp:259
Boxes3D with_labels(const Collection< rerun::components::Text > &_labels) &&
Optional text labels for the boxes.
Definition boxes3d.hpp:301
std::optional< ComponentBatch > colors
Optional colors for the boxes.
Definition boxes3d.hpp:89
Boxes3D with_radii(const Collection< rerun::components::Radius > &_radii) &&
Optional radii for the lines that make up the boxes.
Definition boxes3d.hpp:275
static Boxes3D update_fields()
Update only some specific fields of a Boxes3D.
Definition boxes3d.hpp:220
static Boxes3D clear_fields()
Clear all the fields of a Boxes3D.
static constexpr auto Descriptor_labels
ComponentDescriptor for the labels field.
Definition boxes3d.hpp:151
Boxes3D with_fill_mode(const rerun::components::FillMode &_fill_mode) &&
Optionally choose whether the boxes are drawn with lines or solid.
Definition boxes3d.hpp:281
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition boxes3d.hpp:365
static constexpr auto Descriptor_centers
ComponentDescriptor for the centers field.
Definition boxes3d.hpp:124
Boxes3D with_rotation_axis_angles(const Collection< rerun::components::RotationAxisAngle > &_rotation_axis_angles) &&
Rotations via axis + angle.
Definition boxes3d.hpp:245
std::optional< ComponentBatch > radii
Optional radii for the lines that make up the boxes.
Definition boxes3d.hpp:92
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition boxes3d.hpp:344
static constexpr auto Descriptor_rotation_axis_angles
ComponentDescriptor for the rotation_axis_angles field.
Definition boxes3d.hpp:129
Component: Whether the entity's components::Text label is shown.
Definition show_labels.hpp:18