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

Archetype: 2D arrows with optional colors, radii, labels, etc. More...

#include <rerun/archetypes/arrows2d.hpp>

Public Member Functions

 Arrows2D (Arrows2D &&other)=default
 
 Arrows2D (const Arrows2D &other)=default
 
Arrows2Doperator= (const Arrows2D &other)=default
 
Arrows2Doperator= (Arrows2D &&other)=default
 
Arrows2D with_vectors (const Collection< rerun::components::Vector2D > &_vectors) &&
 All the vectors for each arrow in the batch.
 
Arrows2D with_origins (const Collection< rerun::components::Position2D > &_origins) &&
 All the origin (base) positions for each arrow in the batch.
 
Arrows2D with_radii (const Collection< rerun::components::Radius > &_radii) &&
 Optional radii for the arrows.
 
Arrows2D with_colors (const Collection< rerun::components::Color > &_colors) &&
 Optional colors for the points.
 
Arrows2D with_labels (const Collection< rerun::components::Text > &_labels) &&
 Optional text labels for the arrows.
 
Arrows2D with_show_labels (const rerun::components::ShowLabels &_show_labels) &&
 Whether the text labels should be shown.
 
Arrows2D 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.
 
Arrows2D with_draw_order (const rerun::components::DrawOrder &_draw_order) &&
 An optional floating point value that specifies the 2D drawing order.
 
Arrows2D 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.
 
Arrows2D with_class_ids (const Collection< rerun::components::ClassId > &_class_ids) &&
 Optional class Ids for the points.
 
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 Arrows2D from_vectors (Collection< components::Vector2D > vectors_)
 Creates new 2D arrows pointing in the given directions, with a base at the origin (0, 0).
 
static Arrows2D update_fields ()
 Update only some specific fields of a Arrows2D.
 
static Arrows2D clear_fields ()
 Clear all the fields of a Arrows2D.
 

Public Attributes

std::optional< ComponentBatchvectors
 All the vectors for each arrow in the batch.
 
std::optional< ComponentBatchorigins
 All the origin (base) positions for each arrow in the batch.
 
std::optional< ComponentBatchradii
 Optional radii for the arrows.
 
std::optional< ComponentBatchcolors
 Optional colors for the points.
 
std::optional< ComponentBatchlabels
 Optional text labels for the arrows.
 
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 class Ids for the points.
 

Static Public Attributes

static constexpr const char ArchetypeName [] = "rerun.archetypes.Arrows2D"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_vectors
 ComponentDescriptor for the vectors field.
 
static constexpr auto Descriptor_origins
 ComponentDescriptor for the origins field.
 
static constexpr auto Descriptor_radii
 ComponentDescriptor for the radii field.
 
static constexpr auto Descriptor_colors
 ComponentDescriptor for the colors 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 arrows with optional colors, radii, labels, etc.

Example

Simple batch of 2D arrows

image

#include <rerun.hpp>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_arrow2d");
rec.spawn().exit_on_failure();
rec.log(
"arrows",
rerun::Arrows2D::from_vectors({{1.0f, 0.0f}, {0.0f, -1.0f}, {-0.7f, 0.7f}})
.with_radii(0.025f)
.with_origins({{0.25f, 0.0f}, {0.25f, 0.0f}, {-0.1f, -0.1f}})
.with_colors({{255, 0, 0}, {0, 255, 0}, {127, 0, 255}})
.with_labels({"right", "up", "left-down"})
);
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:61
Arrows2D with_colors(const Collection< rerun::components::Color > &_colors) &&
Optional colors for the points.
Definition arrows2d.hpp:176
Arrows2D with_labels(const Collection< rerun::components::Text > &_labels) &&
Optional text labels for the arrows.
Definition arrows2d.hpp:185
Arrows2D with_radii(const Collection< rerun::components::Radius > &_radii) &&
Optional radii for the arrows.
Definition arrows2d.hpp:170
Arrows2D with_origins(const Collection< rerun::components::Position2D > &_origins) &&
All the origin (base) positions for each arrow in the batch.
Definition arrows2d.hpp:161

Member Function Documentation

◆ with_origins()

Arrows2D rerun::archetypes::Arrows2D::with_origins ( const Collection< rerun::components::Position2D > &  _origins) &&
inline

All the origin (base) positions for each arrow in the batch.

If no origins are set, (0, 0) is used as the origin for each arrow.

◆ with_radii()

Arrows2D rerun::archetypes::Arrows2D::with_radii ( const Collection< rerun::components::Radius > &  _radii) &&
inline

Optional radii for the arrows.

The shaft is rendered as a line with radius = 0.5 * radius. The tip is rendered with height = 2.0 * radius and radius = 1.0 * radius.

◆ with_labels()

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

Optional text labels for the arrows.

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

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

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

Arrows2D rerun::archetypes::Arrows2D::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.

◆ with_many_draw_order()

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

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

Optional class Ids for the points.

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

◆ columns() [1/2]

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

◆ origins

std::optional<ComponentBatch> rerun::archetypes::Arrows2D::origins

All the origin (base) positions for each arrow in the batch.

If no origins are set, (0, 0) is used as the origin for each arrow.

◆ radii

std::optional<ComponentBatch> rerun::archetypes::Arrows2D::radii

Optional radii for the arrows.

The shaft is rendered as a line with radius = 0.5 * radius. The tip is rendered with height = 2.0 * radius and radius = 1.0 * radius.

◆ labels

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

Optional text labels for the arrows.

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::Arrows2D::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::Arrows2D::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.

◆ class_ids

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

Optional class Ids for the points.

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

◆ Descriptor_vectors

constexpr auto rerun::archetypes::Arrows2D::Descriptor_vectors
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "Arrows2D:vectors", Loggable<rerun::components::Vector2D>::ComponentType
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition arrows2d.hpp:91

ComponentDescriptor for the vectors field.

◆ Descriptor_origins

constexpr auto rerun::archetypes::Arrows2D::Descriptor_origins
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "Arrows2D:origins",
Loggable<rerun::components::Position2D>::ComponentType
)

ComponentDescriptor for the origins field.

◆ Descriptor_radii

constexpr auto rerun::archetypes::Arrows2D::Descriptor_radii
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "Arrows2D:radii", Loggable<rerun::components::Radius>::ComponentType
)

ComponentDescriptor for the radii field.

◆ Descriptor_colors

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

ComponentDescriptor for the colors field.

◆ Descriptor_labels

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

ComponentDescriptor for the labels field.

◆ Descriptor_show_labels

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

ComponentDescriptor for the show_labels field.

◆ Descriptor_draw_order

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

ComponentDescriptor for the draw_order field.

◆ Descriptor_class_ids

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

ComponentDescriptor for the class_ids field.


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