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 (Collection< rerun::components::LineStrip2D > _strips)
 
LineStrips2D with_radii (Collection< rerun::components::Radius > _radii) &&
 Optional radii for the line strips.
 
LineStrips2D with_colors (Collection< rerun::components::Color > _colors) &&
 Optional colors for the line strips.
 
LineStrips2D with_labels (Collection< rerun::components::Text > _labels) &&
 Optional text labels for the line strips.
 
LineStrips2D with_show_labels (rerun::components::ShowLabels _show_labels) &&
 Optional choice of whether the text labels should be shown by default.
 
LineStrips2D with_draw_order (rerun::components::DrawOrder _draw_order) &&
 An optional floating point value that specifies the 2D drawing order of each line strip.
 
LineStrips2D with_class_ids (Collection< rerun::components::ClassId > _class_ids) &&
 Optional components::ClassIds for the lines.
 

Public Attributes

Collection< rerun::components::LineStrip2Dstrips
 All the actual 2D line strips that make up the batch.
 
std::optional< Collection< rerun::components::Radius > > radii
 Optional radii for the line strips.
 
std::optional< Collection< rerun::components::Color > > colors
 Optional colors for the line strips.
 
std::optional< Collection< rerun::components::Text > > labels
 Optional text labels for the line strips.
 
std::optional< rerun::components::ShowLabelsshow_labels
 Optional choice of whether the text labels should be shown by default.
 
std::optional< rerun::components::DrawOrderdraw_order
 An optional floating point value that specifies the 2D drawing order of each line strip.
 
std::optional< Collection< rerun::components::ClassId > > class_ids
 Optional components::ClassIds for the lines.
 

Static Public Attributes

static constexpr const char IndicatorComponentName []
 

Detailed Description

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

Examples

line_strip2d_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:91
LineStrips2D with_labels(Collection< rerun::components::Text > _labels) &&
Optional text labels for the line strips.
Definition line_strips2d.hpp:152
LineStrips2D with_radii(Collection< rerun::components::Radius > _radii) &&
Optional radii for the line strips.
Definition line_strips2d.hpp:135
LineStrips2D with_colors(Collection< rerun::components::Color > _colors) &&
Optional colors for the line strips.
Definition line_strips2d.hpp:142

Lines with scene & UI radius each

#include <rerun.hpp>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_line_strip3d_ui_radius");
rec.spawn().exit_on_failure();
// A blue line with a scene unit radii of 0.01.
rerun::LineStrip3D linestrip_blue(
{{0.f, 0.f, 0.f}, {0.f, 0.f, 1.f}, {1.f, 0.f, 0.f}, {1.f, 0.f, 1.f}}
);
rec.log(
"scene_unit_line",
rerun::LineStrips3D(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::LineStrip3D linestrip_red(
{{3.f, 0.f, 0.f}, {3.f, 0.f, 1.f}, {4.f, 0.f, 0.f}, {4.f, 0.f, 1.f}}
);
rec.log(
"ui_points_line",
rerun::LineStrips3D(linestrip_red)
// By default, radii are interpreted as world-space units.
);
}
Archetype: 3D line strips with positions and optional colors, radii, labels, etc.
Definition line_strips3d.hpp:103
Component: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition color.hpp:17
Component: A line strip in 3D space.
Definition line_strip3d.hpp:33
static Radius ui_points(float radius_in_ui_points)
Creates a new radius in ui points.
Definition radius.hpp:35

Member Function Documentation

◆ with_labels()

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

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

◆ with_class_ids()

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

Optional components::ClassIds for the lines.

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

Member Data Documentation

◆ labels

std::optional<Collection<rerun::components::Text> > 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<rerun::components::DrawOrder> 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.

◆ class_ids

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

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