Struct splashsurf_lib::octree::OctreeNode
source · 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>
impl<I: Index, R: Real> OctreeNode<I, R>
pub fn new( id: usize, min_corner: PointIndex<I>, max_corner: PointIndex<I>, aabb: Aabb3d<R> ) -> Self
sourcepub fn min_corner(&self) -> &PointIndex<I>
pub fn min_corner(&self) -> &PointIndex<I>
Returns the PointIndex
of the lower corner of the octree node
sourcepub fn max_corner(&self) -> &PointIndex<I>
pub fn max_corner(&self) -> &PointIndex<I>
Returns the PointIndex
of the upper corner of the octree node
sourcepub fn grid(
&self,
min: &Vector3<R>,
cell_size: R
) -> Result<UniformGrid<I, R>, GridConstructionError<I, R>>
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
sourcepub fn subdivide_with_margin(
&mut self,
grid: &UniformGrid<I, R>,
particle_positions: &[Vector3<R>],
margin: R,
next_id: &AtomicUsize
)
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
sourcepub fn par_subdivide_with_margin(
&mut self,
grid: &UniformGrid<I, R>,
particle_positions: &[Vector3<R>],
margin: R,
parallel_policy: &ParallelPolicy,
next_id: &AtomicUsize
)
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>
impl<I: Clone + Index, R: Clone + Real> Clone for OctreeNode<I, R>
source§fn clone(&self) -> OctreeNode<I, R>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<I: Index, R: Real> TreeNodeMut for OctreeNode<I, R>
impl<I: Index, R: Real> TreeNodeMut for OctreeNode<I, R>
source§fn children_mut(&mut self) -> &mut [Box<Self>]
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> MutVisitableTree for Twhere
T: TreeNodeMut,
impl<T> MutVisitableTree for Twhere T: TreeNodeMut,
source§fn visit_mut_dfs<F: FnMut(&mut Self)>(&mut self, visitor: F)
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)
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,
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,
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,
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,
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,
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,
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,
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
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
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
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.