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

Archetype: A double-precision scalar, e.g. More...

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

 Scalar (Scalar &&other)=default
 
 Scalar (rerun::components::Scalar _scalar)
 

Public Attributes

rerun::components::Scalar scalar
 The scalar value to log.
 

Static Public Attributes

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

Detailed Description

Archetype: A double-precision scalar, e.g.

for use for time-series plots.

The current timeline value will be used for the time/X-axis, hence scalars cannot be static.

When used to produce a plot, this archetype is used to provide the data that is referenced by archetypes::SeriesLine or archetypes::SeriesPoint. You can do this by logging both archetypes to the same path, or alternatively configuring the plot-specific archetypes through the blueprint.

Example

Simple line plot

image

#include <rerun.hpp>
#include <cmath>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_scalar");
rec.spawn().exit_on_failure();
// Log the data on a timeline called "step".
for (int step = 0; step <64; ++step) {
rec.set_time_sequence("step", step);
rec.log("scalar", rerun::Scalar(std::sin(static_cast<double>(step) / 10.0)));
}
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:60
Archetype: A double-precision scalar, e.g.
Definition scalar.hpp:48

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