[−][src]Struct broccoli::Tree
The data structure this crate revoles around.
Implementations
impl<'a, 'b, A: Axis, N: Num, T> Tree<'a, A, BBox<N, &'b mut T>>
[src]
pub fn collect_intersections_list<'c, D: Send + Sync>(
&mut self,
func: impl FnMut(&mut T, &mut T) -> Option<D> + Send + Sync
) -> CollidingPairs<'b, T, D>
[src]
&mut self,
func: impl FnMut(&mut T, &mut T) -> Option<D> + Send + Sync
) -> CollidingPairs<'b, T, D>
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() ));
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
fn axis(&self) -> Self::A
[src]
fn vistr_mut(&mut self) -> VistrMut<'_, NodeMut<'a, T>>
[src]
fn vistr(&self) -> Vistr<'_, NodeMut<'a, T>>
[src]
fn new_colfind_builder(
&mut self
) -> QueryBuilder<'_, Self::A, NodeMut<'a, Self::T>>
[src]
&mut self
) -> QueryBuilder<'_, Self::A, NodeMut<'a, Self::T>>
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>
)
fn find_intersections_pmut(
&mut self,
func: impl FnMut(PMut<'_, Self::T>, PMut<'_, Self::T>)
)
[src]
&mut self,
func: impl FnMut(PMut<'_, Self::T>, PMut<'_, Self::T>)
)
#[must_use]fn multi_rect(&mut self) -> MultiRectMut<'_, Self::A, NodeMut<'a, Self::T>>
[src]
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,
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,
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,
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
fn find_intersections_mut(
&mut self,
func: impl FnMut(&mut Self::Inner, &mut Self::Inner)
)
[src]
&mut self,
func: impl FnMut(&mut Self::Inner, &mut Self::Inner)
)
fn find_intersections_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,
fn find_intersections_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,
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,
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,
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]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>
) -> RayCastResult<'b, 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>
) -> RayCastResult<'b, Self::Inner, Self::Num> where
'a: 'b,
#[must_use]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<KnearestResult<'b, 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<KnearestResult<'b, Self::Inner, Self::Num>>ⓘ where
'a: 'b,
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,
<T as Aabb>::Num: Unpin,
A: Unpin,
<T as Aabb>::Num: 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,
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, 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>,