Skip to main content

nominal_api/conjure/objects/scout/chartdefinition/api/
geo_plot3d_spatial.rs

1/// 3D plot for a spatial dataset or channel (point cloud, BVH mesh, etc.) loaded by RID.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    conjure_object::private::DeriveWith
8)]
9#[serde(crate = "conjure_object::serde")]
10#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
11#[conjure_object::private::staged_builder::staged_builder]
12#[builder(crate = conjure_object::private::staged_builder, update, inline)]
13pub struct GeoPlot3dSpatial {
14    #[builder(into)]
15    #[serde(rename = "plotId")]
16    plot_id: String,
17    #[builder(default, into)]
18    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none", default)]
19    enabled: Option<bool>,
20    #[builder(default, into)]
21    #[serde(rename = "label", skip_serializing_if = "Option::is_none", default)]
22    label: Option<String>,
23    #[serde(rename = "spatialRid")]
24    spatial_rid: super::super::super::super::api::rids::SpatialRid,
25    #[builder(
26        default,
27        custom(
28            type = impl
29            Into<Option<super::SpatialColoring>>,
30            convert = |v|v.into().map(Box::new)
31        )
32    )]
33    #[serde(rename = "coloring", skip_serializing_if = "Option::is_none", default)]
34    coloring: Option<Box<super::SpatialColoring>>,
35}
36impl GeoPlot3dSpatial {
37    /// Constructs a new instance of the type.
38    #[inline]
39    pub fn new(
40        plot_id: impl Into<String>,
41        spatial_rid: super::super::super::super::api::rids::SpatialRid,
42    ) -> Self {
43        Self::builder().plot_id(plot_id).spatial_rid(spatial_rid).build()
44    }
45    #[inline]
46    pub fn plot_id(&self) -> &str {
47        &*self.plot_id
48    }
49    #[inline]
50    pub fn enabled(&self) -> Option<bool> {
51        self.enabled.as_ref().map(|o| *o)
52    }
53    #[inline]
54    pub fn label(&self) -> Option<&str> {
55        self.label.as_ref().map(|o| &**o)
56    }
57    #[inline]
58    pub fn spatial_rid(&self) -> &super::super::super::super::api::rids::SpatialRid {
59        &self.spatial_rid
60    }
61    /// How to color the asset. If omitted, renderers use a +Z direction ramp with colormap
62    /// VIRIDIS and default bounds (`SpatialColoringGeometryAxis` with axis { x: 0, y: 0, z: 1 }).
63    #[inline]
64    pub fn coloring(&self) -> Option<&super::SpatialColoring> {
65        self.coloring.as_ref().map(|o| &**o)
66    }
67}