Rerun C++ SDK
Loading...
Searching...
No Matches
entity_behavior.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/entity_behavior.fbs".
3
4#pragma once
5
6#include "../../collection.hpp"
7#include "../../component_batch.hpp"
8#include "../../component_column.hpp"
9#include "../../components/interactive.hpp"
10#include "../../components/visible.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**: General visualization behavior of an entity.
20 ///
21 /// TODO(#6541): Fields of this archetype currently only have an effect when logged in the blueprint store.
23 /// Whether the entity can be interacted with.
24 ///
25 /// This property is propagated down the entity hierarchy until another child entity
26 /// sets `interactive` to a different value at which point propagation continues with that value instead.
27 ///
28 /// Defaults to parent's `interactive` value or true if there is no parent.
29 std::optional<ComponentBatch> interactive;
30
31 /// Whether the entity is visible.
32 ///
33 /// This property is propagated down the entity hierarchy until another child entity
34 /// sets `visible` to a different value at which point propagation continues with that value instead.
35 ///
36 /// Defaults to parent's `visible` value or true if there is no parent.
37 std::optional<ComponentBatch> visible;
38
39 public:
40 /// The name of the archetype as used in `ComponentDescriptor`s.
41 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.EntityBehavior";
42
43 /// `ComponentDescriptor` for the `interactive` field.
45 ArchetypeName, "EntityBehavior:interactive",
47 );
48 /// `ComponentDescriptor` for the `visible` field.
49 static constexpr auto Descriptor_visible = ComponentDescriptor(
50 ArchetypeName, "EntityBehavior:visible",
52 );
53
54 public:
55 EntityBehavior() = default;
56 EntityBehavior(EntityBehavior&& other) = default;
57 EntityBehavior(const EntityBehavior& other) = default;
58 EntityBehavior& operator=(const EntityBehavior& other) = default;
59 EntityBehavior& operator=(EntityBehavior&& other) = default;
60
61 /// Update only some specific fields of a `EntityBehavior`.
63 return EntityBehavior();
64 }
65
66 /// Clear all the fields of a `EntityBehavior`.
68
69 /// Whether the entity can be interacted with.
70 ///
71 /// This property is propagated down the entity hierarchy until another child entity
72 /// sets `interactive` to a different value at which point propagation continues with that value instead.
73 ///
74 /// Defaults to parent's `interactive` value or true if there is no parent.
77 .value_or_throw();
78 return std::move(*this);
79 }
80
81 /// Whether the entity is visible.
82 ///
83 /// This property is propagated down the entity hierarchy until another child entity
84 /// sets `visible` to a different value at which point propagation continues with that value instead.
85 ///
86 /// Defaults to parent's `visible` value or true if there is no parent.
88 visible = ComponentBatch::from_loggable(_visible, Descriptor_visible).value_or_throw();
89 return std::move(*this);
90 }
91
92 /// Partitions the component data into multiple sub-batches.
93 ///
94 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
95 /// instead, via `ComponentBatch::partitioned`.
96 ///
97 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
98 ///
99 /// The specified `lengths` must sum to the total length of the component batch.
101
102 /// Partitions the component data into unit-length sub-batches.
103 ///
104 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
105 /// where `n` is automatically guessed.
107 };
108
109} // namespace rerun::blueprint::archetypes
110
111namespace rerun {
112 /// \private
113 template <typename T>
114 struct AsComponents;
115
116 /// \private
117 template <>
118 struct AsComponents<blueprint::archetypes::EntityBehavior> {
119 /// Serialize all set component batches.
120 static Result<Collection<ComponentBatch>> as_batches(
122 );
123 };
124} // 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: General visualization behavior of an entity.
Definition entity_behavior.hpp:22
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition entity_behavior.hpp:41
EntityBehavior with_visible(const rerun::components::Visible &_visible) &&
Whether the entity is visible.
Definition entity_behavior.hpp:87
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
std::optional< ComponentBatch > interactive
Whether the entity can be interacted with.
Definition entity_behavior.hpp:29
static EntityBehavior update_fields()
Update only some specific fields of a EntityBehavior.
Definition entity_behavior.hpp:62
EntityBehavior with_interactive(const rerun::components::Interactive &_interactive) &&
Whether the entity can be interacted with.
Definition entity_behavior.hpp:75
static EntityBehavior clear_fields()
Clear all the fields of a EntityBehavior.
static constexpr auto Descriptor_interactive
ComponentDescriptor for the interactive field.
Definition entity_behavior.hpp:44
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
std::optional< ComponentBatch > visible
Whether the entity is visible.
Definition entity_behavior.hpp:37
static constexpr auto Descriptor_visible
ComponentDescriptor for the visible field.
Definition entity_behavior.hpp:49
Component: Whether the entity can be interacted with.
Definition interactive.hpp:16
Component: Whether the container, view, entity or instance is currently visible.
Definition visible.hpp:14