QuadTree

Struct QuadTree 

Source
pub struct QuadTree<Data: Copy> { /* private fields */ }

Implementations§

Source§

impl<Data: Copy> QuadTree<Data>

Source

pub fn with_capacity( x: Range<f64>, y: Range<f64>, capacity: u16, ) -> QuadTree<Data>

§Arguments
  • x: min_x..max_x defines the area in wich data can be inserted
  • y: min_y..max_y defines the area in wich data can be inserted
  • capacity: capacity of each TreeNode
Source

pub fn node(&self) -> &QuadTreeNode<Data>

§Arguments

returns : &QuadTreeNode the root node of the QuadTree

Trait Implementations§

Source§

impl<Data: Copy> SpatialPartitioner<Data> for QuadTree<Data>

Source§

fn new(x: Range<f64>, y: Range<f64>) -> Self

create a QuadTree with a default capacity of 50. More info here QuadTree::new()

Source§

fn insert(&mut self, position: (f64, f64), data: Data)

inserts an obj and checks if position is out of bounce Read more
Source§

fn insert_unchecked(&mut self, position: (f64, f64), data: Data)

inserts an obj and DOES NOT check if position is out of bounce Read more
Source§

fn count(&self) -> usize

returns the count of DataValues which are currently stored
Source§

fn clear(&mut self)

Source§

fn in_circle(&self, position: (f64, f64), radius: f64) -> Vec<Data>

gets all DataValues in the given search circle Read more

Auto Trait Implementations§

§

impl<Data> Freeze for QuadTree<Data>

§

impl<Data> RefUnwindSafe for QuadTree<Data>
where Data: RefUnwindSafe,

§

impl<Data> Send for QuadTree<Data>
where Data: Send,

§

impl<Data> Sync for QuadTree<Data>
where Data: Sync,

§

impl<Data> Unpin for QuadTree<Data>
where Data: Unpin,

§

impl<Data> UnwindSafe for QuadTree<Data>
where Data: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.