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 (rerun::components::ClearIsRecursive _is_recursive)
 
size_t num_instances () const
 Returns the number of primary instances of this archetype.
 

Public Attributes

rerun::components::ClearIsRecursive is_recursive
 

Static Public Attributes

static constexpr const char IndicatorComponentName [] = "rerun.components.ClearIndicator"
 
static const Clear FLAT
 
static 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:57

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