pub struct VolumeViewState {
pub orientation: DQuat,
pub pan_x: f64,
pub pan_y: f64,
pub zoom: f64,
pub blend_mode: VolumeBlendMode,
pub transfer_center_hu: Option<f64>,
pub transfer_width_hu: Option<f64>,
}Expand description
Mutable camera and transfer state for the 3D volume viewport.
Fields§
§orientation: DQuatAccumulated camera orientation relative to the default AP view.
pan_x: f64Horizontal pan in screen-like units.
pan_y: f64Vertical pan in screen-like units.
zoom: f64Camera zoom factor.
blend_mode: VolumeBlendModeActive raycasting blend mode.
transfer_center_hu: Option<f64>Explicit transfer-window center in modality space.
transfer_width_hu: Option<f64>Explicit transfer-window width in modality space.
Implementations§
Source§impl VolumeViewState
impl VolumeViewState
Sourcepub fn orbit(&mut self, delta_x: f64, delta_y: f64)
pub fn orbit(&mut self, delta_x: f64, delta_y: f64)
Orbits the virtual camera around the volume center.
Sourcepub fn ensure_transfer_window(&mut self, scalar_min: f64, scalar_max: f64)
pub fn ensure_transfer_window(&mut self, scalar_min: f64, scalar_max: f64)
Ensures that the state has a reasonable transfer window for the scalar range.
Sourcepub fn transfer_window(&self, scalar_min: f64, scalar_max: f64) -> (f64, f64)
pub fn transfer_window(&self, scalar_min: f64, scalar_max: f64) -> (f64, f64)
Returns the active transfer window or a derived default.
Trait Implementations§
Source§impl Clone for VolumeViewState
impl Clone for VolumeViewState
Source§fn clone(&self) -> VolumeViewState
fn clone(&self) -> VolumeViewState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VolumeViewState
impl Debug for VolumeViewState
Source§impl Default for VolumeViewState
impl Default for VolumeViewState
Source§impl PartialEq for VolumeViewState
impl PartialEq for VolumeViewState
impl Copy for VolumeViewState
impl StructuralPartialEq for VolumeViewState
Auto Trait Implementations§
impl Freeze for VolumeViewState
impl RefUnwindSafe for VolumeViewState
impl Send for VolumeViewState
impl Sync for VolumeViewState
impl Unpin for VolumeViewState
impl UnsafeUnpin for VolumeViewState
impl UnwindSafe for VolumeViewState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more