[−][src]Struct broccoli::container::TreeInd
A less general tree that provides collect
functions
and also derefs to a Tree
.
TreeInd
assumes there is a layer of indirection where
all the pointers point to the same slice.
It uses this assumption to provide collect
functions that allow
storing query results that can then be iterated through multiple times
quickly.
Methods from Deref<Target = Tree<'b, BBox<N, &'a mut T>>>
#[must_use]pub fn get_height(&self) -> usize
[src]
Examples
use broccoli::build; const NUM_ELEMENT:usize=40; let mut bots = [axgeom::rect(0,10,0,10);NUM_ELEMENT]; let mut tree = broccoli::new(&mut bots); assert_eq!(tree.get_height(),build::TreePreBuilder::new(NUM_ELEMENT).get_height());
#[must_use]pub fn num_aabbs(&self) -> usize
[src]
Examples
use broccoli::build; const NUM_ELEMENT:usize=7; let mut bots = [axgeom::rect(0,10,0,10);NUM_ELEMENT]; let mut tree = broccoli::new(&mut bots); assert_eq!(tree.num_aabbs(),7);
#[must_use]pub fn num_nodes(&self) -> usize
[src]
Examples
use broccoli::build; let mut bots = [axgeom::rect(0,10,0,10)]; let mut tree = broccoli::new(&mut bots); assert_eq!(tree.num_nodes(),build::TreePreBuilder::new(1).num_nodes());
#[must_use]pub fn get_nodes(&self) -> &[Node<'a, T>]ⓘ
[src]
Examples
let mut bots = [axgeom::rect(0,10,0,10)]; let mut tree = broccoli::new(&mut bots); assert_eq!(tree.get_nodes()[0].range[0], axgeom::rect(0,10,0,10));
#[must_use]pub fn get_nodes_mut(&mut self) -> PMut<'_, [Node<'a, T>]>
[src]
Examples
let mut bots = [axgeom::rect(0,10,0,10)]; let mut tree = broccoli::new(&mut bots); assert_eq!(tree.get_nodes_mut().get_index_mut(0).range[0], axgeom::rect(0,10,0,10));
#[must_use]pub fn get_elements_mut(&mut self) -> PMut<'_, [T]>
[src]
Return the underlying slice of aabbs in the order sorted during tree construction.
Examples
let mut bots = [axgeom::rect(0,10,0,10)]; let mut tree = broccoli::new(&mut bots); assert_eq!(*tree.get_elements_mut().get_index_mut(0), axgeom::rect(0,10,0,10));
#[must_use]pub fn get_elements(&self) -> &[T]ⓘ
[src]
Return the underlying slice of aabbs in the order sorted during tree construction.
Examples
let mut bots = [axgeom::rect(0,10,0,10)]; let tree = broccoli::new(&mut bots); assert_eq!(tree.get_elements()[0], axgeom::rect(0,10,0,10));
Trait Implementations
impl<'a, 'b, N: Num, T> Deref for TreeInd<'a, 'b, N, T>
[src]
type Target = Tree<'b, BBox<N, &'a mut T>>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl<'a, 'b, N: Num, T> DerefMut for TreeInd<'a, 'b, N, T>
[src]
impl<'a, 'b, N: Num, T> From<TreeInd<'a, 'b, N, T>> for Tree<'b, BBox<N, &'a mut T>>
[src]
impl<'a, 'b, N: Num, T> FromSlice<'a, 'b> for TreeInd<'a, 'b, N, T>
[src]
type T = BBox<N, &'a mut T>
The tree must be filled with T, which must have a pointer to Self::Inner
.
type Inner = T
The type that the pointers are pointing to. The original slice is composed of this. Read more
type Num = N
The number type of the aabb.
fn get_inner_elements(&self) -> &[Self::Inner]ⓘ
[src]
fn get_inner_elements_mut(&mut self) -> &mut [Self::Inner]ⓘ
[src]
fn get_tree_mut(&mut self) -> &mut Tree<'b, BBox<N, &'a mut T>>
[src]
fn collect_all<D: Send + Sync>(
&mut self,
mut func: impl FnMut(&Rect<Self::Num>, &mut Self::Inner) -> Option<D>
) -> FilteredElements<Self::Inner, D>
[src]
&mut self,
mut func: impl FnMut(&Rect<Self::Num>, &mut Self::Inner) -> Option<D>
) -> FilteredElements<Self::Inner, D>
fn collect_colliding_pairs<D: Send + Sync>(
&mut self,
mut func: impl FnMut(&mut Self::Inner, &mut Self::Inner) -> Option<D> + Send + Sync
) -> CollidingPairs<Self::Inner, D>
[src]
&mut self,
mut func: impl FnMut(&mut Self::Inner, &mut Self::Inner) -> Option<D> + Send + Sync
) -> CollidingPairs<Self::Inner, D>
fn collect_colliding_pairs_par<D: Send + Sync>(
&mut self,
joiner: impl Joinable,
func: impl Fn(&mut Self::Inner, &mut Self::Inner) -> Option<D> + Send + Sync + Copy
) -> CollidingPairsPar<Self::Inner, D> where
Self::T: Send + Sync,
Self::Num: Send + Sync,
[src]
&mut self,
joiner: impl Joinable,
func: impl Fn(&mut Self::Inner, &mut Self::Inner) -> Option<D> + Send + Sync + Copy
) -> CollidingPairsPar<Self::Inner, D> where
Self::T: Send + Sync,
Self::Num: Send + Sync,
Auto Trait Implementations
impl<'a, 'b, N, T> RefUnwindSafe for TreeInd<'a, 'b, N, T> where
N: RefUnwindSafe,
T: RefUnwindSafe,
[src]
N: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, 'b, N, T> Send for TreeInd<'a, 'b, N, T> where
N: Send,
T: Send,
[src]
N: Send,
T: Send,
impl<'a, 'b, N, T> Sync for TreeInd<'a, 'b, N, T> where
N: Sync,
T: Sync,
[src]
N: Sync,
T: Sync,
impl<'a, 'b, N, T> Unpin for TreeInd<'a, 'b, N, T>
[src]
impl<'a, 'b, N, T> !UnwindSafe for TreeInd<'a, 'b, N, T>
[src]
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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
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>,