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

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

Fields

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

Methods

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

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

Get the size of an octree

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

Return a tree node a node.

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

Insert a tree node.

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

pub fn get_mut_root(
    &mut self,
    node: &OctreeNode<L, D>
) -> Option<&mut OctreeNode<L, D>>
[src]

Get a mutable root node.

pub fn get_root(&self, node: &OctreeNode<L, D>) -> Option<&OctreeNode<L, D>>[src]

Get a immutable root node.

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

Merge an AABB into the tree

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

tree.transform_fn(Rgb::from_hex);

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

tree.transform_fn(Rgb::from_hex);

Trait Implementations

impl<L: Debug + Eq + Hash, 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.