pub struct ImageSliceStyle {
pub window_sensitivity: f64,
pub level_sensitivity: f64,
pub slice_scroll_step: f64,
/* private fields */
}Expand description
Image-slice interaction style.
Maintains an internal WindowLevel that the consumer can read after each
event via ImageSliceStyle::window_level.
Slice scrolling is communicated through a slice_delta value that the
consumer should read and apply to its crate::reslice::SlicePlane.
Fields§
§window_sensitivity: f64Pixels per unit of window width change (default 4.0).
level_sensitivity: f64Pixels per unit of window center change (default 2.0).
slice_scroll_step: f64World units per scroll tick for slicing (default 1.0).
Implementations§
Source§impl ImageSliceStyle
impl ImageSliceStyle
Sourcepub fn new(window_level: WindowLevel) -> Self
pub fn new(window_level: WindowLevel) -> Self
Create with default sensitivities and the given initial window/level.
Sourcepub fn window_level(&self) -> WindowLevel
pub fn window_level(&self) -> WindowLevel
The current window/level (updated by drag events).
Sourcepub fn take_slice_delta(&mut self) -> f64
pub fn take_slice_delta(&mut self) -> f64
Consume and return the accumulated slice translation since the last call.
The consumer should apply this to its SlicePlane::offset_along_normal.
Trait Implementations§
Source§impl Debug for ImageSliceStyle
impl Debug for ImageSliceStyle
Source§impl InteractionStyle for ImageSliceStyle
impl InteractionStyle for ImageSliceStyle
Source§fn on_mouse_event(
&mut self,
event: &MouseEvent,
_ctx: &InteractionContext,
camera: &mut Camera,
) -> InteractionResult
fn on_mouse_event( &mut self, event: &MouseEvent, _ctx: &InteractionContext, camera: &mut Camera, ) -> InteractionResult
Handle a mouse event and potentially mutate the camera. Read more
Source§fn on_key_event(
&mut self,
_event: &KeyEvent,
_ctx: &InteractionContext,
_camera: &mut Camera,
) -> InteractionResult
fn on_key_event( &mut self, _event: &KeyEvent, _ctx: &InteractionContext, _camera: &mut Camera, ) -> InteractionResult
Handle a key event.
Auto Trait Implementations§
impl Freeze for ImageSliceStyle
impl RefUnwindSafe for ImageSliceStyle
impl Send for ImageSliceStyle
impl Sync for ImageSliceStyle
impl Unpin for ImageSliceStyle
impl UnsafeUnpin for ImageSliceStyle
impl UnwindSafe for ImageSliceStyle
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