Crate morton_index

Source

Re-exports§

pub use nalgebra;

Modules§

align
dimensions
helper
number

Structs§

CellIter
Iterator over cells of a Morton index
DynamicStorage
DynamicStorage2D
Morton index storage which can store an arbitrary number of levels without an upper limit. This uses a Vec<u8> as the internal storage, which can grow dynamically, at the expense of not being Copy and potentially worse performance than the StaticStorage2D and FixedStorage2D variants.
DynamicStorage3D
Morton index storage which can store an arbitrary number of levels without an upper limit. This uses a Vec<u8> as the internal storage, which can grow dynamically, at the expense of not being Copy and potentially worse performance than the StaticStorage3D and FixedStorage3D variants.
FixedDepthStorage
FixedDepthStorage2D
Storage for a 2D Morton index that always stores a Morton index with a fixed depth (fixed number of levels)
FixedDepthStorage3D
Storage for a 3D Morton index that always stores a Morton index with a fixed depth (fixed number of levels)
MortonIndex2D
A 2D Morton index. This represents a single node inside a quadtree. The depth of the node and the maximum storage capacity of this type depend on the generic Storage type
MortonIndex3D
A 3D Morton index. This represents a single node inside an octree. The depth of the node and the maximum storage capacity of this type depend on the generic Storage type
StaticStorage
StaticStorage2D
Morton index storage which can store an arbitrary number of levels up to a static maximum number of levels as defined by the FixedStorageType B. As opposed to the FixedDepthStorage, two Morton indices with this storage type can represent two nodes with different depth levels. Since the internal bit representation is fixed at compile-time by the FixedStorageType parameter, the maximum depth is limited at compile-time as well, so some of the methods that construct or extend Morton indices with this storage might return None if the internal storage capacity is not sufficient.
StaticStorage3D

Enums§

Error
MortonIndexNaming
When converting a Morton index to a string, these are the different ways to construct the string

Traits§

FixedStorageType
Trait for any type that can be used as the data type in a fixed-depth storage of a Morton index. The idea here is to generalize unsigned integer types with an arbitrary number of bits, so that we can use u8, u16, u32 etc. as the internal data type of the FixedDepthStorageND types. Ultimately, this should also allow us to use [u8; X] types to have statically-sized Morton indices with arbitrary depth, beyond the native integer types of the current plattform, but this is a TODO.
MortonIndex
Trait for any type of Morton index, independent of the maximum levels or dimensionality. This contains a core set of common functions that are identical to all Morton indices:
Storage
Trait for the different storage types of a Morton index. A Storage is responsible for storing the different cells at each level of the Morton index. While it would be possible to simply have a Vec<Cell>, it is usually more efficient to do some bit-packing. Implementors of this trait can store the cells in any way they choose, Storage just defines the common API that each Morton index must support. The actual storage depends on the Dimension of the Morton index, so Storage requires a generic parameter that implements Dimension.
StorageType
Helper trait that simplifies the implementation of the Storage trait. This encapsulates how a storage implementation maps its internal bit representation to the cells at a specific levels
VariableDepthMortonIndex
Trait for Morton index types that support variable depth. Provides methods to quickly obtain Morton indices for parent and child nodes.
VariableDepthStorage
Trait for any storage type of a Morton index that supports variable depth

Type Aliases§

DynamicMortonIndex2D
A 2D Morton index with variable depth. It uses a Vec as storage and can represent an unlimited number of cells
DynamicMortonIndex3D
A 3D Morton index with variable depth. It uses a Vec as storage and can represent an unlimited number of cells
FixedDepthMortonIndex2D8
A 2D Morton index with a fixed depth of 4 levels (using a single u8 value as storage)
FixedDepthMortonIndex2D16
A 2D Morton index with a fixed depth of 8 levels (using a single u16 value as storage)
FixedDepthMortonIndex2D32
A 2D Morton index with a fixed depth of 16 levels (using a single u32 value as storage)
FixedDepthMortonIndex2D64
A 2D Morton index with a fixed depth of 32 levels (using a single u64 value as storage)
FixedDepthMortonIndex2D128
A 2D Morton index with a fixed depth of 64 levels (using a single u128 value as storage)
FixedDepthMortonIndex3D8
A 3D Morton index with a fixed depth of 2 levels (using a single u8 value as storage)
FixedDepthMortonIndex3D16
A 3D Morton index with a fixed depth of 5 levels (using a single u16 value as storage)
FixedDepthMortonIndex3D32
A 3D Morton index with a fixed depth of 10 levels (using a single u32 value as storage)
FixedDepthMortonIndex3D64
A 3D Morton index with a fixed depth of 21 levels (using a single u64 value as storage)
FixedDepthMortonIndex3D128
A 3D Morton index with a fixed depth of 42 levels (using a single u128 value as storage)
Result
StaticMortonIndex2D8
A 2D Morton index with variable depth, but a statically-determined maximum depth of 4 levels (using a single u8 value as storage)
StaticMortonIndex2D16
A 2D Morton index with variable depth, but a statically-determined maximum depth of 8 levels (using a single u16 value as storage)
StaticMortonIndex2D32
A 2D Morton index with variable depth, but a statically-determined maximum depth of 16 levels (using a single u32 value as storage)
StaticMortonIndex2D64
A 2D Morton index with variable depth, but a statically-determined maximum depth of 32 levels (using a single u64 value as storage)
StaticMortonIndex2D128
A 2D Morton index with variable depth, but a statically-determined maximum depth of 64 levels (using a single u128 value as storage)
StaticMortonIndex3D8
A 3D Morton index with variable depth, but a statically-determined maximum depth of 2 levels (using a single u8 value as storage)
StaticMortonIndex3D16
A 3D Morton index with variable depth, but a statically-determined maximum depth of 5 levels (using a single u16 value as storage)
StaticMortonIndex3D32
A 3D Morton index with variable depth, but a statically-determined maximum depth of 10 levels (using a single u32 value as storage)
StaticMortonIndex3D64
A 3D Morton index with variable depth, but a statically-determined maximum depth of 21 levels (using a single u64 value as storage)
StaticMortonIndex3D128
A 3D Morton index with variable depth, but a statically-determined maximum depth of 42 levels (using a single u128 value as storage)