Rerun C++ SDK
Loading...
Searching...
No Matches
rerun::archetypes::Boxes3D Struct Reference

Archetype: 3D boxes with half-extents and optional center, rotations, colors etc. More...

#include <rerun/archetypes/boxes3d.hpp>

Public Types

using IndicatorComponent = rerun::components::IndicatorComponent< IndicatorComponentName >
 Indicator component, used to identify the archetype when converting to a list of components.
 

Public Member Functions

 Boxes3D (Boxes3D &&other)=default
 
 Boxes3D (const Boxes3D &other)=default
 
Boxes3Doperator= (const Boxes3D &other)=default
 
Boxes3Doperator= (Boxes3D &&other)=default
 
Boxes3D with_half_sizes (const Collection< rerun::components::HalfSize3D > &_half_sizes) &&
 All half-extents that make up the batch of boxes.
 
Boxes3D with_centers (const Collection< rerun::components::PoseTranslation3D > &_centers) &&
 Optional center positions of the boxes.
 
Boxes3D with_rotation_axis_angles (const Collection< rerun::components::PoseRotationAxisAngle > &_rotation_axis_angles) &&
 Rotations via axis + angle.
 
Boxes3D with_quaternions (const Collection< rerun::components::PoseRotationQuat > &_quaternions) &&
 Rotations via quaternion.
 
Boxes3D with_colors (const Collection< rerun::components::Color > &_colors) &&
 Optional colors for the boxes.
 
Boxes3D with_radii (const Collection< rerun::components::Radius > &_radii) &&
 Optional radii for the lines that make up the boxes.
 
Boxes3D with_fill_mode (const rerun::components::FillMode &_fill_mode) &&
 Optionally choose whether the boxes are drawn with lines or solid.
 
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.
 
Boxes3D with_labels (const Collection< rerun::components::Text > &_labels) &&
 Optional text labels for the boxes.
 
Boxes3D with_show_labels (const rerun::components::ShowLabels &_show_labels) &&
 Optional choice of whether the text labels should be shown by default.
 
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.
 
Boxes3D with_class_ids (const Collection< rerun::components::ClassId > &_class_ids) &&
 Optional components::ClassIds for the boxes.
 
Collection< ComponentColumncolumns (const Collection< uint32_t > &lengths_)
 Partitions the component data into multiple sub-batches.
 
Collection< ComponentColumncolumns ()
 Partitions the component data into unit-length sub-batches.
 

Static Public Member Functions

static Boxes3D from_half_sizes (Collection< components::HalfSize3D > half_sizes)
 Creates new Boxes3D with half_sizes centered around the local origin.
 
static Boxes3D from_centers_and_half_sizes (Collection< components::PoseTranslation3D > centers, Collection< components::HalfSize3D > half_sizes)
 Creates new Boxes3D with centers and half_sizes.
 
static Boxes3D from_sizes (const std::vector< datatypes::Vec3D > &sizes)
 Creates new Boxes3D with half_sizes created from (full) sizes.
 
static Boxes3D from_centers_and_sizes (Collection< components::PoseTranslation3D > centers, const std::vector< datatypes::Vec3D > &sizes)
 Creates new Boxes3D with centers and half_sizes created from centers and (full) sizes.
 
static Boxes3D from_mins_and_sizes (const std::vector< datatypes::Vec3D > &mins, const std::vector< datatypes::Vec3D > &sizes)
 Creates new Boxes3D with half_sizes and centers created from minimums and (full) sizes.
 
static Boxes3D update_fields ()
 Update only some specific fields of a Boxes3D.
 
static Boxes3D clear_fields ()
 Clear all the fields of a Boxes3D.
 

Public Attributes

std::optional< ComponentBatchhalf_sizes
 All half-extents that make up the batch of boxes.
 
std::optional< ComponentBatchcenters
 Optional center positions of the boxes.
 
std::optional< ComponentBatchrotation_axis_angles
 Rotations via axis + angle.
 
std::optional< ComponentBatchquaternions
 Rotations via quaternion.
 
std::optional< ComponentBatchcolors
 Optional colors for the boxes.
 
std::optional< ComponentBatchradii
 Optional radii for the lines that make up the boxes.
 
std::optional< ComponentBatchfill_mode
 Optionally choose whether the boxes are drawn with lines or solid.
 
std::optional< ComponentBatchlabels
 Optional text labels for the boxes.
 
std::optional< ComponentBatchshow_labels
 Optional choice of whether the text labels should be shown by default.
 
std::optional< ComponentBatchclass_ids
 Optional components::ClassIds for the boxes.
 

Static Public Attributes

static constexpr const char IndicatorComponentName [] = "rerun.components.Boxes3DIndicator"
 
static constexpr const char ArchetypeName [] = "rerun.archetypes.Boxes3D"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_half_sizes
 ComponentDescriptor for the half_sizes field.
 
static constexpr auto Descriptor_centers
 ComponentDescriptor for the centers field.
 
static constexpr auto Descriptor_rotation_axis_angles
 ComponentDescriptor for the rotation_axis_angles field.
 
static constexpr auto Descriptor_quaternions
 ComponentDescriptor for the quaternions field.
 
static constexpr auto Descriptor_colors
 ComponentDescriptor for the colors field.
 
static constexpr auto Descriptor_radii
 ComponentDescriptor for the radii field.
 
static constexpr auto Descriptor_fill_mode
 ComponentDescriptor for the fill_mode field.
 
static constexpr auto Descriptor_labels
 ComponentDescriptor for the labels field.
 
static constexpr auto Descriptor_show_labels
 ComponentDescriptor for the show_labels field.
 
static constexpr auto Descriptor_class_ids
 ComponentDescriptor for the class_ids field.
 

Detailed Description

Archetype: 3D boxes with half-extents and optional center, rotations, colors etc.

Note that orienting and placing the box is handled via [archetypes.InstancePoses3D]. Some of its component are repeated here for convenience. If there's more instance poses than half sizes, the last half size will be repeated for the remaining poses.

Example

Batch of 3D boxes

image

#include <rerun.hpp>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_box3d_batch");
rec.spawn().exit_on_failure();
rec.log(
"batch",
rerun::Boxes3D::from_centers_and_half_sizes(
{{2.0f, 0.0f, 0.0f}, {-2.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 2.0f}},
{{2.0f, 2.0f, 1.0f}, {1.0f, 1.0f, 0.5f}, {2.0f, 0.5f, 1.0f}}
)
rerun::Quaternion::IDENTITY,
// 45 degrees around Z
rerun::Quaternion::from_xyzw(0.0f, 0.0f, 0.382683f, 0.923880f),
})
.with_radii({0.025f})
rerun::Rgba32(255, 0, 0),
rerun::Rgba32(0, 255, 0),
rerun::Rgba32(0, 0, 255),
})
.with_fill_mode(rerun::FillMode::Solid)
.with_labels({"red", "green", "blue"})
);
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:60
Boxes3D with_quaternions(const Collection< rerun::components::PoseRotationQuat > &_quaternions) &&
Rotations via quaternion.
Definition boxes3d.hpp:267
Boxes3D with_colors(const Collection< rerun::components::Color > &_colors) &&
Optional colors for the boxes.
Definition boxes3d.hpp:275
Boxes3D with_labels(const Collection< rerun::components::Text > &_labels) &&
Optional text labels for the boxes.
Definition boxes3d.hpp:307
Boxes3D with_radii(const Collection< rerun::components::Radius > &_radii) &&
Optional radii for the lines that make up the boxes.
Definition boxes3d.hpp:281
Boxes3D with_fill_mode(const rerun::components::FillMode &_fill_mode) &&
Optionally choose whether the boxes are drawn with lines or solid.
Definition boxes3d.hpp:287
static Quaternion from_xyzw(float x, float y, float z, float w)
Construct Quaternion from x/y/z/w values.
Definition quaternion.hpp:33
Datatype: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition rgba32.hpp:28

Member Function Documentation

◆ from_sizes()

static Boxes3D rerun::archetypes::Boxes3D::from_sizes ( const std::vector< datatypes::Vec3D > &  sizes)
static

Creates new Boxes3D with half_sizes created from (full) sizes.

TODO(#3285): Does not preserve data as-is and instead creates half-sizes from the input data. TODO(andreas): This should not take an std::vector.

◆ from_centers_and_sizes()

static Boxes3D rerun::archetypes::Boxes3D::from_centers_and_sizes ( Collection< components::PoseTranslation3D centers,
const std::vector< datatypes::Vec3D > &  sizes 
)
inlinestatic

Creates new Boxes3D with centers and half_sizes created from centers and (full) sizes.

TODO(#3285): Does not preserve data as-is and instead creates centers and half-sizes from the input data. TODO(andreas): This should not take an std::vector.

◆ from_mins_and_sizes()

static Boxes3D rerun::archetypes::Boxes3D::from_mins_and_sizes ( const std::vector< datatypes::Vec3D > &  mins,
const std::vector< datatypes::Vec3D > &  sizes 
)
static

Creates new Boxes3D with half_sizes and centers created from minimums and (full) sizes.

TODO(#3285): Does not preserve data as-is and instead creates centers and half-sizes from the input data. TODO(andreas): This should not take an std::vector.

◆ with_centers()

Boxes3D rerun::archetypes::Boxes3D::with_centers ( const Collection< rerun::components::PoseTranslation3D > &  _centers) &&
inline

Optional center positions of the boxes.

If not specified, the centers will be at (0, 0, 0). Note that this uses a components::PoseTranslation3D which is also used by archetypes::InstancePoses3D.

◆ with_rotation_axis_angles()

Boxes3D rerun::archetypes::Boxes3D::with_rotation_axis_angles ( const Collection< rerun::components::PoseRotationAxisAngle > &  _rotation_axis_angles) &&
inline

Rotations via axis + angle.

If no rotation is specified, the axes of the boxes align with the axes of the local coordinate system. Note that this uses a components::PoseRotationAxisAngle which is also used by archetypes::InstancePoses3D.

◆ with_quaternions()

Boxes3D rerun::archetypes::Boxes3D::with_quaternions ( const Collection< rerun::components::PoseRotationQuat > &  _quaternions) &&
inline

Rotations via quaternion.

If no rotation is specified, the axes of the boxes align with the axes of the local coordinate system. Note that this uses a components::PoseRotationQuat which is also used by archetypes::InstancePoses3D.

◆ with_many_fill_mode()

Boxes3D rerun::archetypes::Boxes3D::with_many_fill_mode ( const Collection< rerun::components::FillMode > &  _fill_mode) &&
inline

This method makes it possible to pack multiple fill_mode in a single component batch.

This only makes sense when used in conjunction with columns. with_fill_mode should be used when logging a single row's worth of data.

◆ with_labels()

Boxes3D rerun::archetypes::Boxes3D::with_labels ( const Collection< rerun::components::Text > &  _labels) &&
inline

Optional text labels for the boxes.

If there's a single label present, it will be placed at the center of the entity. Otherwise, each instance will have its own label.

◆ with_many_show_labels()

Boxes3D rerun::archetypes::Boxes3D::with_many_show_labels ( const Collection< rerun::components::ShowLabels > &  _show_labels) &&
inline

This method makes it possible to pack multiple show_labels in a single component batch.

This only makes sense when used in conjunction with columns. with_show_labels should be used when logging a single row's worth of data.

◆ with_class_ids()

Boxes3D rerun::archetypes::Boxes3D::with_class_ids ( const Collection< rerun::components::ClassId > &  _class_ids) &&
inline

Optional components::ClassIds for the boxes.

The components::ClassId provides colors and labels if not specified explicitly.

◆ columns() [1/2]

Collection< ComponentColumn > rerun::archetypes::Boxes3D::columns ( const Collection< uint32_t > &  lengths_)

Partitions the component data into multiple sub-batches.

Specifically, this transforms the existing ComponentBatch data into ComponentColumns instead, via ComponentBatch::partitioned.

This makes it possible to use RecordingStream::send_columns to send columnar data directly into Rerun.

The specified lengths must sum to the total length of the component batch.

◆ columns() [2/2]

Collection< ComponentColumn > rerun::archetypes::Boxes3D::columns ( )

Partitions the component data into unit-length sub-batches.

This is semantically similar to calling columns with std::vector<uint32_t>(n, 1), where n is automatically guessed.

Member Data Documentation

◆ centers

std::optional<ComponentBatch> rerun::archetypes::Boxes3D::centers

Optional center positions of the boxes.

If not specified, the centers will be at (0, 0, 0). Note that this uses a components::PoseTranslation3D which is also used by archetypes::InstancePoses3D.

◆ rotation_axis_angles

std::optional<ComponentBatch> rerun::archetypes::Boxes3D::rotation_axis_angles

Rotations via axis + angle.

If no rotation is specified, the axes of the boxes align with the axes of the local coordinate system. Note that this uses a components::PoseRotationAxisAngle which is also used by archetypes::InstancePoses3D.

◆ quaternions

std::optional<ComponentBatch> rerun::archetypes::Boxes3D::quaternions

Rotations via quaternion.

If no rotation is specified, the axes of the boxes align with the axes of the local coordinate system. Note that this uses a components::PoseRotationQuat which is also used by archetypes::InstancePoses3D.

◆ labels

std::optional<ComponentBatch> rerun::archetypes::Boxes3D::labels

Optional text labels for the boxes.

If there's a single label present, it will be placed at the center of the entity. Otherwise, each instance will have its own label.

◆ class_ids

std::optional<ComponentBatch> rerun::archetypes::Boxes3D::class_ids

Optional components::ClassIds for the boxes.

The components::ClassId provides colors and labels if not specified explicitly.

◆ Descriptor_half_sizes

constexpr auto rerun::archetypes::Boxes3D::Descriptor_half_sizes
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "half_sizes",
Loggable<rerun::components::HalfSize3D>::Descriptor.component_name
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition boxes3d.hpp:119

ComponentDescriptor for the half_sizes field.

◆ Descriptor_centers

constexpr auto rerun::archetypes::Boxes3D::Descriptor_centers
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "centers",
Loggable<rerun::components::PoseTranslation3D>::Descriptor.component_name
)

ComponentDescriptor for the centers field.

◆ Descriptor_rotation_axis_angles

constexpr auto rerun::archetypes::Boxes3D::Descriptor_rotation_axis_angles
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "rotation_axis_angles",
Loggable<rerun::components::PoseRotationAxisAngle>::Descriptor.component_name
)

ComponentDescriptor for the rotation_axis_angles field.

◆ Descriptor_quaternions

constexpr auto rerun::archetypes::Boxes3D::Descriptor_quaternions
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "quaternions",
Loggable<rerun::components::PoseRotationQuat>::Descriptor.component_name
)

ComponentDescriptor for the quaternions field.

◆ Descriptor_colors

constexpr auto rerun::archetypes::Boxes3D::Descriptor_colors
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "colors", Loggable<rerun::components::Color>::Descriptor.component_name
)

ComponentDescriptor for the colors field.

◆ Descriptor_radii

constexpr auto rerun::archetypes::Boxes3D::Descriptor_radii
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "radii", Loggable<rerun::components::Radius>::Descriptor.component_name
)

ComponentDescriptor for the radii field.

◆ Descriptor_fill_mode

constexpr auto rerun::archetypes::Boxes3D::Descriptor_fill_mode
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "fill_mode",
Loggable<rerun::components::FillMode>::Descriptor.component_name
)

ComponentDescriptor for the fill_mode field.

◆ Descriptor_labels

constexpr auto rerun::archetypes::Boxes3D::Descriptor_labels
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "labels", Loggable<rerun::components::Text>::Descriptor.component_name
)

ComponentDescriptor for the labels field.

◆ Descriptor_show_labels

constexpr auto rerun::archetypes::Boxes3D::Descriptor_show_labels
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "show_labels",
Loggable<rerun::components::ShowLabels>::Descriptor.component_name
)

ComponentDescriptor for the show_labels field.

◆ Descriptor_class_ids

constexpr auto rerun::archetypes::Boxes3D::Descriptor_class_ids
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "class_ids",
Loggable<rerun::components::ClassId>::Descriptor.component_name
)

ComponentDescriptor for the class_ids field.


The documentation for this struct was generated from the following file: