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

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

#include <rerun/archetypes/boxes2d.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

 Boxes2D (Boxes2D &&other)=default
 
Boxes2D with_centers (Collection< rerun::components::Position2D > _centers) &&
 Optional center positions of the boxes.
 
Boxes2D with_colors (Collection< rerun::components::Color > _colors) &&
 Optional colors for the boxes.
 
Boxes2D with_radii (Collection< rerun::components::Radius > _radii) &&
 Optional radii for the lines that make up the boxes.
 
Boxes2D with_labels (Collection< rerun::components::Text > _labels) &&
 Optional text labels for the boxes.
 
Boxes2D with_draw_order (rerun::components::DrawOrder _draw_order) &&
 An optional floating point value that specifies the 2D drawing order.
 
Boxes2D with_class_ids (Collection< rerun::components::ClassId > _class_ids) &&
 Optional ClassIds for the boxes.
 

Static Public Member Functions

static Boxes2D from_half_sizes (Collection< components::HalfSizes2D > half_sizes)
 Creates new Boxes2D with half_sizes centered around the local origin.
 
static Boxes2D from_centers_and_half_sizes (Collection< components::Position2D > centers, Collection< components::HalfSizes2D > half_sizes)
 Creates new Boxes2D with centers and half_sizes.
 
static Boxes2D from_sizes (const std::vector< datatypes::Vec2D > &sizes)
 Creates new Boxes2D with half_sizes created from (full) sizes.
 
static Boxes2D from_centers_and_sizes (Collection< components::Position2D > centers, const std::vector< datatypes::Vec2D > &sizes)
 Creates new Boxes2D with centers and half_sizes created from centers and (full) sizes.
 
static Boxes2D from_mins_and_sizes (const std::vector< datatypes::Vec2D > &mins, const std::vector< datatypes::Vec2D > &sizes)
 Creates new Boxes2D with half_sizes and centers created from minimums and (full) sizes.
 

Public Attributes

Collection< rerun::components::HalfSizes2Dhalf_sizes
 All half-extents that make up the batch of boxes.
 
std::optional< Collection< rerun::components::Position2D > > centers
 Optional center positions of the boxes.
 
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< rerun::components::DrawOrderdraw_order
 An optional floating point value that specifies the 2D drawing order.
 
std::optional< Collection< rerun::components::ClassId > > class_ids
 Optional ClassIds for the boxes.
 

Static Public Attributes

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

Detailed Description

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

Example

Simple 2D boxes

image

#include <rerun.hpp>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_box2d");
rec.spawn().exit_on_failure();
rec.log("simple", rerun::Boxes2D::from_mins_and_sizes({{-1.f, -1.f}}, {{2.f, 2.f}}));
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:57

Member Function Documentation

◆ from_sizes()

static Boxes2D rerun::archetypes::Boxes2D::from_sizes ( const std::vector< datatypes::Vec2D > &  sizes)
static

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

TODO(#3285): Does not preserve data as-is and instead creates half-sizes from the input data.

◆ from_centers_and_sizes()

static Boxes2D rerun::archetypes::Boxes2D::from_centers_and_sizes ( Collection< components::Position2D centers,
const std::vector< datatypes::Vec2D > &  sizes 
)
inlinestatic

Creates new Boxes2D 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.

◆ from_mins_and_sizes()

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

Creates new Boxes2D 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.

◆ with_draw_order()

Boxes2D rerun::archetypes::Boxes2D::with_draw_order ( rerun::components::DrawOrder  _draw_order) &&
inline

An optional floating point value that specifies the 2D drawing order.

Objects with higher values are drawn on top of those with lower values.

The default for 2D boxes is 10.0.

◆ with_class_ids()

Boxes2D rerun::archetypes::Boxes2D::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

◆ draw_order

std::optional<rerun::components::DrawOrder> rerun::archetypes::Boxes2D::draw_order

An optional floating point value that specifies the 2D drawing order.

Objects with higher values are drawn on top of those with lower values.

The default for 2D boxes is 10.0.

◆ class_ids

std::optional<Collection<rerun::components::ClassId> > rerun::archetypes::Boxes2D::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: