Rerun C++ SDK
Loading...
Searching...
No Matches
disconnected_space.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/components/disconnected_space.fbs".
3
4#pragma once
5
6#include "../datatypes/bool.hpp"
7#include "../result.hpp"
8
9#include <cstdint>
10#include <memory>
11
12namespace rerun::components {
13 /// **Component**: Spatially disconnect this entity from its parent.
14 ///
15 /// Specifies that the entity path at which this is logged is spatially disconnected from its parent,
16 /// making it impossible to transform the entity path into its parent's space and vice versa.
17 /// It *only* applies to space views that work with spatial transformations, i.e. 2D & 3D space views.
18 /// This is useful for specifying that a subgraph is independent of the rest of the scene.
20 /// Whether the entity path at which this is logged is disconnected from its parent.
21 ///
22 /// Set to true to disconnect the entity from its parent.
23 /// Set to false to disable the effects of this component
24 /// TODO(#7121): Once a space is disconnected, it can't be re-connected again.
26
27 public:
28 DisconnectedSpace() = default;
29
31 : is_disconnected(is_disconnected_) {}
32
33 DisconnectedSpace& operator=(rerun::datatypes::Bool is_disconnected_) {
34 is_disconnected = is_disconnected_;
35 return *this;
36 }
37
38 DisconnectedSpace(bool value_) : is_disconnected(value_) {}
39
40 DisconnectedSpace& operator=(bool value_) {
41 is_disconnected = value_;
42 return *this;
43 }
44
45 /// Cast to the underlying Bool datatype
46 operator rerun::datatypes::Bool() const {
47 return is_disconnected;
48 }
49 };
50} // namespace rerun::components
51
52namespace rerun {
53 static_assert(sizeof(rerun::datatypes::Bool) == sizeof(components::DisconnectedSpace));
54
55 /// \private
56 template <>
57 struct Loggable<components::DisconnectedSpace> {
58 static constexpr const char Name[] = "rerun.components.DisconnectedSpace";
59
60 /// Returns the arrow data type this type corresponds to.
61 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
62 return Loggable<rerun::datatypes::Bool>::arrow_datatype();
63 }
64
65 /// Serializes an array of `rerun::components::DisconnectedSpace` into an arrow array.
66 static Result<std::shared_ptr<arrow::Array>> to_arrow(
67 const components::DisconnectedSpace* instances, size_t num_instances
68 ) {
69 if (num_instances == 0) {
70 return Loggable<rerun::datatypes::Bool>::to_arrow(nullptr, 0);
71 } else if (instances == nullptr) {
72 return rerun::Error(
73 ErrorCode::UnexpectedNullArgument,
74 "Passed array instances is null when num_elements> 0."
75 );
76 } else {
77 return Loggable<rerun::datatypes::Bool>::to_arrow(
78 &instances->is_disconnected,
79 num_instances
80 );
81 }
82 }
83 };
84} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:79
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Archetype: Spatially disconnect this entity from its parent.
Definition disconnected_space.hpp:45
Component: Spatially disconnect this entity from its parent.
Definition disconnected_space.hpp:19
rerun::datatypes::Bool is_disconnected
Whether the entity path at which this is logged is disconnected from its parent.
Definition disconnected_space.hpp:25
Datatype: A single boolean.
Definition bool.hpp:19