pub struct SelectionState {
pub items: HashSet<SelectionItem>,
pub pivot: Option<Vec3>,
pub aabb_min: Vec3,
pub aabb_max: Vec3,
pub mode: SelectionMode,
}Fields§
§items: HashSet<SelectionItem>§pivot: Option<Vec3>§aabb_min: Vec3§aabb_max: Vec3§mode: SelectionModeImplementations§
Source§impl SelectionState
impl SelectionState
pub fn new() -> Self
pub fn select(&mut self, item: SelectionItem)
pub fn deselect(&mut self, item: &SelectionItem)
pub fn toggle(&mut self, item: SelectionItem)
pub fn clear(&mut self)
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Sourcepub fn box_select_terrain(&mut self, x0: usize, y0: usize, x1: usize, y1: usize)
pub fn box_select_terrain(&mut self, x0: usize, y0: usize, x1: usize, y1: usize)
Box selection — add all terrain cells within a 2D bounding rectangle
pub fn count_terrain_cells(&self) -> usize
Trait Implementations§
Source§impl Clone for SelectionState
impl Clone for SelectionState
Auto Trait Implementations§
impl Freeze for SelectionState
impl RefUnwindSafe for SelectionState
impl Send for SelectionState
impl Sync for SelectionState
impl Unpin for SelectionState
impl UnsafeUnpin for SelectionState
impl UnwindSafe for SelectionState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.