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

Archetype: 2D line strips with positions and optional colors, radii, labels, etc. More...

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

 LineStrips2D (LineStrips2D &&other)=default
 
 LineStrips2D (const LineStrips2D &other)=default
 
LineStrips2Doperator= (const LineStrips2D &other)=default
 
LineStrips2Doperator= (LineStrips2D &&other)=default
 
 LineStrips2D (Collection< rerun::components::LineStrip2D > _strips)
 
LineStrips2D with_strips (const Collection< rerun::components::LineStrip2D > &_strips) &&
 All the actual 2D line strips that make up the batch.
 
LineStrips2D with_radii (const Collection< rerun::components::Radius > &_radii) &&
 Optional radii for the line strips.
 
LineStrips2D with_colors (const Collection< rerun::components::Color > &_colors) &&
 Optional colors for the line strips.
 
LineStrips2D with_labels (const Collection< rerun::components::Text > &_labels) &&
 Optional text labels for the line strips.
 
LineStrips2D with_show_labels (const rerun::components::ShowLabels &_show_labels) &&
 Optional choice of whether the text labels should be shown by default.
 
LineStrips2D 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.
 
LineStrips2D with_draw_order (const rerun::components::DrawOrder &_draw_order) &&
 An optional floating point value that specifies the 2D drawing order of each line strip.
 
LineStrips2D 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.
 
LineStrips2D with_class_ids (const Collection< rerun::components::ClassId > &_class_ids) &&
 Optional components::ClassIds for the lines.
 
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 LineStrips2D update_fields ()
 Update only some specific fields of a LineStrips2D.
 
static LineStrips2D clear_fields ()
 Clear all the fields of a LineStrips2D.
 

Public Attributes

std::optional< ComponentBatchstrips
 All the actual 2D line strips that make up the batch.
 
std::optional< ComponentBatchradii
 Optional radii for the line strips.
 
std::optional< ComponentBatchcolors
 Optional colors for the line strips.
 
std::optional< ComponentBatchlabels
 Optional text labels for the line strips.
 
std::optional< ComponentBatchshow_labels
 Optional choice of whether the text labels should be shown by default.
 
std::optional< ComponentBatchdraw_order
 An optional floating point value that specifies the 2D drawing order of each line strip.
 
std::optional< ComponentBatchclass_ids
 Optional components::ClassIds for the lines.
 

Static Public Attributes

static constexpr const char IndicatorComponentName []
 
static constexpr const char ArchetypeName [] = "rerun.archetypes.LineStrips2D"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_strips
 ComponentDescriptor for the strips 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 line strips with positions and optional colors, radii, labels, etc.

Examples

line_strips2d_batch:

image

#include <rerun.hpp>
#include <vector>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_line_strip2d_batch");
rec.spawn().exit_on_failure();
rerun::Collection<rerun::Vec2D> strip1 = {{0.f, 0.f}, {2.f, 1.f}, {4.f, -1.f}, {6.f, 0.f}};
{{0.f, 3.f}, {1.f, 4.f}, {2.f, 2.f}, {3.f, 4.f}, {4.f, 2.f}, {5.f, 4.f}, {6.f, 3.f}};
rec.log(
"strips",
rerun::LineStrips2D({strip1, strip2})
.with_colors({0xFF0000FF, 0x00FF00FF})
.with_radii({0.025f, 0.005f})
.with_labels({"one strip here", "and one strip there"})
);
// TODO(#5520): log VisualBounds2D
}
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:60
Archetype: 2D line strips with positions and optional colors, radii, labels, etc.
Definition line_strips2d.hpp:89
LineStrips2D with_labels(const Collection< rerun::components::Text > &_labels) &&
Optional text labels for the line strips.
Definition line_strips2d.hpp:202
LineStrips2D with_radii(const Collection< rerun::components::Radius > &_radii) &&
Optional radii for the line strips.
Definition line_strips2d.hpp:187
LineStrips2D with_colors(const Collection< rerun::components::Color > &_colors) &&
Optional colors for the line strips.
Definition line_strips2d.hpp:193

Lines with scene & UI radius each

#include <rerun.hpp>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_line_strip2d_ui_radius");
rec.spawn().exit_on_failure();
// A blue line with a scene unit radii of 0.01.
rerun::LineStrip2D linestrip_blue({{0.f, 0.f}, {0.f, 1.f}, {1.f, 0.f}, {1.f, 1.f}});
rec.log(
"scene_unit_line",
rerun::LineStrips2D(linestrip_blue)
// By default, radii are interpreted as world-space units.
.with_radii(0.01f)
);
// A red line with a ui point radii of 5.
// UI points are independent of zooming in Views, but are sensitive to the application UI scaling.
// For 100 % ui scaling, UI points are equal to pixels.
rerun::LineStrip2D linestrip_red({{3.f, 0.f}, {3.f, 1.f}, {4.f, 0.f}, {4.f, 1.f}});
rec.log(
"ui_points_line",
rerun::LineStrips2D(linestrip_red)
// By default, radii are interpreted as world-space units.
);
// TODO(#5520): log VisualBounds2D
}
Component: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition color.hpp:18
Component: A line strip in 2D space.
Definition line_strip2d.hpp:34
static Radius ui_points(float radius_in_ui_points)
Creates a new radius in ui points.
Definition radius.hpp:36

Member Function Documentation

◆ with_labels()

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

Optional text labels for the line strips.

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

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

LineStrips2D rerun::archetypes::LineStrips2D::with_draw_order ( const rerun::components::DrawOrder _draw_order) &&
inline

An optional floating point value that specifies the 2D drawing order of each line strip.

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

◆ with_many_draw_order()

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

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

Optional components::ClassIds for the lines.

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

◆ columns() [1/2]

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

Optional text labels for the line strips.

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.

◆ draw_order

std::optional<ComponentBatch> rerun::archetypes::LineStrips2D::draw_order

An optional floating point value that specifies the 2D drawing order of each line strip.

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

◆ class_ids

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

Optional components::ClassIds for the lines.

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

◆ IndicatorComponentName

constexpr const char rerun::archetypes::LineStrips2D::IndicatorComponentName[]
staticconstexpr
Initial value:
=
"rerun.components.LineStrips2DIndicator"

◆ Descriptor_strips

constexpr auto rerun::archetypes::LineStrips2D::Descriptor_strips
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "strips",
Loggable<rerun::components::LineStrip2D>::Descriptor.component_name
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition line_strips2d.hpp:126

ComponentDescriptor for the strips field.

◆ Descriptor_radii

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

ComponentDescriptor for the radii field.

◆ Descriptor_colors

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

ComponentDescriptor for the colors field.

◆ Descriptor_labels

constexpr auto rerun::archetypes::LineStrips2D::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::LineStrips2D::Descriptor_show_labels
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "show_labels",
Loggable<rerun::components::ShowLabels>::Descriptor.component_name
)

ComponentDescriptor for the show_labels field.

◆ Descriptor_draw_order

constexpr auto rerun::archetypes::LineStrips2D::Descriptor_draw_order
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "draw_order",
Loggable<rerun::components::DrawOrder>::Descriptor.component_name
)

ComponentDescriptor for the draw_order field.

◆ Descriptor_class_ids

constexpr auto rerun::archetypes::LineStrips2D::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: