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

Archetype: Empties all the components of an entity. More...

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

 Clear (bool _is_recursive=false)
 
 Clear (Clear &&other)=default
 
 Clear (const Clear &other)=default
 
Clearoperator= (const Clear &other)=default
 
Clearoperator= (Clear &&other)=default
 
 Clear (rerun::components::ClearIsRecursive _is_recursive)
 
Clear with_is_recursive (const rerun::components::ClearIsRecursive &_is_recursive) &&
 
Clear with_many_is_recursive (const Collection< rerun::components::ClearIsRecursive > &_is_recursive) &&
 This method makes it possible to pack multiple is_recursive in a single component batch.
 
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 Clear update_fields ()
 Update only some specific fields of a Clear.
 
static Clear clear_fields ()
 Clear all the fields of a Clear.
 

Public Attributes

std::optional< ComponentBatchis_recursive
 

Static Public Attributes

static constexpr const char IndicatorComponentName [] = "rerun.components.ClearIndicator"
 
static constexpr const char ArchetypeName [] = "rerun.archetypes.Clear"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_is_recursive
 ComponentDescriptor for the is_recursive field.
 
static RERUN_SDK_EXPORT const Clear FLAT
 
static RERUN_SDK_EXPORT const Clear RECURSIVE
 

Detailed Description

Archetype: Empties all the components of an entity.

The presence of a clear means that a latest-at query of components at a given path(s) will not return any components that were logged at those paths before the clear. Any logged components after the clear are unaffected by the clear.

This implies that a range query that includes time points that are before the clear, still returns all components at the given path(s). Meaning that in practice clears are ineffective when making use of visible time ranges. Scalar plots are an exception: they track clears and use them to represent holes in the data (i.e. discontinuous lines).

Example

Flat

image

#include <rerun.hpp>
#include <cmath>
#include <numeric>
#include <string> // to_string
#include <vector>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_clear");
rec.spawn().exit_on_failure();
std::vector<rerun::Vector3D> vectors = {
{1.0, 0.0, 0.0},
{0.0, -1.0, 0.0},
{-1.0, 0.0, 0.0},
{0.0, 1.0, 0.0},
};
std::vector<rerun::Position3D> origins = {
{-0.5, 0.5, 0.0},
{0.5, 0.5, 0.0},
{0.5, -0.5, 0.0},
{-0.5, -0.5, 0.0},
};
std::vector<rerun::Color> colors = {
{200, 0, 0},
{0, 200, 0},
{0, 0, 200},
{200, 0, 200},
};
// Log a handful of arrows.
for (size_t i = 0; i <vectors.size(); ++i) {
auto entity_path = "arrows/" + std::to_string(i);
rec.log(
entity_path,
rerun::Arrows3D::from_vectors(vectors[i])
.with_origins(origins[i])
.with_colors(colors[i])
);
}
// Now clear them, one by one on each tick.
for (size_t i = 0; i <vectors.size(); ++i) {
auto entity_path = "arrows/" + std::to_string(i);
rec.log(entity_path, rerun::Clear::FLAT);
}
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:60

Member Function Documentation

◆ with_many_is_recursive()

Clear rerun::archetypes::Clear::with_many_is_recursive ( const Collection< rerun::components::ClearIsRecursive > &  _is_recursive) &&
inline

This method makes it possible to pack multiple is_recursive in a single component batch.

This only makes sense when used in conjunction with columns. with_is_recursive should be used when logging a single row's worth of data.

◆ columns() [1/2]

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

◆ Descriptor_is_recursive

constexpr auto rerun::archetypes::Clear::Descriptor_is_recursive
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "is_recursive",
Loggable<rerun::components::ClearIsRecursive>::Descriptor.component_name
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition clear.hpp:95

ComponentDescriptor for the is_recursive field.


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