[−][src]Struct broccoli::Tree
The data structure this crate revoles around.
Implementations
impl<'a, A: Axis, T: Aabb> Tree<'a, A, T>
[src]
#[must_use]pub fn get_height(&self) -> usize
[src]
Examples
use broccoli::analyze; const NUM_ELEMENT:usize=400; let mut bots = [axgeom::rect(0,10,0,10);NUM_ELEMENT]; let mut tree = broccoli::new(&mut bots); assert_eq!(tree.get_height(),analyze::compute_tree_height_heuristic(NUM_ELEMENT,analyze::DEFAULT_NUMBER_ELEM_PER_NODE));
#[must_use]pub fn num_nodes(&self) -> usize
[src]
Examples
use broccoli::analyze; let mut bots = [axgeom::rect(0,10,0,10)]; let mut tree = broccoli::new(&mut bots); assert_eq!(tree.num_nodes(),analyze::nodes_left(0,tree.get_height() ));
#[must_use]pub fn get_nodes(&self) -> &[NodeMut<'a, T>]ⓘ
[src]
Examples
use broccoli::analyze; let mut bots = [axgeom::rect(0,10,0,10)]; let mut tree = broccoli::new(&mut bots); assert_eq!(tree.get_nodes()[0].get().bots[0], axgeom::rect(0,10,0,10));
#[must_use]pub fn get_nodes_mut(&mut self) -> PMut<'_, [NodeMut<'a, T>]>
[src]
Examples
use broccoli::analyze; 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).get().bots[0], axgeom::rect(0,10,0,10));
Trait Implementations
impl<'a, A: Axis, T: Aabb> Queries<'a> for Tree<'a, A, T>
[src]
type A = A
type T = T
type Num = T::Num
pub fn axis(&self) -> Self::A
[src]
pub fn vistr_mut(&mut self) -> VistrMut<'_, NodeMut<'a, T>>
[src]
pub fn vistr(&self) -> Vistr<'_, NodeMut<'a, T>>
[src]
pub fn draw_divider(
&self,
drawer: &mut impl DividerDrawer<N = Self::Num>,
rect: &Rect<Self::Num>
)
[src]
&self,
drawer: &mut impl DividerDrawer<N = Self::Num>,
rect: &Rect<Self::Num>
)
pub fn find_colliding_pairs_pmut(
&mut self,
func: impl FnMut(PMut<'_, Self::T>, PMut<'_, Self::T>)
)
[src]
&mut self,
func: impl FnMut(PMut<'_, Self::T>, PMut<'_, Self::T>)
)
pub fn find_colliding_pairs_pmut_par(
&mut self,
func: impl Fn(PMut<'_, Self::T>, PMut<'_, Self::T>) + Send + Sync + Copy
) where
Self::T: Send + Sync,
[src]
&mut self,
func: impl Fn(PMut<'_, Self::T>, PMut<'_, Self::T>) + Send + Sync + Copy
) where
Self::T: Send + Sync,
pub fn new_colfind_builder(
&mut self
) -> QueryBuilder<'_, Self::A, NodeMut<'a, Self::T>>
[src]
&mut self
) -> QueryBuilder<'_, Self::A, NodeMut<'a, Self::T>>
#[must_use]pub fn multi_rect(&mut self) -> MultiRectMut<'_, Self::A, NodeMut<'a, Self::T>>
[src]
pub fn for_all_intersect_rect<'b>(
&'b self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b Self::T)
) where
'a: 'b,
[src]
&'b self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b Self::T)
) where
'a: 'b,
pub fn for_all_in_rect<'b>(
&'b self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b Self::T)
) where
'a: 'b,
[src]
&'b self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b Self::T)
) where
'a: 'b,
pub fn nbody_mut<X: NodeMassTrait<Num = Self::Num, Item = Self::T> + Send + Sync>(
&mut self,
ncontext: &X,
rect: Rect<Self::Num>
) where
X::No: Send,
Self::T: HasInner + Send + Sync,
[src]
&mut self,
ncontext: &X,
rect: Rect<Self::Num>
) where
X::No: Send,
Self::T: HasInner + Send + Sync,
pub fn nbody_mut_par<X: NodeMassTrait<Num = Self::Num, Item = Self::T> + Sync + Send>(
&mut self,
ncontext: &X,
rect: Rect<Self::Num>
) where
X::No: Send,
Self::T: HasInner + Send + Sync,
[src]
&mut self,
ncontext: &X,
rect: Rect<Self::Num>
) where
X::No: Send,
Self::T: HasInner + Send + Sync,
impl<'a, A: Axis, T: Aabb + HasInner> QueriesInner<'a> for Tree<'a, A, T>
[src]
type Inner = T::Inner
pub fn find_colliding_pairs_mut(
&mut self,
func: impl FnMut(&mut Self::Inner, &mut Self::Inner)
)
[src]
&mut self,
func: impl FnMut(&mut Self::Inner, &mut Self::Inner)
)
pub fn find_colliding_pairs_mut_par(
&mut self,
func: impl Fn(&mut Self::Inner, &mut Self::Inner) + Clone + Send + Sync
) where
Self::T: Send + Sync,
[src]
&mut self,
func: impl Fn(&mut Self::Inner, &mut Self::Inner) + Clone + Send + Sync
) where
Self::T: Send + Sync,
pub fn find_colliding_pairs_par_ext<B: Send + Sync>(
&mut self,
split: impl Fn(&mut B) -> B + Send + Sync + Copy,
fold: impl Fn(&mut B, B) + Send + Sync + Copy,
collision: impl Fn(&mut B, &mut Self::Inner, &mut Self::Inner) + Send + Sync + Copy,
acc: B
) -> B where
Self::T: Send + Sync,
[src]
&mut self,
split: impl Fn(&mut B) -> B + Send + Sync + Copy,
fold: impl Fn(&mut B, B) + Send + Sync + Copy,
collision: impl Fn(&mut B, &mut Self::Inner, &mut Self::Inner) + Send + Sync + Copy,
acc: B
) -> B where
Self::T: Send + Sync,
pub fn for_all_not_in_rect_mut<'b>(
&'b mut self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b mut Self::Inner)
) where
'a: 'b,
[src]
&'b mut self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b mut Self::Inner)
) where
'a: 'b,
pub fn for_all_intersect_rect_mut<'b>(
&'b mut self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b mut Self::Inner)
) where
'a: 'b,
[src]
&'b mut self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b mut Self::Inner)
) where
'a: 'b,
pub fn for_all_in_rect_mut<'b>(
&'b mut self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b mut Self::Inner)
) where
'a: 'b,
[src]
&'b mut self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b mut Self::Inner)
) where
'a: 'b,
#[must_use]pub fn raycast_mut<'b, Acc>(
&'b mut self,
ray: Ray<Self::Num>,
start: &mut Acc,
broad: impl FnMut(&mut Acc, &Ray<Self::Num>, &Rect<Self::Num>) -> CastResult<Self::Num>,
fine: impl FnMut(&mut Acc, &Ray<Self::Num>, &Self::T) -> CastResult<Self::Num>,
border: Rect<Self::Num>
) -> CastResult<(Vec<&'b mut Self::Inner>, Self::Num)> where
'a: 'b,
[src]
&'b mut self,
ray: Ray<Self::Num>,
start: &mut Acc,
broad: impl FnMut(&mut Acc, &Ray<Self::Num>, &Rect<Self::Num>) -> CastResult<Self::Num>,
fine: impl FnMut(&mut Acc, &Ray<Self::Num>, &Self::T) -> CastResult<Self::Num>,
border: Rect<Self::Num>
) -> CastResult<(Vec<&'b mut Self::Inner>, Self::Num)> where
'a: 'b,
#[must_use]pub fn k_nearest_mut<'b, Acc>(
&'b mut self,
point: Vec2<Self::Num>,
num: usize,
start: &mut Acc,
broad: impl FnMut(&mut Acc, Vec2<Self::Num>, &Rect<Self::Num>) -> Self::Num,
fine: impl FnMut(&mut Acc, Vec2<Self::Num>, &Self::T) -> Self::Num,
border: Rect<Self::Num>
) -> Vec<Option<(&'b mut Self::Inner, Self::Num)>>ⓘ where
'a: 'b,
[src]
&'b mut self,
point: Vec2<Self::Num>,
num: usize,
start: &mut Acc,
broad: impl FnMut(&mut Acc, Vec2<Self::Num>, &Rect<Self::Num>) -> Self::Num,
fine: impl FnMut(&mut Acc, Vec2<Self::Num>, &Self::T) -> Self::Num,
border: Rect<Self::Num>
) -> Vec<Option<(&'b mut Self::Inner, Self::Num)>>ⓘ where
'a: 'b,
pub fn intersect_with_mut<X: Aabb<Num = Self::Num> + HasInner>(
&mut self,
other: &mut [X],
func: impl Fn(&mut Self::Inner, &mut X::Inner)
)
[src]
&mut self,
other: &mut [X],
func: impl Fn(&mut Self::Inner, &mut X::Inner)
)
Auto Trait Implementations
impl<'a, A, T> RefUnwindSafe for Tree<'a, A, T> where
A: RefUnwindSafe,
T: RefUnwindSafe,
<T as Aabb>::Num: RefUnwindSafe,
A: RefUnwindSafe,
T: RefUnwindSafe,
<T as Aabb>::Num: RefUnwindSafe,
impl<'a, A, T> Send for Tree<'a, A, T> where
T: Send,
<T as Aabb>::Num: Send,
T: Send,
<T as Aabb>::Num: Send,
impl<'a, A, T> Sync for Tree<'a, A, T> where
T: Sync,
<T as Aabb>::Num: Sync,
T: Sync,
<T as Aabb>::Num: Sync,
impl<'a, A, T> Unpin for Tree<'a, A, T> where
A: Unpin,
A: Unpin,
impl<'a, A, T> !UnwindSafe for Tree<'a, A, T>
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>,