Struct spatial::tree::mbr::MbrLeaf [] [src]

pub struct MbrLeaf<P, DIM, LG, T> where DIM: ArrayLength<P> + ArrayLength<(P, P)> {
    pub geometry: LG,
    pub item: T,
    // some fields omitted
}

A tree leaf

Fields

geometry: LG item: T

Methods

impl<P, DIM, LG, T> MbrLeaf<P, DIM, LG, T> where P: Float + Signed + Bounded + MulAssign + AddAssign + ToPrimitive + FromPrimitive + Copy + Debug + Default, DIM: ArrayLength<P> + ArrayLength<(P, P)>, LG: MbrLeafGeometry<P, DIM>
[src]

fn new(geometry: LG, item: T) -> MbrLeaf<P, DIM, LG, T>

New leaf from geometry and item

fn extract(self) -> (LG, T)

Consumes self, returning the geometry and item

fn as_tuple(&self) -> (&LG, &T)

fn as_mut_tuple(&mut self) -> (&LG, &mut T)

Trait Implementations

impl<P: Debug, DIM: Debug, LG: Debug, T: Debug> Debug for MbrLeaf<P, DIM, LG, T> where DIM: ArrayLength<P> + ArrayLength<(P, P)>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<P, DIM, LG, T> MbrLeafGeometry<P, DIM> for MbrLeaf<P, DIM, LG, T> where P: Float + Signed + Bounded + MulAssign + AddAssign + ToPrimitive + FromPrimitive + Copy + Debug + Default, DIM: ArrayLength<P> + ArrayLength<(P, P)>, LG: MbrLeafGeometry<P, DIM>
[src]

fn dim(&self) -> usize

The geometry's dimension count

fn expand_mbr_to_fit(&self, edges: &mut Rect<P, DIM>)

Expand the mbr to minimally fit the leaf

fn distance_from_mbr_center(&self, edges: &Rect<P, DIM>) -> P

Determine the distance from the mbr's center

fn contained_by_mbr(&self, edges: &Rect<P, DIM>) -> bool

Determine if the leaf is completely contained in the mbr

fn overlapped_by_mbr(&self, edges: &Rect<P, DIM>) -> bool

Determine if the leaf overlaps the mbr

fn area_overlapped_with_mbr(&self, edges: &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 Read more

fn area(&self) -> P

Determine the area of the geometry

fn min_for_axis(&self, dim: usize) -> P

the minimum extent for a given axis

fn max_for_axis(&self, dim: usize) -> P

the maximum extent for a given axis