Enum spatial::tree::mbr::MbrNode
[−]
[src]
pub enum MbrNode<P, DIM, LG, T> where DIM: ArrayLength<P> + ArrayLength<(P, P)> { Level { mbr: Rect<P, DIM>, children: Vec<MbrNode<P, DIM, LG, T>>, }, Leaves { mbr: Rect<P, DIM>, children: Vec<RwLock<MbrLeaf<P, DIM, LG, T>>>, }, }
Level node of a tree. Either contains other levels or leaves
Variants
Level
Contains only other levels
Fields
mbr: Rect<P, DIM> | |
children: Vec<MbrNode<P, DIM, LG, T>> |
Leaves
Contains only leaves
Fields
mbr: Rect<P, DIM> | |
children: Vec<RwLock<MbrLeaf<P, DIM, LG, T>>> |
Methods
impl<P, DIM, LG, T> MbrNode<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_leaves() -> MbrNode<P, DIM, LG, T>
Create an empty leaf level
fn new_no_alloc() -> MbrNode<P, DIM, LG, T>
Create an empty leaf level with no capacity for leaves. Only used for passing ownership of root into the index functions
fn has_leaves(&self) -> bool
Does the level point to leaves?
fn has_levels(&self) -> bool
Does the level point to other levels?
fn mbr(&self) -> &Rect<P, DIM>
Borrow the level's minimum bounding rectangle
fn mbr_mut(&mut self) -> &mut Rect<P, DIM>
Mutably borrow the level's minimum bounding rectangle
fn len(&self) -> usize
Number of level's children
fn is_empty(&self) -> bool
Does the level have children?
Trait Implementations
impl<P: Debug, DIM: Debug, LG: Debug, T: Debug> Debug for MbrNode<P, DIM, LG, T> where DIM: ArrayLength<P> + ArrayLength<(P, P)>
[src]
impl<P, DIM, LG, T> MbrLeafGeometry<P, DIM> for MbrNode<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, mbr: &mut Rect<P, DIM>)
Expand the mbr to minimally fit the leaf
fn distance_from_mbr_center(&self, mbr: &Rect<P, DIM>) -> P
Determine the distance from the mbr's center
fn contained_by_mbr(&self, mbr: &Rect<P, DIM>) -> bool
Determine if the leaf is completely contained in the mbr
fn overlapped_by_mbr(&self, mbr: &Rect<P, DIM>) -> bool
Determine if the leaf overlaps the mbr
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 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