SpatialArray

Trait SpatialArray 

Source
pub trait SpatialArray<T: SpatialScalar, P: SpatialPoint<T>> {
    // Required methods
    fn len(&self) -> usize;
    fn dimension(&self) -> Option<usize>;
    fn get_point(&self, index: usize) -> Option<P>;
    fn iter_points(&self) -> Box<dyn Iterator<Item = P> + '_>;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn bounding_box(&self) -> Option<(P, P)> { ... }
}
Expand description

Trait for collections of spatial points

This trait allows algorithms to work with different array structures and iterator types while maintaining efficiency.

Required Methods§

Source

fn len(&self) -> usize

Get the number of points in the array

Source

fn dimension(&self) -> Option<usize>

Get the dimension of points in this array

Source

fn get_point(&self, index: usize) -> Option<P>

Get a point at the given index

Source

fn iter_points(&self) -> Box<dyn Iterator<Item = P> + '_>

Iterate over all points

Provided Methods§

Source

fn is_empty(&self) -> bool

Check if the array is empty

Source

fn bounding_box(&self) -> Option<(P, P)>

Get the bounding box of all points

Implementors§