[−][src]Struct salva2d::geometry::HGrid
A grid based on spacial hashing.
Implementations
impl<N: RealField, T> HGrid<N, T>
[src]
pub fn new(cell_width: N) -> Self
[src]
Initialize a grid where each cell has the width cell_width
.
pub fn cell_width(&self) -> N
[src]
The width of a cell of this spacial grid.
pub fn key(&self, point: &Point<N>) -> Point<i64>
[src]
Computes the logical grid cell containing point
.
pub fn clear(&mut self)
[src]
Removes all elements from this grid.
pub fn insert(&mut self, point: &Point<N>, element: T)
[src]
Inserts the given element
into the cell containing the given point
.
pub fn cell_containing_point(&self, point: &Point<N>) -> Option<&Vec<T>>
[src]
Returns the element attached to the cell containing the given point
.
Returns None
if the cell is empty.
pub fn cells(&self) -> impl Iterator<Item = (&Point<i64>, &Vec<T>)>
[src]
An iterator through all the non-empty cells of this grid.
The returned tuple include the cell indentifier, and the elements attached to this cell.
pub fn inner_table(&self) -> &HashMap<Point<i64>, Vec<T>, DeterministicState>
[src]
The underlying hash map of this spacial grid.
pub fn cell(&self, key: &Point<i64>) -> Option<&Vec<T>>
[src]
Get the content of the logical cell identified by key
.
pub fn neighbor_cells(
&self,
cell: &Point<i64>,
radius: N
) -> impl Iterator<Item = (Point<i64>, &Vec<T>)>
[src]
&self,
cell: &Point<i64>,
radius: N
) -> impl Iterator<Item = (Point<i64>, &Vec<T>)>
An iterator through all the neighbors of the given cell.
The given cell itself will be yielded by this iterator too.
pub fn cells_intersecting_aabb(
&self,
mins: &Point<N>,
maxs: &Point<N>
) -> impl Iterator<Item = (Point<i64>, &Vec<T>)>
[src]
&self,
mins: &Point<N>,
maxs: &Point<N>
) -> impl Iterator<Item = (Point<i64>, &Vec<T>)>
An iterator through all the cells intersecting the given AABB.
Trait Implementations
impl<N: Clone + RealField, T: Clone> Clone for HGrid<N, T>
[src]
impl<N: Debug + RealField, T: Debug> Debug for HGrid<N, T>
[src]
impl<N: PartialEq + RealField, T: PartialEq> PartialEq<HGrid<N, T>> for HGrid<N, T>
[src]
impl<N: RealField, T> StructuralPartialEq for HGrid<N, T>
[src]
Auto Trait Implementations
impl<N, T> RefUnwindSafe for HGrid<N, T> where
N: RefUnwindSafe,
T: RefUnwindSafe,
N: RefUnwindSafe,
T: RefUnwindSafe,
impl<N, T> Send for HGrid<N, T> where
T: Send,
T: Send,
impl<N, T> Sync for HGrid<N, T> where
T: Sync,
T: Sync,
impl<N, T> Unpin for HGrid<N, T> where
N: Unpin,
T: Unpin,
N: Unpin,
T: Unpin,
impl<N, T> UnwindSafe for HGrid<N, T> where
N: UnwindSafe,
T: UnwindSafe,
N: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,