Rerun C++ SDK
Loading...
Searching...
No Matches
force_many_body.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_many_body.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/enabled.hpp"
7#include "../../blueprint/components/force_strength.hpp"
8#include "../../collection.hpp"
9#include "../../component_batch.hpp"
10#include "../../component_column.hpp"
11#include "../../result.hpp"
12
13#include <cstdint>
14#include <optional>
15#include <utility>
16#include <vector>
17
18namespace rerun::blueprint::archetypes {
19 /// **Archetype**: A force between each pair of nodes that ressembles an electrical charge.
20 ///
21 /// If `strength` is smaller than 0, it pushes nodes apart, if it is larger than 0 it pulls them together.
22 ///
23 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
24 ///
26 /// Whether the many body force is enabled.
27 ///
28 /// The many body force is applied on each pair of nodes in a way that ressembles an electrical charge. If the
29 /// strength is smaller than 0, it pushes nodes apart; if it is larger than 0, it pulls them together.
30 std::optional<ComponentBatch> enabled;
31
32 /// The strength of the force.
33 ///
34 /// If `strength` is smaller than 0, it pushes nodes apart, if it is larger than 0 it pulls them together.
35 std::optional<ComponentBatch> strength;
36
37 public:
38 /// The name of the archetype as used in `ComponentDescriptor`s.
39 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.ForceManyBody";
40
41 /// `ComponentDescriptor` for the `enabled` field.
42 static constexpr auto Descriptor_enabled = ComponentDescriptor(
43 ArchetypeName, "ForceManyBody:enabled",
45 );
46 /// `ComponentDescriptor` for the `strength` field.
48 ArchetypeName, "ForceManyBody:strength",
50 );
51
52 public:
53 ForceManyBody() = default;
54 ForceManyBody(ForceManyBody&& other) = default;
55 ForceManyBody(const ForceManyBody& other) = default;
56 ForceManyBody& operator=(const ForceManyBody& other) = default;
57 ForceManyBody& operator=(ForceManyBody&& other) = default;
58
59 /// Update only some specific fields of a `ForceManyBody`.
61 return ForceManyBody();
62 }
63
64 /// Clear all the fields of a `ForceManyBody`.
66
67 /// Whether the many body force is enabled.
68 ///
69 /// The many body force is applied on each pair of nodes in a way that ressembles an electrical charge. If the
70 /// strength is smaller than 0, it pushes nodes apart; if it is larger than 0, it pulls them together.
72 enabled = ComponentBatch::from_loggable(_enabled, Descriptor_enabled).value_or_throw();
73 return std::move(*this);
74 }
75
76 /// The strength of the force.
77 ///
78 /// If `strength` is smaller than 0, it pushes nodes apart, if it is larger than 0 it pulls them together.
80 ) && {
81 strength =
82 ComponentBatch::from_loggable(_strength, Descriptor_strength).value_or_throw();
83 return std::move(*this);
84 }
85
86 /// Partitions the component data into multiple sub-batches.
87 ///
88 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
89 /// instead, via `ComponentBatch::partitioned`.
90 ///
91 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
92 ///
93 /// The specified `lengths` must sum to the total length of the component batch.
95
96 /// Partitions the component data into unit-length sub-batches.
97 ///
98 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
99 /// where `n` is automatically guessed.
101 };
102
103} // namespace rerun::blueprint::archetypes
104
105namespace rerun {
106 /// \private
107 template <typename T>
108 struct AsComponents;
109
110 /// \private
111 template <>
112 struct AsComponents<blueprint::archetypes::ForceManyBody> {
113 /// Serialize all set component batches.
114 static Result<Collection<ComponentBatch>> as_batches(
116 );
117 };
118} // 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: A force between each pair of nodes that ressembles an electrical charge.
Definition force_many_body.hpp:25
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
std::optional< ComponentBatch > enabled
Whether the many body force is enabled.
Definition force_many_body.hpp:30
ForceManyBody with_strength(const rerun::blueprint::components::ForceStrength &_strength) &&
The strength of the force.
Definition force_many_body.hpp:79
static ForceManyBody clear_fields()
Clear all the fields of a ForceManyBody.
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_many_body.hpp:39
static constexpr auto Descriptor_strength
ComponentDescriptor for the strength field.
Definition force_many_body.hpp:47
static constexpr auto Descriptor_enabled
ComponentDescriptor for the enabled field.
Definition force_many_body.hpp:42
std::optional< ComponentBatch > strength
The strength of the force.
Definition force_many_body.hpp:35
static ForceManyBody update_fields()
Update only some specific fields of a ForceManyBody.
Definition force_many_body.hpp:60
ForceManyBody with_enabled(const rerun::blueprint::components::Enabled &_enabled) &&
Whether the many body force is enabled.
Definition force_many_body.hpp:71
Component: Whether a procedure is enabled.
Definition enabled.hpp:17
Component: The strength of a given force.
Definition force_strength.hpp:19