[][src]Struct generic_octree::Octree

pub struct Octree<L: LocCode, D: Send + Sync> {
    pub content: HashMap<L, OctreeNode<D>>,
    // some fields omitted
}

Fields

content: HashMap<L, OctreeNode<D>>

Implementations

impl<'a, L, D> Octree<L, D> where
    L: LocCode,
    D: Send + Sync
[src]

pub fn size(&self) -> usize[src]

Get the size of an octree

impl<'a, T, D> Octree<T, D> where
    T: LocCode,
    D: Copy + PartialEq + Send + Sync
[src]

pub fn new(max_depth: u32) -> Self[src]

Create a new Octree

pub fn with_capacity(max_depth: u32, size: usize) -> Self[src]

Create an Octree with given pre-allocated space.

pub fn depth(&self) -> u32[src]

pub fn lookup(&self, loc_code: T) -> Option<&OctreeNode<D>>[src]

Return a tree node a node.

pub fn insert(&mut self, location: T, node: OctreeNode<D>) -> T[src]

Insert a tree node.

pub fn remove_node(&mut self, loc_code: T)[src]

pub fn merge(&mut self, aabb: AABB, data: D)[src]

Merge an AABB into the tree

pub fn transform<U: From<D> + Send + Sync>(self) -> Octree<T, U>[src]

Transform an Octree of data D into an Octree of data U, provided that U implement From

pub fn transform_fn<U: Send + Sync, F: Fn(D) -> U + Sync>(
    self,
    function: F
) -> Octree<T, U>
[src]

tree.transform_fn(Rgb::from_hex);

pub fn transform_nodes_fn<U: Send + Sync, F: Fn(T, OctreeNode<D>) -> OctreeNode<U> + Sync>(
    self,
    function: F
) -> Octree<T, U>
[src]

tree.transform_fn(Rgb::from_hex);

Trait Implementations

impl<L: Debug + LocCode, D: Debug + Send + Sync> Debug for Octree<L, D>[src]

Auto Trait Implementations

impl<L, D> RefUnwindSafe for Octree<L, D> where
    D: RefUnwindSafe,
    L: RefUnwindSafe

impl<L, D> Send for Octree<L, D>

impl<L, D> Sync for Octree<L, D>

impl<L, D> Unpin for Octree<L, D> where
    D: Unpin,
    L: Unpin

impl<L, D> UnwindSafe for Octree<L, D> where
    D: RefUnwindSafe + UnwindSafe,
    L: RefUnwindSafe + UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.