pub enum Shapes<P: FP, const DIM: usize> {
Point(Point<P, DIM>),
LineSegment(LineSegment<P, DIM>),
Rect(Rect<P, DIM>),
}
Expand description
A convenience enum that contains Point
, LineSegment
, and Rect
Variants§
Trait Implementations§
Source§impl<P: FP, const DIM: usize> MbrLeafGeometry<P, DIM> for Shapes<P, DIM>
impl<P: FP, const DIM: usize> MbrLeafGeometry<P, DIM> for Shapes<P, DIM>
Source§fn min_for_axis(&self, dim: usize) -> P
fn min_for_axis(&self, dim: usize) -> P
the minimum extent for a given axis
Source§fn max_for_axis(&self, dim: usize) -> P
fn max_for_axis(&self, dim: usize) -> P
the maximum extent for a given axis
Source§fn expand_mbr_to_fit(&self, mbr: &mut Rect<P, DIM>)
fn expand_mbr_to_fit(&self, mbr: &mut Rect<P, DIM>)
Expand the mbr to minimally fit the leaf
Source§fn distance_from_mbr_center(&self, mbr: &Rect<P, DIM>) -> P
fn distance_from_mbr_center(&self, mbr: &Rect<P, DIM>) -> P
Determine the distance from the mbr’s center
Source§fn contained_by_mbr(&self, mbr: &Rect<P, DIM>) -> bool
fn contained_by_mbr(&self, mbr: &Rect<P, DIM>) -> bool
Determine if the leaf is completely contained in the mbr
Source§fn overlapped_by_mbr(&self, mbr: &Rect<P, DIM>) -> bool
fn overlapped_by_mbr(&self, mbr: &Rect<P, DIM>) -> bool
Determine if the leaf overlaps the mbr
Source§fn area_overlapped_with_mbr(&self, mbr: &Rect<P, DIM>) -> P
fn area_overlapped_with_mbr(&self, mbr: &Rect<P, DIM>) -> P
Determines the leaf area shared with the rectangle.
In cases where the leaf and mbr overlap, but the leaf has no area (point or a line, for example), return 0
Auto Trait Implementations§
impl<P, const DIM: usize> Freeze for Shapes<P, DIM>where
P: Freeze,
impl<P, const DIM: usize> RefUnwindSafe for Shapes<P, DIM>where
P: RefUnwindSafe,
impl<P, const DIM: usize> Send for Shapes<P, DIM>where
P: Send,
impl<P, const DIM: usize> Sync for Shapes<P, DIM>where
P: Sync,
impl<P, const DIM: usize> Unpin for Shapes<P, DIM>where
P: Unpin,
impl<P, const DIM: usize> UnwindSafe for Shapes<P, DIM>where
P: UnwindSafe,
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 more