Rerun C++ SDK
Loading...
Searching...
No Matches
force_collision_radius.hpp
1// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/store/re_types/definitions/rerun/blueprint/archetypes/force_collision_radius.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/enabled.hpp"
7#include "../../blueprint/components/force_iterations.hpp"
8#include "../../blueprint/components/force_strength.hpp"
9#include "../../collection.hpp"
10#include "../../component_batch.hpp"
11#include "../../component_column.hpp"
12#include "../../result.hpp"
13
14#include <cstdint>
15#include <optional>
16#include <utility>
17#include <vector>
18
19namespace rerun::blueprint::archetypes {
20 /// **Archetype**: Resolves collisions between the bounding circles, according to the radius of the nodes.
21 ///
22 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
23 ///
25 /// Whether the collision force is enabled.
26 ///
27 /// The collision force resolves collisions between nodes based on the bounding circle defined by their radius.
28 std::optional<ComponentBatch> enabled;
29
30 /// The strength of the force.
31 std::optional<ComponentBatch> strength;
32
33 /// Specifies how often this force should be applied per iteration.
34 ///
35 /// Increasing this parameter can lead to better results at the cost of longer computation time.
36 std::optional<ComponentBatch> iterations;
37
38 public:
39 /// The name of the archetype as used in `ComponentDescriptor`s.
40 static constexpr const char ArchetypeName[] =
41 "rerun.blueprint.archetypes.ForceCollisionRadius";
42
43 /// `ComponentDescriptor` for the `enabled` field.
44 static constexpr auto Descriptor_enabled = ComponentDescriptor(
45 ArchetypeName, "ForceCollisionRadius:enabled",
47 );
48 /// `ComponentDescriptor` for the `strength` field.
50 ArchetypeName, "ForceCollisionRadius:strength",
52 );
53 /// `ComponentDescriptor` for the `iterations` field.
55 ArchetypeName, "ForceCollisionRadius:iterations",
57 );
58
59 public:
60 ForceCollisionRadius() = default;
62 ForceCollisionRadius(const ForceCollisionRadius& other) = default;
63 ForceCollisionRadius& operator=(const ForceCollisionRadius& other) = default;
64 ForceCollisionRadius& operator=(ForceCollisionRadius&& other) = default;
65
66 /// Update only some specific fields of a `ForceCollisionRadius`.
68 return ForceCollisionRadius();
69 }
70
71 /// Clear all the fields of a `ForceCollisionRadius`.
73
74 /// Whether the collision force is enabled.
75 ///
76 /// The collision force resolves collisions between nodes based on the bounding circle defined by their radius.
78 ) && {
79 enabled = ComponentBatch::from_loggable(_enabled, Descriptor_enabled).value_or_throw();
80 return std::move(*this);
81 }
82
83 /// The strength of the force.
86 ) && {
87 strength =
88 ComponentBatch::from_loggable(_strength, Descriptor_strength).value_or_throw();
89 return std::move(*this);
90 }
91
92 /// Specifies how often this force should be applied per iteration.
93 ///
94 /// Increasing this parameter can lead to better results at the cost of longer computation time.
97 ) && {
99 ComponentBatch::from_loggable(_iterations, Descriptor_iterations).value_or_throw();
100 return std::move(*this);
101 }
102
103 /// Partitions the component data into multiple sub-batches.
104 ///
105 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
106 /// instead, via `ComponentBatch::partitioned`.
107 ///
108 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
109 ///
110 /// The specified `lengths` must sum to the total length of the component batch.
112
113 /// Partitions the component data into unit-length sub-batches.
114 ///
115 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
116 /// where `n` is automatically guessed.
118 };
119
120} // namespace rerun::blueprint::archetypes
121
122namespace rerun {
123 /// \private
124 template <typename T>
125 struct AsComponents;
126
127 /// \private
128 template <>
129 struct AsComponents<blueprint::archetypes::ForceCollisionRadius> {
130 /// Serialize all set component batches.
131 static Result<Collection<ComponentBatch>> as_batches(
133 );
134 };
135} // namespace rerun
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:23
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: Resolves collisions between the bounding circles, according to the radius of the nodes.
Definition force_collision_radius.hpp:24
ForceCollisionRadius with_enabled(const rerun::blueprint::components::Enabled &_enabled) &&
Whether the collision force is enabled.
Definition force_collision_radius.hpp:77
static ForceCollisionRadius clear_fields()
Clear all the fields of a ForceCollisionRadius.
static constexpr auto Descriptor_enabled
ComponentDescriptor for the enabled field.
Definition force_collision_radius.hpp:44
static ForceCollisionRadius update_fields()
Update only some specific fields of a ForceCollisionRadius.
Definition force_collision_radius.hpp:67
std::optional< ComponentBatch > enabled
Whether the collision force is enabled.
Definition force_collision_radius.hpp:28
static constexpr auto Descriptor_iterations
ComponentDescriptor for the iterations field.
Definition force_collision_radius.hpp:54
ForceCollisionRadius with_strength(const rerun::blueprint::components::ForceStrength &_strength) &&
The strength of the force.
Definition force_collision_radius.hpp:84
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition force_collision_radius.hpp:40
std::optional< ComponentBatch > iterations
Specifies how often this force should be applied per iteration.
Definition force_collision_radius.hpp:36
ForceCollisionRadius with_iterations(const rerun::blueprint::components::ForceIterations &_iterations) &&
Specifies how often this force should be applied per iteration.
Definition force_collision_radius.hpp:95
std::optional< ComponentBatch > strength
The strength of the force.
Definition force_collision_radius.hpp:31
static constexpr auto Descriptor_strength
ComponentDescriptor for the strength field.
Definition force_collision_radius.hpp:49
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Component: Whether a procedure is enabled.
Definition enabled.hpp:17
Component: Specifies how often this force should be applied per iteration.
Definition force_iterations.hpp:19
Component: The strength of a given force.
Definition force_strength.hpp:19