Struct pasture_core::math::DynamicMortonIndex [−][src]
3D Morton index with a dynamic depth
Implementations
impl DynamicMortonIndex
[src]
pub fn from_octants(octants: &[Octant]) -> Self
[src]
Creates a new DynamicMortonIndex
from the given octants. The order of the octant numbering is unspecified.
The order of the indices goes from shallowest node to deepest node.
Example:
let mut dynamic_morton_index = DynamicMortonIndex::from_octants(&[Octant::ONE, Octant::TWO, Octant::FOUR]); assert_eq!(3, dynamic_morton_index.depth());
pub fn depth(&self) -> usize
[src]
Returns the depth of the associated DynamicMortonIndex
. A depth of zero corresponds to the root node of an octree
pub fn octants(&self) -> &[Octant]
[src]
Returns a reference to the octant indices of associated DynamicMortonIndex
. The order of the indices goes from shallowest
node to deepest node.
pub fn add_octant(&mut self, octant: Octant)
[src]
Adds a new octant to the associated DynamicMortonIndex
Example:
let mut dynamic_morton_index = DynamicMortonIndex::from_octants(&[Octant::ONE, Octant::TWO, Octant::FOUR]); dynamic_morton_index.add_octant(Octant::SIX); assert_eq!(4, dynamic_morton_index.depth()); assert_eq!(&[Octant::ONE, Octant::TWO, Octant::FOUR, Octant::SIX], dynamic_morton_index.octants());
pub fn truncate_to_depth(&self, new_depth: usize) -> Option<Self>
[src]
Tries to truncate the associated DynamicMortonIndex
to the given depth. If depth
is greater than the
current depth, this operation fails and returns None
.
Example:
let mut dynamic_morton_index = DynamicMortonIndex::from_octants(&[Octant::ONE, Octant::TWO, Octant::FOUR]); let truncated_index = dynamic_morton_index.truncate_to_depth(1); assert_eq!(Some(DynamicMortonIndex::from_octants(&[Octant::ONE])), truncated_index); let invalid_index = dynamic_morton_index.truncate_to_depth(10); assert_eq!(None, invalid_index);
pub fn iter(&self) -> impl Iterator<Item = &Octant>
[src]
Returns an iterator over the octants in the associated DynamicMortonIndex
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Octant>
[src]
Returns a mutable iterator over the octants in the associated DynamicMortonIndex
pub fn to_string(&self, naming: MortonIndexNaming) -> String
[src]
Returns a string representation of the associated MortonIndex64
with the given MortonIndexNaming
Trait Implementations
impl Clone for DynamicMortonIndex
[src]
fn clone(&self) -> DynamicMortonIndex
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for DynamicMortonIndex
[src]
impl Default for DynamicMortonIndex
[src]
impl Display for DynamicMortonIndex
[src]
impl Eq for DynamicMortonIndex
[src]
impl From<&'_ MortonIndex64WithDepth> for DynamicMortonIndex
[src]
fn from(morton_index: &MortonIndex64WithDepth) -> Self
[src]
impl From<MortonIndex64> for DynamicMortonIndex
[src]
fn from(morton_index: MortonIndex64) -> Self
[src]
impl From<MortonIndex64WithDepth> for DynamicMortonIndex
[src]
fn from(morton_index: MortonIndex64WithDepth) -> Self
[src]
impl PartialEq<DynamicMortonIndex> for DynamicMortonIndex
[src]
fn eq(&self, other: &DynamicMortonIndex) -> bool
[src]
fn ne(&self, other: &DynamicMortonIndex) -> bool
[src]
impl StructuralEq for DynamicMortonIndex
[src]
impl StructuralPartialEq for DynamicMortonIndex
[src]
impl TryFrom<&'_ DynamicMortonIndex> for MortonIndex64WithDepth
[src]
type Error = DynamicMortonIndexTooLargeError
The type returned in the event of a conversion error.
fn try_from(value: &DynamicMortonIndex) -> Result<Self, Self::Error>
[src]
impl TryFrom<DynamicMortonIndex> for MortonIndex64WithDepth
[src]
type Error = DynamicMortonIndexTooLargeError
The type returned in the event of a conversion error.
fn try_from(value: DynamicMortonIndex) -> Result<Self, Self::Error>
[src]
Auto Trait Implementations
impl RefUnwindSafe for DynamicMortonIndex
impl Send for DynamicMortonIndex
impl Sync for DynamicMortonIndex
impl Unpin for DynamicMortonIndex
impl UnwindSafe for DynamicMortonIndex
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,
pub 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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,