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

Archetype: A list of nodes in a graph with optional labels, colors, etc. More...

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

 GraphNodes (GraphNodes &&other)=default
 
 GraphNodes (const GraphNodes &other)=default
 
GraphNodesoperator= (const GraphNodes &other)=default
 
GraphNodesoperator= (GraphNodes &&other)=default
 
 GraphNodes (Collection< rerun::components::GraphNode > _node_ids)
 
GraphNodes with_node_ids (const Collection< rerun::components::GraphNode > &_node_ids) &&
 A list of node IDs.
 
GraphNodes with_positions (const Collection< rerun::components::Position2D > &_positions) &&
 Optional center positions of the nodes.
 
GraphNodes with_colors (const Collection< rerun::components::Color > &_colors) &&
 Optional colors for the boxes.
 
GraphNodes with_labels (const Collection< rerun::components::Text > &_labels) &&
 Optional text labels for the node.
 
GraphNodes with_show_labels (const rerun::components::ShowLabels &_show_labels) &&
 Optional choice of whether the text labels should be shown by default.
 
GraphNodes 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.
 
GraphNodes with_radii (const Collection< rerun::components::Radius > &_radii) &&
 Optional radii for nodes.
 
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 GraphNodes update_fields ()
 Update only some specific fields of a GraphNodes.
 
static GraphNodes clear_fields ()
 Clear all the fields of a GraphNodes.
 

Public Attributes

std::optional< ComponentBatchnode_ids
 A list of node IDs.
 
std::optional< ComponentBatchpositions
 Optional center positions of the nodes.
 
std::optional< ComponentBatchcolors
 Optional colors for the boxes.
 
std::optional< ComponentBatchlabels
 Optional text labels for the node.
 
std::optional< ComponentBatchshow_labels
 Optional choice of whether the text labels should be shown by default.
 
std::optional< ComponentBatchradii
 Optional radii for nodes.
 

Static Public Attributes

static constexpr const char IndicatorComponentName []
 
static constexpr const char ArchetypeName [] = "rerun.archetypes.GraphNodes"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_node_ids
 ComponentDescriptor for the node_ids field.
 
static constexpr auto Descriptor_positions
 ComponentDescriptor for the positions 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_radii
 ComponentDescriptor for the radii field.
 

Detailed Description

Archetype: A list of nodes in a graph with optional labels, colors, etc.

Example

Simple directed graph

image

#include <rerun.hpp>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_graph_directed");
rec.spawn().exit_on_failure();
rec.log(
"simple",
rerun::GraphNodes({"a", "b", "c"})
.with_positions({{0.0, 100.0}, {-100.0, 0.0}, {100.0, 0.0}})
.with_labels({"A", "B", "C"}),
rerun::GraphEdges({{"a", "b"}, {"b", "c"}, {"c", "a"}})
// Graphs are undirected by default.
);
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:60
@ Directed
The graph has directed edges.
Archetype: A list of edges in a graph.
Definition graph_edges.hpp:47
Archetype: A list of nodes in a graph with optional labels, colors, etc.
Definition graph_nodes.hpp:49
GraphNodes with_labels(const Collection< rerun::components::Text > &_labels) &&
Optional text labels for the node.
Definition graph_nodes.hpp:145
GraphNodes with_positions(const Collection< rerun::components::Position2D > &_positions) &&
Optional center positions of the nodes.
Definition graph_nodes.hpp:132

Member Function Documentation

◆ with_many_show_labels()

GraphNodes rerun::archetypes::GraphNodes::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.

◆ columns() [1/2]

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

◆ IndicatorComponentName

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

◆ Descriptor_node_ids

constexpr auto rerun::archetypes::GraphNodes::Descriptor_node_ids
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "node_ids",
Loggable<rerun::components::GraphNode>::Descriptor.component_name
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition graph_nodes.hpp:75

ComponentDescriptor for the node_ids field.

◆ Descriptor_positions

constexpr auto rerun::archetypes::GraphNodes::Descriptor_positions
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "positions",
Loggable<rerun::components::Position2D>::Descriptor.component_name
)

ComponentDescriptor for the positions field.

◆ Descriptor_colors

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

ComponentDescriptor for the show_labels field.

◆ Descriptor_radii

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

ComponentDescriptor for the radii field.


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