6#include "../archetype_utils.hpp"
7#include "../collection.hpp"
8#include "../component_batch.hpp"
9#include "../component_column.hpp"
10#include "../components/color.hpp"
11#include "../components/graph_node.hpp"
12#include "../components/position2d.hpp"
13#include "../components/radius.hpp"
14#include "../components/show_labels.hpp"
15#include "../components/text.hpp"
16#include "../result.hpp"
57 std::optional<ComponentBatch>
colors;
60 std::optional<ComponentBatch>
labels;
69 std::optional<ComponentBatch>
radii;
73 static constexpr const char ArchetypeName[] =
"rerun.archetypes.GraphNodes";
112 .value_or_throw()) {}
126 return std::move(*
this);
133 return std::move(*
this);
139 return std::move(*
this);
145 return std::move(*
this);
155 return std::move(*
this);
167 return std::move(*
this);
173 return std::move(*
this);
185 return detail::partition_batches(
197 return detail::partition_batches_of_unit_length(
208 template <
typename T>
213 struct AsComponents<archetypes::GraphNodes> {
215 static Result<Collection<ComponentBatch>> as_batches(
const archetypes::GraphNodes& archetype
217 return detail::collect_batches(
218 {&archetype.node_ids,
219 &archetype.positions,
222 &archetype.show_labels,
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:90
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26
Arrow-encoded data of a single batch of components together with a component descriptor.
Definition component_batch.hpp:28
static Result< ComponentBatch > from_loggable(const rerun::Collection< T > &components, const ComponentDescriptor &descriptor)
Creates a new component batch from a collection of component instances.
Definition component_batch.hpp:46
A ComponentDescriptor fully describes the semantics of a column of data.
Definition component_descriptor.hpp:16
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Archetype: A list of nodes in a graph with optional labels, colors, etc.
Definition graph_nodes.hpp:49
static constexpr auto Descriptor_labels
ComponentDescriptor for the labels field.
Definition graph_nodes.hpp:90
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition graph_nodes.hpp:184
static constexpr auto Descriptor_colors
ComponentDescriptor for the colors field.
Definition graph_nodes.hpp:86
std::optional< ComponentBatch > labels
Optional text labels for the node.
Definition graph_nodes.hpp:60
static GraphNodes clear_fields()
Clear all the fields of a GraphNodes.
static constexpr auto Descriptor_show_labels
ComponentDescriptor for the show_labels field.
Definition graph_nodes.hpp:94
GraphNodes with_show_labels(const rerun::components::ShowLabels &_show_labels) &&
Whether the text labels should be shown.
Definition graph_nodes.hpp:152
static GraphNodes update_fields()
Update only some specific fields of a GraphNodes.
Definition graph_nodes.hpp:115
static constexpr auto Descriptor_positions
ComponentDescriptor for the positions field.
Definition graph_nodes.hpp:81
static constexpr auto Descriptor_node_ids
ComponentDescriptor for the node_ids field.
Definition graph_nodes.hpp:76
std::optional< ComponentBatch > radii
Optional radii for nodes.
Definition graph_nodes.hpp:69
std::optional< ComponentBatch > colors
Optional colors for the boxes.
Definition graph_nodes.hpp:57
std::optional< ComponentBatch > show_labels
Whether the text labels should be shown.
Definition graph_nodes.hpp:66
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition graph_nodes.hpp:196
GraphNodes with_labels(const Collection< rerun::components::Text > &_labels) &&
Optional text labels for the node.
Definition graph_nodes.hpp:143
GraphNodes with_colors(const Collection< rerun::components::Color > &_colors) &&
Optional colors for the boxes.
Definition graph_nodes.hpp:137
static constexpr auto Descriptor_radii
ComponentDescriptor for the radii field.
Definition graph_nodes.hpp:99
GraphNodes with_positions(const Collection< rerun::components::Position2D > &_positions) &&
Optional center positions of the nodes.
Definition graph_nodes.hpp:130
std::optional< ComponentBatch > node_ids
A list of node IDs.
Definition graph_nodes.hpp:51
GraphNodes with_radii(const Collection< rerun::components::Radius > &_radii) &&
Optional radii for nodes.
Definition graph_nodes.hpp:171
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.
Definition graph_nodes.hpp:162
GraphNodes with_node_ids(const Collection< rerun::components::GraphNode > &_node_ids) &&
A list of node IDs.
Definition graph_nodes.hpp:123
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition graph_nodes.hpp:73
std::optional< ComponentBatch > positions
Optional center positions of the nodes.
Definition graph_nodes.hpp:54
Component: Whether the entity's components::Text label is shown.
Definition show_labels.hpp:18