6#include "../../archetype_utils.hpp"
7#include "../../blueprint/components/enabled.hpp"
8#include "../../blueprint/components/force_distance.hpp"
9#include "../../blueprint/components/force_iterations.hpp"
10#include "../../collection.hpp"
11#include "../../component_batch.hpp"
12#include "../../component_column.hpp"
13#include "../../result.hpp"
20namespace rerun::blueprint::archetypes {
41 static constexpr const char ArchetypeName[] =
"rerun.blueprint.archetypes.ForceLink";
79 return std::move(*
this);
86 return std::move(*
this);
96 return std::move(*
this);
126 template <
typename T>
131 struct AsComponents<blueprint::archetypes::ForceLink> {
136 return detail::collect_batches(
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
A class for representing either a usable value, or an error.
Definition result.hpp:14
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26
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: Aims to achieve a target distance between two nodes that are connected by an edge.
Definition force_link.hpp:25
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition force_link.hpp:41
std::optional< ComponentBatch > distance
The target distance between two nodes.
Definition force_link.hpp:32
std::optional< ComponentBatch > iterations
Specifies how often this force should be applied per iteration.
Definition force_link.hpp:37
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition force_link.hpp:107
static constexpr auto Descriptor_iterations
ComponentDescriptor for the iterations field.
Definition force_link.hpp:54
ForceLink with_distance(const rerun::blueprint::components::ForceDistance &_distance) &&
The target distance between two nodes.
Definition force_link.hpp:83
static constexpr auto Descriptor_enabled
ComponentDescriptor for the enabled field.
Definition force_link.hpp:44
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition force_link.hpp:116
static constexpr auto Descriptor_distance
ComponentDescriptor for the distance field.
Definition force_link.hpp:49
std::optional< ComponentBatch > enabled
Whether the link force is enabled.
Definition force_link.hpp:29
ForceLink with_enabled(const rerun::blueprint::components::Enabled &_enabled) &&
Whether the link force is enabled.
Definition force_link.hpp:77
ForceLink with_iterations(const rerun::blueprint::components::ForceIterations &_iterations) &&
Specifies how often this force should be applied per iteration.
Definition force_link.hpp:92
static ForceLink clear_fields()
Clear all the fields of a ForceLink.
static ForceLink update_fields()
Update only some specific fields of a ForceLink.
Definition force_link.hpp:67
Component: Whether a procedure is enabled.
Definition enabled.hpp:17
Component: The target distance between two nodes.
Definition force_distance.hpp:19
Component: Specifies how often this force should be applied per iteration.
Definition force_iterations.hpp:19