[−][src]Struct salva3d::geometry::HGrid
A grid based on spacial hashing.
Implementations
impl<T> HGrid<T>
[src]
pub fn new(cell_width: Real) -> Self
[src]
Initialize a grid where each cell has the width cell_width
.
pub fn cell_width(&self) -> Real
[src]
The width of a cell of this spacial grid.
pub fn key(&self, point: &Point<Real>) -> 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<Real>, element: T)
[src]
Inserts the given element
into the cell containing the given point
.
pub fn cell_containing_point(&self, point: &Point<Real>) -> 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: Real
) -> impl Iterator<Item = (Point<i64>, &Vec<T>)>
[src]
&self,
cell: &Point<i64>,
radius: Real
) -> 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<Real>,
maxs: &Point<Real>
) -> impl Iterator<Item = (Point<i64>, &Vec<T>)>
[src]
&self,
mins: &Point<Real>,
maxs: &Point<Real>
) -> impl Iterator<Item = (Point<i64>, &Vec<T>)>
An iterator through all the cells intersecting the given AABB.
Trait Implementations
impl<T: Clone> Clone for HGrid<T>
[src]
impl<T: Debug> Debug for HGrid<T>
[src]
impl<T: PartialEq> PartialEq<HGrid<T>> for HGrid<T>
[src]
impl<T> StructuralPartialEq for HGrid<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for HGrid<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for HGrid<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for HGrid<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for HGrid<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for HGrid<T> where
T: UnwindSafe,
[src]
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,
pub 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>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub 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>,