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 = 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.

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_simple");
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: