pub struct OctreeNode<I: Index, R: Real> { /* private fields */ }
Expand description

Represents a node in the octree hierarchy and stores child nodes, implements tree iteration/visitation from the generic_tree module

Implementations§

source§

impl<I: Index, R: Real> OctreeNode<I, R>

source

pub fn new( id: usize, min_corner: PointIndex<I>, max_corner: PointIndex<I>, aabb: Aabb3d<R> ) -> Self

source

pub fn id(&self) -> usize

Returns the id of the node

source

pub fn data(&self) -> &NodeData<I, R>

Returns a reference to the data stored in the node

source

pub fn min_corner(&self) -> &PointIndex<I>

Returns the PointIndex of the lower corner of the octree node

source

pub fn max_corner(&self) -> &PointIndex<I>

Returns the PointIndex of the upper corner of the octree node

source

pub fn aabb(&self) -> &Aabb3d<R>

Returns the AABB represented by this octree node

source

pub fn grid( &self, min: &Vector3<R>, cell_size: R ) -> Result<UniformGrid<I, R>, GridConstructionError<I, R>>

Constructs a UniformGrid that represents the domain of this octree node

source

pub fn subdivide_with_margin( &mut self, grid: &UniformGrid<I, R>, particle_positions: &[Vector3<R>], margin: R, next_id: &AtomicUsize )

Performs a subdivision of this node while considering a margin for “ghost particles” around each octant

source

pub fn par_subdivide_with_margin( &mut self, grid: &UniformGrid<I, R>, particle_positions: &[Vector3<R>], margin: R, parallel_policy: &ParallelPolicy, next_id: &AtomicUsize )

Parallel subdivision of this node while considering a margin for “ghost particles” around each octant

Trait Implementations§

source§

impl<I: Clone + Index, R: Clone + Real> Clone for OctreeNode<I, R>

source§

fn clone(&self) -> OctreeNode<I, R>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<I: Debug + Index, R: Debug + Real> Debug for OctreeNode<I, R>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<I: Index, R: Real> TreeNode for OctreeNode<I, R>

source§

fn children(&self) -> &[Box<Self>]

Returns a slice of all child nodes

source§

impl<I: Index, R: Real> TreeNodeMut for OctreeNode<I, R>

source§

fn children_mut(&mut self) -> &mut [Box<Self>]

Returns a mutable slice of all child nodes

Auto Trait Implementations§

§

impl<I, R> RefUnwindSafe for OctreeNode<I, R>where I: RefUnwindSafe, R: RefUnwindSafe,

§

impl<I, R> Send for OctreeNode<I, R>

§

impl<I, R> Sync for OctreeNode<I, R>

§

impl<I, R> Unpin for OctreeNode<I, R>where I: Unpin, R: Unpin,

§

impl<I, R> UnwindSafe for OctreeNode<I, R>where I: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> MutVisitableTree for Twhere T: TreeNodeMut,

source§

fn visit_mut_dfs<F: FnMut(&mut Self)>(&mut self, visitor: F)

Visits a node and its children in depth-first order. The visitor is applied before enqueuing each node’s children.
source§

fn visit_mut_bfs<F: FnMut(&mut Self)>(&mut self, visitor: F)

Visits a node and its children in breadth-first order. The visitor is applied before enqueuing each node’s children.
source§

impl<T> ParMutVisitableTree for Twhere T: TreeNodeMut + Send + Sync,

source§

fn par_visit_mut_bfs<F>(&mut self, visitor: F)where Self: Send + Sync, F: Fn(&mut Self) + Sync,

Visits a node and its children in breadth-first order. The visitor is applied before enqueuing each node’s children. Parallel version.
source§

fn par_visit_mut_dfs_post<F>(&mut self, visitor: F)where Self: Send + Sync, F: Fn(&mut Self) + Sync,

Visits a node and its children in depth-first post-order. The visitor is applied after processing each node’s children. Parallel version.
source§

fn try_par_visit_mut_dfs_post<E, F>(&mut self, visitor: F) -> Result<(), E>where Self: Send + Sync, E: Send + Sync, F: Fn(&mut Self) -> Result<(), E> + Sync,

Visits a node and its children in depth-first post-order, stops visitation on first error and returns it. The visitor is applied after processing each node’s children. Parallel version.
source§

impl<T> ParVisitableTree for Twhere T: TreeNode + Send + Sync,

source§

fn par_visit_bfs<F>(&self, visitor: F)where Self: Sync, F: Fn(&Self) + Sync,

Visits a node and its children in breadth-first order. The visitor is applied in parallel to processing the children.
source§

fn try_par_visit_bfs<E, F>(&self, visitor: F) -> Result<(), E>where Self: Sync, E: Send + Sync, F: Fn(&Self) -> Result<(), E> + Sync,

Visits a node and its children in breadth-first order, stops visitation on first error and returns it. The visitor is applied in parallel to processing the children.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> VisitableTree for Twhere T: TreeNode,

source§

fn dfs_iter<'a>(&'a self) -> DfsIter<'a, Self>

An iterator over all nodes and its children in depth-first order.
source§

fn bfs_iter<'a>(&'a self) -> BfsIter<'a, Self>

An iterator over all nodes and its children in breadth-first order.
source§

impl<T> ThreadSafe for Twhere T: Sync + Send,