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