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

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

#include <rerun/archetypes/arrows3d.hpp>

Public Types

using IndicatorComponent = components::IndicatorComponent< IndicatorComponentName >
 Indicator component, used to identify the archetype when converting to a list of components.
 

Public Member Functions

 Arrows3D (Arrows3D &&other)=default
 
Arrows3D with_origins (Collection< rerun::components::Position3D > _origins) &&
 All the origin (base) positions for each arrow in the batch.
 
Arrows3D with_radii (Collection< rerun::components::Radius > _radii) &&
 Optional radii for the arrows.
 
Arrows3D with_colors (Collection< rerun::components::Color > _colors) &&
 Optional colors for the points.
 
Arrows3D with_labels (Collection< rerun::components::Text > _labels) &&
 Optional text labels for the arrows.
 
Arrows3D with_class_ids (Collection< rerun::components::ClassId > _class_ids) &&
 Optional class Ids for the points.
 
Arrows3D with_instance_keys (Collection< rerun::components::InstanceKey > _instance_keys) &&
 Unique identifiers for each individual point in the batch.
 
size_t num_instances () const
 Returns the number of primary instances of this archetype.
 

Static Public Member Functions

static Arrows3D from_vectors (Collection< components::Vector3D > vectors_)
 Creates new 3D arrows pointing in the given directions, with a base at the origin (0, 0, 0).
 

Public Attributes

Collection< rerun::components::Vector3Dvectors
 All the vectors for each arrow in the batch.
 
std::optional< Collection< rerun::components::Position3D > > origins
 All the origin (base) positions for each arrow in the batch.
 
std::optional< Collection< rerun::components::Radius > > radii
 Optional radii for the arrows.
 
std::optional< Collection< rerun::components::Color > > colors
 Optional colors for the points.
 
std::optional< Collection< rerun::components::Text > > labels
 Optional text labels for the arrows.
 
std::optional< Collection< rerun::components::ClassId > > class_ids
 Optional class Ids for the points.
 
std::optional< Collection< rerun::components::InstanceKey > > instance_keys
 Unique identifiers for each individual point in the batch.
 

Static Public Attributes

static constexpr const char IndicatorComponentName [] = "rerun.components.Arrows3DIndicator"
 

Detailed Description

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

Example

Simple batch of 3D Arrows

image

#include <rerun.hpp>
#include <cmath>
#include <vector>
constexpr float TAU = 6.28318530717958647692528676655900577f;
int main() {
const auto rec = rerun::RecordingStream("rerun_example_arrow3d");
rec.spawn().exit_on_failure();
std::vector<rerun::Position3D> origins;
std::vector<rerun::Vector3D> vectors;
std::vector<rerun::Color> colors;
for (int i = 0; i <100; ++i) {
origins.push_back({0, 0, 0});
float angle = TAU * static_cast<float>(i) * 0.01f;
float length = log2f(static_cast<float>(i + 1));
vectors.push_back({length * sinf(angle), 0.0, length * cosf(angle)});
uint8_t c = static_cast<uint8_t>(round(angle / TAU * 255.0f));
colors.push_back({static_cast<uint8_t>(255 - c), c, 128, 128});
}
rec.log(
"arrows",
rerun::Arrows3D::from_vectors(vectors).with_origins(origins).with_colors(colors)
);
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:57
Collection< rerun::components::Vector3D > vectors
All the vectors for each arrow in the batch.
Definition arrows3d.hpp:67
std::optional< Collection< rerun::components::Color > > colors
Optional colors for the points.
Definition arrows3d.hpp:81
std::optional< Collection< rerun::components::Position3D > > origins
All the origin (base) positions for each arrow in the batch.
Definition arrows3d.hpp:72

Member Function Documentation

◆ with_origins()

Arrows3D rerun::archetypes::Arrows3D::with_origins ( Collection< rerun::components::Position3D _origins) &&
inline

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

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

◆ with_radii()

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

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

Optional class Ids for the points.

The class ID provides colors and labels if not specified explicitly.

Member Data Documentation

◆ origins

std::optional<Collection<rerun::components::Position3D> > rerun::archetypes::Arrows3D::origins

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

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

◆ radii

std::optional<Collection<rerun::components::Radius> > rerun::archetypes::Arrows3D::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.

◆ class_ids

std::optional<Collection<rerun::components::ClassId> > rerun::archetypes::Arrows3D::class_ids

Optional class Ids for the points.

The class ID provides colors and labels if not specified explicitly.


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