Struct mgf::BVH
[−]
[src]
pub struct BVH<B: Bound, V> { /* fields omitted */ }
A Bounding Volume Hierarchy.
Methods
impl<B: Bound, V> BVH<B, V>
[src]
fn new() -> Self
[src]
Creates an empty BVH.
fn with_capacity(cap: usize) -> Self
[src]
Creates a BVH with a preallocated array of cap.
fn empty(&self) -> bool
[src]
Determines if the BVH is empty.
fn len(&self) -> usize
[src]
Returns the number of bounds inserted into the BVH.
fn insert<K: BoundedBy<B>>(&mut self, key: &K, val: V) -> usize
[src]
Inserts an item ino the BVH, rebalancing if necessary. All IDs returned prior to insert remain valid afterward.
fn remove(&mut self, leaf: usize)
[src]
Removes a leaf node from the BVH.
fn root(&self) -> usize
[src]
Returns the index of the root node.
fn query<Arg, F>(&self, arg: &Arg, callback: F) where
Arg: BoundedBy<B>,
F: FnMut(&V),
[src]
Arg: BoundedBy<B>,
F: FnMut(&V),
Find each entry in the BVH that has a bound that Overlaps the bound of the passed object.
fn query_mut<Arg, F>(&mut self, arg: &Arg, callback: F) where
Arg: BoundedBy<B>,
F: FnMut(&mut V),
[src]
Arg: BoundedBy<B>,
F: FnMut(&mut V),
Passe each found entry as a mutable reference to the callback.
Trait Implementations
impl<B, V> Clone for BVH<B, V> where
B: Bound,
V: Clone,
[src]
B: Bound,
V: Clone,
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<B, V> Index<usize> for BVH<B, V> where
B: Bound,
[src]
B: Bound,
type Output = B
The returned type after indexing.
fn index(&self, i: usize) -> &B
[src]
Performs the indexing (container[index]
) operation.
impl<B, V> BoundedBy<B> for BVH<B, V> where
B: Bound,
[src]
B: Bound,