re_types/blueprint/views/
spatial2d_view.rs

1// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/rust/api.rs
2// Based on "crates/store/re_types/definitions/rerun/blueprint/views/spatial2d.fbs".
3
4#![allow(unused_braces)]
5#![allow(unused_imports)]
6#![allow(unused_parens)]
7#![allow(clippy::clone_on_copy)]
8#![allow(clippy::cloned_instead_of_copied)]
9#![allow(clippy::map_flatten)]
10#![allow(clippy::needless_question_mark)]
11#![allow(clippy::new_without_default)]
12#![allow(clippy::redundant_closure)]
13#![allow(clippy::too_many_arguments)]
14#![allow(clippy::too_many_lines)]
15
16use ::re_types_core::try_serialize_field;
17use ::re_types_core::SerializationResult;
18use ::re_types_core::{ComponentBatch as _, SerializedComponentBatch};
19use ::re_types_core::{ComponentDescriptor, ComponentType};
20use ::re_types_core::{DeserializationError, DeserializationResult};
21
22/// **View**: For viewing spatial 2D data.
23///
24/// ⚠️ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
25#[derive(Clone, Debug)]
26pub struct Spatial2DView {
27    /// Configuration for the background of the view.
28    pub background: crate::blueprint::archetypes::Background,
29
30    /// The visible parts of the scene, in the coordinate space of the scene.
31    ///
32    /// Everything within these bounds are guaranteed to be visible.
33    /// Somethings outside of these bounds may also be visible due to letterboxing.
34    pub visual_bounds: crate::blueprint::archetypes::VisualBounds2D,
35
36    /// Configures which range on each timeline is shown by this view (unless specified differently per entity).
37    ///
38    /// If not specified, the default is to show the latest state of each component.
39    /// If a timeline is specified more than once, the first entry will be used.
40    pub time_ranges: crate::blueprint::archetypes::VisibleTimeRanges,
41}
42
43impl ::re_types_core::View for Spatial2DView {
44    #[inline]
45    fn identifier() -> ::re_types_core::ViewClassIdentifier {
46        "2D".into()
47    }
48}
49
50impl ::re_byte_size::SizeBytes for Spatial2DView {
51    #[inline]
52    fn heap_size_bytes(&self) -> u64 {
53        self.background.heap_size_bytes()
54            + self.visual_bounds.heap_size_bytes()
55            + self.time_ranges.heap_size_bytes()
56    }
57
58    #[inline]
59    fn is_pod() -> bool {
60        <crate::blueprint::archetypes::Background>::is_pod()
61            && <crate::blueprint::archetypes::VisualBounds2D>::is_pod()
62            && <crate::blueprint::archetypes::VisibleTimeRanges>::is_pod()
63    }
64}