Rerun C++ SDK
Loading...
Searching...
No Matches
force_position.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_position.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 "../../compiler_utils.hpp"
10#include "../../component_batch.hpp"
11#include "../../components/position2d.hpp"
12#include "../../indicator_component.hpp"
13#include "../../result.hpp"
14
15#include <cstdint>
16#include <optional>
17#include <utility>
18#include <vector>
19
20namespace rerun::blueprint::archetypes {
21 /// **Archetype**: Similar to gravity, this force pulls nodes towards a specific position.
23 /// Whether the position force is enabled.
24 ///
25 /// The position force pulls nodes towards a specific position, similar to gravity.
26 std::optional<rerun::blueprint::components::Enabled> enabled;
27
28 /// The strength of the force.
29 std::optional<rerun::blueprint::components::ForceStrength> strength;
30
31 /// The position where the nodes should be pulled towards.
32 std::optional<rerun::components::Position2D> position;
33
34 public:
35 static constexpr const char IndicatorComponentName[] =
36 "rerun.blueprint.components.ForcePositionIndicator";
37
38 /// Indicator component, used to identify the archetype when converting to a list of components.
40
41 public:
42 ForcePosition() = default;
43 ForcePosition(ForcePosition&& other) = default;
44
45 /// Whether the position force is enabled.
46 ///
47 /// The position force pulls nodes towards a specific position, similar to gravity.
49 enabled = std::move(_enabled);
50 // See: https://github.com/rerun-io/rerun/issues/4027
51 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
52 }
53
54 /// The strength of the force.
56 strength = std::move(_strength);
57 // See: https://github.com/rerun-io/rerun/issues/4027
58 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
59 }
60
61 /// The position where the nodes should be pulled towards.
63 position = std::move(_position);
64 // See: https://github.com/rerun-io/rerun/issues/4027
65 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
66 }
67 };
68
69} // namespace rerun::blueprint::archetypes
70
71namespace rerun {
72 /// \private
73 template <typename T>
74 struct AsComponents;
75
76 /// \private
77 template <>
78 struct AsComponents<blueprint::archetypes::ForcePosition> {
79 /// Serialize all set component batches.
80 static Result<std::vector<ComponentBatch>> serialize(
82 );
83 };
84} // namespace rerun
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
Archetype: Similar to gravity, this force pulls nodes towards a specific position.
Definition force_position.hpp:22
ForcePosition with_enabled(rerun::blueprint::components::Enabled _enabled) &&
Whether the position force is enabled.
Definition force_position.hpp:48
ForcePosition with_position(rerun::components::Position2D _position) &&
The position where the nodes should be pulled towards.
Definition force_position.hpp:62
ForcePosition with_strength(rerun::blueprint::components::ForceStrength _strength) &&
The strength of the force.
Definition force_position.hpp:55
std::optional< rerun::components::Position2D > position
The position where the nodes should be pulled towards.
Definition force_position.hpp:32
std::optional< rerun::blueprint::components::Enabled > enabled
Whether the position force is enabled.
Definition force_position.hpp:26
std::optional< rerun::blueprint::components::ForceStrength > strength
The strength of the force.
Definition force_position.hpp:29
Component: Whether a procedure is enabled.
Definition enabled.hpp:15
Component: The strength of a given force.
Definition force_strength.hpp:17
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:32
Component: A position in 2D space.
Definition position2d.hpp:16