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

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

#include <rerun/archetypes/line_strips3d.hpp>

Public Member Functions

 LineStrips3D (LineStrips3D &&other)=default
 
 LineStrips3D (const LineStrips3D &other)=default
 
LineStrips3Doperator= (const LineStrips3D &other)=default
 
LineStrips3Doperator= (LineStrips3D &&other)=default
 
 LineStrips3D (Collection< rerun::components::LineStrip3D > _strips)
 
LineStrips3D with_strips (const Collection< rerun::components::LineStrip3D > &_strips) &&
 All the actual 3D line strips that make up the batch.
 
LineStrips3D with_radii (const Collection< rerun::components::Radius > &_radii) &&
 Optional radii for the line strips.
 
LineStrips3D with_colors (const Collection< rerun::components::Color > &_colors) &&
 Optional colors for the line strips.
 
LineStrips3D with_labels (const Collection< rerun::components::Text > &_labels) &&
 Optional text labels for the line strips.
 
LineStrips3D with_show_labels (const rerun::components::ShowLabels &_show_labels) &&
 Whether the text labels should be shown.
 
LineStrips3D 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.
 
LineStrips3D 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 LineStrips3D update_fields ()
 Update only some specific fields of a LineStrips3D.
 
static LineStrips3D clear_fields ()
 Clear all the fields of a LineStrips3D.
 

Public Attributes

std::optional< ComponentBatchstrips
 All the actual 3D 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
 Whether the text labels should be shown.
 
std::optional< ComponentBatchclass_ids
 Optional components::ClassIds for the lines.
 

Static Public Attributes

static constexpr const char ArchetypeName [] = "rerun.archetypes.LineStrips3D"
 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_class_ids
 ComponentDescriptor for the class_ids field.
 

Detailed Description

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

Examples

Many strips

image

#include <rerun.hpp>
#include <vector>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_line_strip3d_batch");
rec.spawn().exit_on_failure();
{0.f, 0.f, 2.f},
{1.f, 0.f, 2.f},
{1.f, 1.f, 2.f},
{0.f, 1.f, 2.f},
};
{0.f, 0.f, 0.f},
{0.f, 0.f, 1.f},
{1.f, 0.f, 0.f},
{1.f, 0.f, 1.f},
{1.f, 1.f, 0.f},
{1.f, 1.f, 1.f},
{0.f, 1.f, 0.f},
{0.f, 1.f, 1.f},
};
rec.log(
"strips",
rerun::LineStrips3D({strip1, strip2})
.with_colors({0xFF0000FF, 0x00FF00FF})
.with_radii({0.025f, 0.005f})
.with_labels({"one strip here", "and one strip there"})
);
}
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:61
Archetype: 3D line strips with positions and optional colors, radii, labels, etc.
Definition line_strips3d.hpp:102
LineStrips3D with_colors(const Collection< rerun::components::Color > &_colors) &&
Optional colors for the line strips.
Definition line_strips3d.hpp:193
LineStrips3D with_labels(const Collection< rerun::components::Text > &_labels) &&
Optional text labels for the line strips.
Definition line_strips3d.hpp:202
LineStrips3D with_radii(const Collection< rerun::components::Radius > &_radii) &&
Optional radii for the line strips.
Definition line_strips3d.hpp:187

Lines with scene & UI radius each

image

#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.
);
}
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()

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

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

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

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

◆ show_labels

std::optional<ComponentBatch> rerun::archetypes::LineStrips3D::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.

◆ class_ids

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

Optional components::ClassIds for the lines.

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

◆ Descriptor_strips

constexpr auto rerun::archetypes::LineStrips3D::Descriptor_strips
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "LineStrips3D:strips",
Loggable<rerun::components::LineStrip3D>::ComponentType
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition line_strips3d.hpp:131

ComponentDescriptor for the strips field.

◆ Descriptor_radii

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

ComponentDescriptor for the radii field.

◆ Descriptor_colors

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

ComponentDescriptor for the colors field.

◆ Descriptor_labels

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

ComponentDescriptor for the labels field.

◆ Descriptor_show_labels

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

ComponentDescriptor for the show_labels field.

◆ Descriptor_class_ids

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

ComponentDescriptor for the class_ids field.


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