pub struct Canvas3 { /* private fields */ }Expand description
Stateful abstraction for a 3D canvas supporting pan, zoom, and rotate
Implementations§
Source§impl Canvas3
Operations have the same semantics as Canvas2; see those docstrings for
details.
impl Canvas3
Operations have the same semantics as Canvas2; see those docstrings for
details.
pub fn new(image_size: VoxelSize) -> Self
pub fn components(&self) -> (View3, VoxelSize)
pub fn from_components(view: View3, image_size: VoxelSize) -> Self
pub fn image_size(&self) -> VoxelSize
pub fn interact( &mut self, image_size: VoxelSize, cursor_state: Option<CursorState<Option<DragMode>>>, scroll: f32, ) -> bool
pub fn view(&self) -> View3
pub fn begin_drag(&mut self, pos_screen: Point2<i32>, drag_mode: DragMode)
pub fn drag(&mut self, pos_screen: Point2<i32>) -> bool
pub fn end_drag(&mut self)
pub fn zoom(&mut self, amount: f32, pos_screen: Option<Point2<i32>>) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Canvas3
impl RefUnwindSafe for Canvas3
impl Send for Canvas3
impl Sync for Canvas3
impl Unpin for Canvas3
impl UnsafeUnpin for Canvas3
impl UnwindSafe for Canvas3
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.