/// Color by world-space position along an axis direction using a named colormap.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct SpatialColoringGeometryAxis {
    #[builder(custom(type = super::Vec3d, convert = Box::new))]
    #[serde(rename = "axis")]
    axis: Box<super::Vec3d>,
    #[serde(rename = "colormap")]
    colormap: super::SpatialColorMap,
    #[builder(default, into)]
    #[serde(rename = "dataMin", skip_serializing_if = "Option::is_none", default)]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    data_min: Option<f64>,
    #[builder(default, into)]
    #[serde(rename = "dataMax", skip_serializing_if = "Option::is_none", default)]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    data_max: Option<f64>,
}
impl SpatialColoringGeometryAxis {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(axis: super::Vec3d, colormap: super::SpatialColorMap) -> Self {
        Self::builder().axis(axis).colormap(colormap).build()
    }
    #[inline]
    pub fn axis(&self) -> &super::Vec3d {
        &*self.axis
    }
    #[inline]
    pub fn colormap(&self) -> &super::SpatialColorMap {
        &self.colormap
    }
    /// Color ramp lower bound; omit for renderer default.
    #[inline]
    pub fn data_min(&self) -> Option<f64> {
        self.data_min.as_ref().map(|o| *o)
    }
    /// Color ramp upper bound; omit for renderer default.
    #[inline]
    pub fn data_max(&self) -> Option<f64> {
        self.data_max.as_ref().map(|o| *o)
    }
}
