[][src]Struct simple_octree::Octree

pub struct Octree<D> where
    D: Default
{ /* fields omitted */ }

A barebones octree offering just the methods required for accessing and modifying its contents. Other management structures/functions will be needed to make this more useful, especially for the purpose of querying contents.

Methods

impl<D> Octree<D> where
    D: Default
[src]

#[must_use]pub fn new() -> Self[src]

pub fn add_child(&mut self, idx: usize) -> Result<&mut Self, AddChildError>[src]

Adds and returns a reference to a child at a particular index.

Errors

Returns an error if the idx is out of range (i.e. idx >= 8) or if the child is already added.

pub fn add_child_at_pos(
    &mut self,
    pos_x: bool,
    pos_y: bool,
    pos_z: bool
) -> Result<&mut Self, AddChildError>
[src]

Adds and returns a reference to a child at an index based on whether the child is at the positive or negative side of each axis.

Arguments

  • pos_x - positive x axis if true, negative if false.
  • pos_y - positive y axis if true, negative if false.
  • pos_z - positive z axis if true, negative if false.

Errors

Returns an error if the child is already added.

pub fn remove_child(&mut self, idx: usize) -> Option<Self>[src]

Removes a child and returns the owned value, if it exists.

pub fn remove_child_at_pos(
    &mut self,
    pos_x: bool,
    pos_y: bool,
    pos_z: bool
) -> Option<Self>
[src]

Removes a child at an index based on whether the child is at the positive or negative side of each access and returns the owned value, if it exists.

Arguments

  • pos_x - positive x axis if true, negative if false.
  • pos_y - positive y axis if true, negative if false.
  • pos_z - positive z axis if true, negative if false.

#[must_use]pub fn get_child(&self, idx: usize) -> Option<&Self>[src]

Gets a reference to a child given an index.

#[must_use]pub fn get_child_mut(&mut self, idx: usize) -> Option<&mut Self>[src]

Gets a mutable reference to a child given an index.

#[must_use]pub fn get_child_at_pos(
    &self,
    pos_x: bool,
    pos_y: bool,
    pos_z: bool
) -> Option<&Self>
[src]

Gets a reference to a child given whether the child is at the positive or negative side of an axis.

Arguments

  • pos_x - positive x axis if true, negative if false.
  • pos_y - positive y axis if true, negative if false.
  • pos_z - positive z axis if true, negative if false.

#[must_use]pub fn get_child_mut_at_pos(
    &mut self,
    pos_x: bool,
    pos_y: bool,
    pos_z: bool
) -> Option<&mut Self>
[src]

Gets a mutable reference to a child given whether the child is at the positive or negative side of an axis.

Arguments

  • pos_x - positive x axis if true, negative if false.
  • pos_y - positive y axis if true, negative if false.
  • pos_z - positive z axis if true, negative if false.

#[must_use]pub fn get_data(&self) -> &D[src]

Gets a reference to the underlying data in the node.

#[must_use]pub fn get_data_mut(&mut self) -> &mut D[src]

Gets a mutable reference to the underlying data in the node.

Trait Implementations

impl<D: Default> Default for Octree<D> where
    D: Default
[src]

Auto Trait Implementations

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

impl<D> Send for Octree<D> where
    D: Send

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

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

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