[][src]Struct generic_octree::octree::Octree

pub struct Octree<L: Eq + Hash + Copy + Debug, D> {
    pub content: HashMap<LocCode<L>, OctreeNode<D>>,
    // some fields omitted
}

Fields

content: HashMap<LocCode<L>, OctreeNode<D>>

Implementations

impl<L, D> Octree<L, D> where
    L: Eq + Hash + Copy + Debug
[src]

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

Get the size of an octree

impl<T, D> Octree<T, D> where
    T: Ord + Hash + From<u8> + Shr<Output = T> + Shl<Output = T> + BitOr<Output = T> + Copy + Debug,
    D: Copy + PartialEq
[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: LocCode<T>) -> Option<&OctreeNode<D>>[src]

Return a tree node a node.

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

Insert a tree node.

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

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

Merge an AABB into the tree

pub fn transform<U: From<D>>(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, F: Fn(D) -> U>(self, function: F) -> Octree<T, U>[src]

tree.transform_fn(Rgb::from_hex);

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

tree.transform_fn(Rgb::from_hex);

Trait Implementations

impl<L: Debug + Eq + Hash + Copy, D: Debug> 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> where
    D: Send,
    L: Send

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

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

impl<L, D> UnwindSafe for Octree<L, D> where
    D: UnwindSafe,
    L: 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.