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