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

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

#include <rerun/archetypes/boxes3d.hpp>

Public Types

using IndicatorComponent = 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 with_centers (Collection< rerun::components::Position3D > _centers) &&
 Optional center positions of the boxes.
 
Boxes3D with_rotations (Collection< rerun::components::Rotation3D > _rotations) &&
 
Boxes3D with_colors (Collection< rerun::components::Color > _colors) &&
 Optional colors for the boxes.
 
Boxes3D with_radii (Collection< rerun::components::Radius > _radii) &&
 Optional radii for the lines that make up the boxes.
 
Boxes3D with_labels (Collection< rerun::components::Text > _labels) &&
 Optional text labels for the boxes.
 
Boxes3D with_class_ids (Collection< rerun::components::ClassId > _class_ids) &&
 Optional ClassIds for the boxes.
 
Boxes3D with_instance_keys (Collection< rerun::components::InstanceKey > _instance_keys) &&
 Unique identifiers for each individual boxes in the batch.
 
size_t num_instances () const
 Returns the number of primary instances of this archetype.
 

Static Public Member Functions

static Boxes3D from_half_sizes (Collection< components::HalfSizes3D > half_sizes)
 Creates new Boxes3D with half_sizes centered around the local origin.
 
static Boxes3D from_centers_and_half_sizes (Collection< components::Position3D > centers, Collection< components::HalfSizes3D > 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::Position3D > 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.
 

Public Attributes

Collection< rerun::components::HalfSizes3Dhalf_sizes
 All half-extents that make up the batch of boxes.
 
std::optional< Collection< rerun::components::Position3D > > centers
 Optional center positions of the boxes.
 
std::optional< Collection< rerun::components::Rotation3D > > rotations
 
std::optional< Collection< rerun::components::Color > > colors
 Optional colors for the boxes.
 
std::optional< Collection< rerun::components::Radius > > radii
 Optional radii for the lines that make up the boxes.
 
std::optional< Collection< rerun::components::Text > > labels
 Optional text labels for the boxes.
 
std::optional< Collection< rerun::components::ClassId > > class_ids
 Optional ClassIds for the boxes.
 
std::optional< Collection< rerun::components::InstanceKey > > instance_keys
 Unique identifiers for each individual boxes in the batch.
 

Static Public Attributes

static constexpr const char IndicatorComponentName [] = "rerun.components.Boxes3DIndicator"
 

Detailed Description

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

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}}
)
.with_rotations({
rerun::Quaternion::IDENTITY,
// 45 degrees around Z
rerun::Quaternion::from_xyzw(0.0f, 0.0f, 0.382683f, 0.923880f),
rerun::RotationAxisAngle({0.0f, 1.0f, 0.0f}, rerun::Angle::degrees(30.0f)),
})
.with_radii({0.025f})
rerun::Rgba32(255, 0, 0),
rerun::Rgba32(0, 255, 0),
rerun::Rgba32(0, 0, 255),
})
.with_labels({"red", "green", "blue"})
);
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:57
Boxes3D with_colors(Collection< rerun::components::Color > _colors) &&
Optional colors for the boxes.
Definition boxes3d.hpp:164
Boxes3D with_labels(Collection< rerun::components::Text > _labels) &&
Optional text labels for the boxes.
Definition boxes3d.hpp:178
Boxes3D with_radii(Collection< rerun::components::Radius > _radii) &&
Optional radii for the lines that make up the boxes.
Definition boxes3d.hpp:171
static Quaternion from_xyzw(float x, float y, float z, float w)
Construct Quaternion from x/y/z/w values.
Definition quaternion.hpp:32
Datatype: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition rgba32.hpp:27
Datatype: 3D rotation represented by a rotation around a given axis.
Definition rotation_axis_angle.hpp:21

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(#3794): This should not take an std::vector.

◆ from_centers_and_sizes()

static Boxes3D rerun::archetypes::Boxes3D::from_centers_and_sizes ( Collection< components::Position3D 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(#3794): 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(#3794): This should not take an std::vector.

◆ with_class_ids()

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

Optional ClassIds for the boxes.

The class ID provides colors and labels if not specified explicitly.

Member Data Documentation

◆ class_ids

std::optional<Collection<rerun::components::ClassId> > rerun::archetypes::Boxes3D::class_ids

Optional ClassIds for the boxes.

The class ID provides colors and labels if not specified explicitly.


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