use super::{VolumeRegion, VolumeRendering, VolumeSlice, VolumeStyle, VolumeTransferFunction};
impl VolumeStyle {
#[must_use]
pub fn transfer(mut self, transfer: VolumeTransferFunction) -> Self {
self.transfer = transfer;
self
}
#[must_use]
pub fn isosurface() -> Self {
Self {
rendering: VolumeRendering::Isosurface,
..Self::default()
}
}
#[must_use]
pub fn medium() -> Self {
Self {
rendering: VolumeRendering::Medium,
..Self::default()
}
}
#[must_use]
pub fn liquid_surface() -> Self {
Self {
rendering: VolumeRendering::LiquidSurface,
..Self::default()
}
}
#[must_use]
pub fn slice(slice: VolumeSlice) -> Self {
Self {
rendering: VolumeRendering::Slice,
slice: Some(slice),
..Self::default()
}
}
#[must_use]
pub const fn region(mut self, region: VolumeRegion) -> Self {
self.region = Some(region);
self
}
#[must_use]
pub const fn sampling(mut self, opacity_scale: f32, step_scale: f32) -> Self {
self.opacity_scale = opacity_scale;
self.step_scale = step_scale;
self
}
}