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

Archetype: 3D capsules; cylinders with hemispherical caps. More...

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

 Capsules3D (Capsules3D &&other)=default
 
 Capsules3D (const Capsules3D &other)=default
 
Capsules3Doperator= (const Capsules3D &other)=default
 
Capsules3Doperator= (Capsules3D &&other)=default
 
Capsules3D with_lengths (const Collection< rerun::components::Length > &_lengths) &&
 Lengths of the capsules, defined as the distance between the centers of the endcaps.
 
Capsules3D with_radii (const Collection< rerun::components::Radius > &_radii) &&
 Radii of the capsules.
 
Capsules3D with_translations (const Collection< rerun::components::PoseTranslation3D > &_translations) &&
 Optional translations of the capsules.
 
Capsules3D with_rotation_axis_angles (const Collection< rerun::components::PoseRotationAxisAngle > &_rotation_axis_angles) &&
 Rotations via axis + angle.
 
Capsules3D with_quaternions (const Collection< rerun::components::PoseRotationQuat > &_quaternions) &&
 Rotations via quaternion.
 
Capsules3D with_colors (const Collection< rerun::components::Color > &_colors) &&
 Optional colors for the capsules.
 
Capsules3D with_labels (const Collection< rerun::components::Text > &_labels) &&
 Optional text labels for the capsules, which will be located at their centers.
 
Capsules3D with_show_labels (const rerun::components::ShowLabels &_show_labels) &&
 Optional choice of whether the text labels should be shown by default.
 
Capsules3D 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.
 
Capsules3D with_class_ids (const Collection< rerun::components::ClassId > &_class_ids) &&
 Optional class ID for the ellipsoids.
 
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 Capsules3D from_lengths_and_radii (const std::vector< float > &lengths, const std::vector< float > &radii)
 Creates a new Capsules3D with the given axis-aligned lengths and radii.
 
static Capsules3D update_fields ()
 Update only some specific fields of a Capsules3D.
 
static Capsules3D clear_fields ()
 Clear all the fields of a Capsules3D.
 

Public Attributes

std::optional< ComponentBatchlengths
 Lengths of the capsules, defined as the distance between the centers of the endcaps.
 
std::optional< ComponentBatchradii
 Radii of the capsules.
 
std::optional< ComponentBatchtranslations
 Optional translations of the capsules.
 
std::optional< ComponentBatchrotation_axis_angles
 Rotations via axis + angle.
 
std::optional< ComponentBatchquaternions
 Rotations via quaternion.
 
std::optional< ComponentBatchcolors
 Optional colors for the capsules.
 
std::optional< ComponentBatchlabels
 Optional text labels for the capsules, which will be located at their centers.
 
std::optional< ComponentBatchshow_labels
 Optional choice of whether the text labels should be shown by default.
 
std::optional< ComponentBatchclass_ids
 Optional class ID for the ellipsoids.
 

Static Public Attributes

static constexpr const char IndicatorComponentName []
 
static constexpr const char ArchetypeName [] = "rerun.archetypes.Capsules3D"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_lengths
 ComponentDescriptor for the lengths field.
 
static constexpr auto Descriptor_radii
 ComponentDescriptor for the radii field.
 
static constexpr auto Descriptor_translations
 ComponentDescriptor for the translations field.
 
static constexpr auto Descriptor_rotation_axis_angles
 ComponentDescriptor for the rotation_axis_angles field.
 
static constexpr auto Descriptor_quaternions
 ComponentDescriptor for the quaternions 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 capsules; cylinders with hemispherical caps.

Capsules are defined by two endpoints (the centers of their end cap spheres), which are located at (0, 0, 0) and (0, 0, length), that is, extending along the positive direction of the Z axis. Capsules in other orientations may be produced by applying a rotation to the entity or instances.

Example

Batch of capsules

image

#include <rerun.hpp>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_capsule3d_batch");
rec.spawn().exit_on_failure();
rec.log(
"capsules",
rerun::Capsules3D::from_lengths_and_radii(
{0.0f, 2.0f, 4.0f, 6.0f, 8.0f},
{1.0f, 0.5f, 0.5f, 0.5f, 1.0f}
)
rerun::Rgba32(255, 0, 0),
rerun::Rgba32(188, 188, 0),
rerun::Rgba32(0, 255, 0),
rerun::Rgba32(0, 188, 188),
rerun::Rgba32(0, 0, 255),
})
{0.0f, 0.0f, 0.0f},
{2.0f, 0.0f, 0.0f},
{4.0f, 0.0f, 0.0f},
{6.0f, 0.0f, 0.0f},
{8.0f, 0.0f, 0.0f},
})
rerun::RotationAxisAngle({1.0f, 0.0f, 0.0f}, rerun::Angle::degrees(-22.5)),
rerun::RotationAxisAngle({1.0f, 0.0f, 0.0f}, rerun::Angle::degrees(-45.0)),
rerun::RotationAxisAngle({1.0f, 0.0f, 0.0f}, rerun::Angle::degrees(-67.5)),
rerun::RotationAxisAngle({1.0f, 0.0f, 0.0f}, rerun::Angle::degrees(-90.0)),
})
);
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:60
Capsules3D with_translations(const Collection< rerun::components::PoseTranslation3D > &_translations) &&
Optional translations of the capsules.
Definition capsules3d.hpp:227
Capsules3D with_rotation_axis_angles(const Collection< rerun::components::PoseRotationAxisAngle > &_rotation_axis_angles) &&
Rotations via axis + angle.
Definition capsules3d.hpp:239
Capsules3D with_colors(const Collection< rerun::components::Color > &_colors) &&
Optional colors for the capsules.
Definition capsules3d.hpp:263
static Angle degrees(float degrees_)
New angle in degrees.
Definition angle.hpp:40
Datatype: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition rgba32.hpp:28
Datatype: 3D rotation represented by a rotation around a given axis.
Definition rotation_axis_angle.hpp:22

Member Function Documentation

◆ from_lengths_and_radii()

static Capsules3D rerun::archetypes::Capsules3D::from_lengths_and_radii ( const std::vector< float > &  lengths,
const std::vector< float > &  radii 
)
inlinestatic

Creates a new Capsules3D with the given axis-aligned lengths and radii.

For multiple capsules, you should generally follow this with Capsules3D::with_translations() and one of the rotation methods, in order to move them apart from each other.

◆ with_translations()

Capsules3D rerun::archetypes::Capsules3D::with_translations ( const Collection< rerun::components::PoseTranslation3D > &  _translations) &&
inline

Optional translations of the capsules.

If not specified, one end of each capsule will be at (0, 0, 0). Note that this uses a components::PoseTranslation3D which is also used by archetypes::InstancePoses3D.

◆ with_rotation_axis_angles()

Capsules3D rerun::archetypes::Capsules3D::with_rotation_axis_angles ( const Collection< rerun::components::PoseRotationAxisAngle > &  _rotation_axis_angles) &&
inline

Rotations via axis + angle.

If no rotation is specified, the capsules align with the +Z axis of the local coordinate system. Note that this uses a components::PoseRotationAxisAngle which is also used by archetypes::InstancePoses3D.

◆ with_quaternions()

Capsules3D rerun::archetypes::Capsules3D::with_quaternions ( const Collection< rerun::components::PoseRotationQuat > &  _quaternions) &&
inline

Rotations via quaternion.

If no rotation is specified, the capsules align with the +Z axis of the local coordinate system. Note that this uses a components::PoseRotationQuat which is also used by archetypes::InstancePoses3D.

◆ with_many_show_labels()

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

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

Optional class ID for the ellipsoids.

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

◆ columns() [1/2]

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

◆ translations

std::optional<ComponentBatch> rerun::archetypes::Capsules3D::translations

Optional translations of the capsules.

If not specified, one end of each capsule will be at (0, 0, 0). Note that this uses a components::PoseTranslation3D which is also used by archetypes::InstancePoses3D.

◆ rotation_axis_angles

std::optional<ComponentBatch> rerun::archetypes::Capsules3D::rotation_axis_angles

Rotations via axis + angle.

If no rotation is specified, the capsules align with the +Z axis of the local coordinate system. Note that this uses a components::PoseRotationAxisAngle which is also used by archetypes::InstancePoses3D.

◆ quaternions

std::optional<ComponentBatch> rerun::archetypes::Capsules3D::quaternions

Rotations via quaternion.

If no rotation is specified, the capsules align with the +Z axis of the local coordinate system. Note that this uses a components::PoseRotationQuat which is also used by archetypes::InstancePoses3D.

◆ class_ids

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

Optional class ID for the ellipsoids.

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

◆ IndicatorComponentName

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

◆ Descriptor_lengths

constexpr auto rerun::archetypes::Capsules3D::Descriptor_lengths
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "lengths", Loggable<rerun::components::Length>::Descriptor.component_name
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition capsules3d.hpp:122

ComponentDescriptor for the lengths field.

◆ Descriptor_radii

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

ComponentDescriptor for the radii field.

◆ Descriptor_translations

constexpr auto rerun::archetypes::Capsules3D::Descriptor_translations
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "translations",
Loggable<rerun::components::PoseTranslation3D>::Descriptor.component_name
)

ComponentDescriptor for the translations field.

◆ Descriptor_rotation_axis_angles

constexpr auto rerun::archetypes::Capsules3D::Descriptor_rotation_axis_angles
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "rotation_axis_angles",
Loggable<rerun::components::PoseRotationAxisAngle>::Descriptor.component_name
)

ComponentDescriptor for the rotation_axis_angles field.

◆ Descriptor_quaternions

constexpr auto rerun::archetypes::Capsules3D::Descriptor_quaternions
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "quaternions",
Loggable<rerun::components::PoseRotationQuat>::Descriptor.component_name
)

ComponentDescriptor for the quaternions field.

◆ Descriptor_colors

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

ComponentDescriptor for the show_labels field.

◆ Descriptor_class_ids

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