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

Archetype: A list of edges in a graph. More...

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

 GraphEdges (GraphEdges &&other)=default
 
 GraphEdges (const GraphEdges &other)=default
 
GraphEdgesoperator= (const GraphEdges &other)=default
 
GraphEdgesoperator= (GraphEdges &&other)=default
 
 GraphEdges (Collection< rerun::components::GraphEdge > _edges)
 
GraphEdges with_edges (const Collection< rerun::components::GraphEdge > &_edges) &&
 A list of node tuples.
 
GraphEdges with_graph_type (const rerun::components::GraphType &_graph_type) &&
 Specifies if the graph is directed or undirected.
 
GraphEdges with_many_graph_type (const Collection< rerun::components::GraphType > &_graph_type) &&
 This method makes it possible to pack multiple graph_type 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 GraphEdges update_fields ()
 Update only some specific fields of a GraphEdges.
 
static GraphEdges clear_fields ()
 Clear all the fields of a GraphEdges.
 

Public Attributes

std::optional< ComponentBatchedges
 A list of node tuples.
 
std::optional< ComponentBatchgraph_type
 Specifies if the graph is directed or undirected.
 

Static Public Attributes

static constexpr const char IndicatorComponentName []
 
static constexpr const char ArchetypeName [] = "rerun.archetypes.GraphEdges"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_edges
 ComponentDescriptor for the edges field.
 
static constexpr auto Descriptor_graph_type
 ComponentDescriptor for the graph_type field.
 

Detailed Description

Archetype: A list of edges in a graph.

By default, edges are undirected.

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
GraphEdges with_graph_type(const rerun::components::GraphType &_graph_type) &&
Specifies if the graph is directed or undirected.
Definition graph_edges.hpp:104
Archetype: A list of nodes in a graph with optional labels, colors, etc.
Definition graph_nodes.hpp:49

Member Function Documentation

◆ with_graph_type()

GraphEdges rerun::archetypes::GraphEdges::with_graph_type ( const rerun::components::GraphType _graph_type) &&
inline

Specifies if the graph is directed or undirected.

If no components::GraphType is provided, the graph is assumed to be undirected.

◆ with_many_graph_type()

GraphEdges rerun::archetypes::GraphEdges::with_many_graph_type ( const Collection< rerun::components::GraphType > &  _graph_type) &&
inline

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

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

◆ columns() [1/2]

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

◆ graph_type

std::optional<ComponentBatch> rerun::archetypes::GraphEdges::graph_type

Specifies if the graph is directed or undirected.

If no components::GraphType is provided, the graph is assumed to be undirected.

◆ IndicatorComponentName

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

◆ Descriptor_edges

constexpr auto rerun::archetypes::GraphEdges::Descriptor_edges
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "edges",
Loggable<rerun::components::GraphEdge>::Descriptor.component_name
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition graph_edges.hpp:63

ComponentDescriptor for the edges field.

◆ Descriptor_graph_type

constexpr auto rerun::archetypes::GraphEdges::Descriptor_graph_type
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "graph_type",
Loggable<rerun::components::GraphType>::Descriptor.component_name
)

ComponentDescriptor for the graph_type field.


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