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

Archetype: 2D ellipses with half-extents (semi-axes) and optional center, colors etc. More...

#include <rerun/archetypes/ellipses2d.hpp>

Public Member Functions

 Ellipses2D (Ellipses2D &&other)=default
 
 Ellipses2D (const Ellipses2D &other)=default
 
Ellipses2Doperator= (const Ellipses2D &other)=default
 
Ellipses2Doperator= (Ellipses2D &&other)=default
 
Ellipses2D with_half_sizes (const Collection< rerun::components::HalfSize2D > &_half_sizes) &&
 All half-extents (semi-axes) that make up the batch of ellipses.
 
Ellipses2D with_centers (const Collection< rerun::components::Position2D > &_centers) &&
 Optional center positions of the ellipses.
 
Ellipses2D with_colors (const Collection< rerun::components::Color > &_colors) &&
 Optional colors for the ellipses.
 
Ellipses2D with_line_radii (const Collection< rerun::components::Radius > &_line_radii) &&
 Optional radii for the lines that make up the ellipses.
 
Ellipses2D with_labels (const Collection< rerun::components::Text > &_labels) &&
 Optional text labels for the ellipses.
 
Ellipses2D with_show_labels (const rerun::components::ShowLabels &_show_labels) &&
 Whether the text labels should be shown.
 
Ellipses2D 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.
 
Ellipses2D with_draw_order (const rerun::components::DrawOrder &_draw_order) &&
 An optional floating point value that specifies the 2D drawing order.
 
Ellipses2D with_many_draw_order (const Collection< rerun::components::DrawOrder > &_draw_order) &&
 This method makes it possible to pack multiple draw_order in a single component batch.
 
Ellipses2D with_class_ids (const Collection< rerun::components::ClassId > &_class_ids) &&
 Optional components::ClassIds for the ellipses.
 
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 Ellipses2D from_half_sizes (Collection< components::HalfSize2D > half_sizes)
 Creates new Ellipses2D with half_sizes centered around the local origin.
 
static Ellipses2D from_centers_and_half_sizes (Collection< components::Position2D > centers, Collection< components::HalfSize2D > half_sizes)
 Creates new Ellipses2D with centers and half_sizes.
 
static Ellipses2D update_fields ()
 Update only some specific fields of a Ellipses2D.
 
static Ellipses2D clear_fields ()
 Clear all the fields of a Ellipses2D.
 

Public Attributes

std::optional< ComponentBatchhalf_sizes
 All half-extents (semi-axes) that make up the batch of ellipses.
 
std::optional< ComponentBatchcenters
 Optional center positions of the ellipses.
 
std::optional< ComponentBatchcolors
 Optional colors for the ellipses.
 
std::optional< ComponentBatchline_radii
 Optional radii for the lines that make up the ellipses.
 
std::optional< ComponentBatchlabels
 Optional text labels for the ellipses.
 
std::optional< ComponentBatchshow_labels
 Whether the text labels should be shown.
 
std::optional< ComponentBatchdraw_order
 An optional floating point value that specifies the 2D drawing order.
 
std::optional< ComponentBatchclass_ids
 Optional components::ClassIds for the ellipses.
 

Static Public Attributes

static constexpr const char ArchetypeName [] = "rerun.archetypes.Ellipses2D"
 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_colors
 ComponentDescriptor for the colors field.
 
static constexpr auto Descriptor_line_radii
 ComponentDescriptor for the line_radii 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_draw_order
 ComponentDescriptor for the draw_order field.
 
static constexpr auto Descriptor_class_ids
 ComponentDescriptor for the class_ids field.
 

Detailed Description

Archetype: 2D ellipses with half-extents (semi-axes) and optional center, colors etc.

The half-sizes specify the lengths of the ellipse's two axes along the local x and y directions. If both half-sizes are equal, the ellipse is a circle.

Examples

Simple 2D ellipses

#include <rerun.hpp>
int main(int argc, char* argv[]) {
const auto rec = rerun::RecordingStream("rerun_example_ellipses2d");
rec.spawn().exit_on_failure();
rec.log(
"simple",
rerun::Ellipses2D::from_centers_and_half_sizes({{0.0f, 0.0f}}, {{2.0f, 1.0f}})
);
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:73

Batch of 2D ellipses

#include <rerun.hpp>
int main(int argc, char* argv[]) {
const auto rec = rerun::RecordingStream("rerun_example_ellipses2d_batch");
rec.spawn().exit_on_failure();
rec.log(
"batch",
rerun::Ellipses2D::from_centers_and_half_sizes(
{{-2.0f, 0.0f}, {0.0f, 0.0f}, {2.5f, 0.0f}},
{{1.5f, 0.75f}, {0.5f, 0.5f}, {0.75f, 1.5f}}
)
.with_line_radii({0.025f, 0.05f, 0.025f})
rerun::Rgba32(255, 0, 0),
rerun::Rgba32(0, 255, 0),
rerun::Rgba32(0, 0, 255),
})
.with_labels({"wide", "circle", "tall"})
);
}
Ellipses2D with_line_radii(const Collection< rerun::components::Radius > &_line_radii) &&
Optional radii for the lines that make up the ellipses.
Definition ellipses2d.hpp:204
Ellipses2D with_colors(const Collection< rerun::components::Color > &_colors) &&
Optional colors for the ellipses.
Definition ellipses2d.hpp:198
Ellipses2D with_labels(const Collection< rerun::components::Text > &_labels) &&
Optional text labels for the ellipses.
Definition ellipses2d.hpp:214
Datatype: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition rgba32.hpp:27

Member Function Documentation

◆ with_labels()

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

Optional text labels for the ellipses.

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_show_labels()

Ellipses2D rerun::archetypes::Ellipses2D::with_show_labels ( const rerun::components::ShowLabels _show_labels) &&
inline

Whether the text labels should be shown.

If not set, labels will automatically appear when there is exactly one label for this entity or the number of instances on this entity is under a certain threshold.

◆ with_many_show_labels()

Ellipses2D rerun::archetypes::Ellipses2D::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_draw_order()

Ellipses2D rerun::archetypes::Ellipses2D::with_draw_order ( const 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. Defaults to 10.0.

◆ with_many_draw_order()

Ellipses2D rerun::archetypes::Ellipses2D::with_many_draw_order ( const Collection< rerun::components::DrawOrder > &  _draw_order) &&
inline

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

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

◆ with_class_ids()

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

Optional components::ClassIds for the ellipses.

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

◆ columns() [1/2]

Collection< ComponentColumn > rerun::archetypes::Ellipses2D::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::Ellipses2D::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

◆ labels

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

Optional text labels for the ellipses.

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.

◆ show_labels

std::optional<ComponentBatch> rerun::archetypes::Ellipses2D::show_labels

Whether the text labels should be shown.

If not set, labels will automatically appear when there is exactly one label for this entity or the number of instances on this entity is under a certain threshold.

◆ draw_order

std::optional<ComponentBatch> rerun::archetypes::Ellipses2D::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. Defaults to 10.0.

◆ class_ids

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

Optional components::ClassIds for the ellipses.

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

◆ Descriptor_half_sizes

constexpr auto rerun::archetypes::Ellipses2D::Descriptor_half_sizes
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "Ellipses2D:half_sizes",
Loggable<rerun::components::HalfSize2D>::ComponentType
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition ellipses2d.hpp:109

ComponentDescriptor for the half_sizes field.

◆ Descriptor_centers

constexpr auto rerun::archetypes::Ellipses2D::Descriptor_centers
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "Ellipses2D:centers",
Loggable<rerun::components::Position2D>::ComponentType
)

ComponentDescriptor for the centers field.

◆ Descriptor_colors

constexpr auto rerun::archetypes::Ellipses2D::Descriptor_colors
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "Ellipses2D:colors", Loggable<rerun::components::Color>::ComponentType
)

ComponentDescriptor for the colors field.

◆ Descriptor_line_radii

constexpr auto rerun::archetypes::Ellipses2D::Descriptor_line_radii
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "Ellipses2D:line_radii",
Loggable<rerun::components::Radius>::ComponentType
)

ComponentDescriptor for the line_radii field.

◆ Descriptor_labels

constexpr auto rerun::archetypes::Ellipses2D::Descriptor_labels
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "Ellipses2D:labels", Loggable<rerun::components::Text>::ComponentType
)

ComponentDescriptor for the labels field.

◆ Descriptor_show_labels

constexpr auto rerun::archetypes::Ellipses2D::Descriptor_show_labels
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "Ellipses2D:show_labels",
Loggable<rerun::components::ShowLabels>::ComponentType
)

ComponentDescriptor for the show_labels field.

◆ Descriptor_draw_order

constexpr auto rerun::archetypes::Ellipses2D::Descriptor_draw_order
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "Ellipses2D:draw_order",
Loggable<rerun::components::DrawOrder>::ComponentType
)

ComponentDescriptor for the draw_order field.

◆ Descriptor_class_ids

constexpr auto rerun::archetypes::Ellipses2D::Descriptor_class_ids
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "Ellipses2D:class_ids",
Loggable<rerun::components::ClassId>::ComponentType
)

ComponentDescriptor for the class_ids field.


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