[−][src]Struct simple_octree::Octree
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]
D: Default,
#[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]
&mut self,
pos_x: bool,
pos_y: bool,
pos_z: bool
) -> Result<&mut Self, AddChildError>
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]
&mut self,
pos_x: bool,
pos_y: bool,
pos_z: bool
) -> Option<Self>
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]
&self,
pos_x: bool,
pos_y: bool,
pos_z: bool
) -> Option<&Self>
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]
&mut self,
pos_x: bool,
pos_y: bool,
pos_z: bool
) -> Option<&mut Self>
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
Auto Trait Implementations
impl<D> RefUnwindSafe for Octree<D> where
D: RefUnwindSafe,
D: RefUnwindSafe,
impl<D> Send for Octree<D> where
D: Send,
D: Send,
impl<D> Sync for Octree<D> where
D: Sync,
D: Sync,
impl<D> Unpin for Octree<D> where
D: Unpin,
D: Unpin,
impl<D> UnwindSafe for Octree<D> where
D: UnwindSafe,
D: UnwindSafe,
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>,