pub trait KDTreeIndex<N: IndexableNum>: Sized {
// Required methods
fn coords(&self) -> &[N];
fn indices(&self) -> Indices<'_>;
fn metadata(&self) -> &KDTreeMetadata<N>;
// Provided methods
fn num_items(&self) -> u32 { ... }
fn node_size(&self) -> u16 { ... }
fn range(&self, min_x: N, min_y: N, max_x: N, max_y: N) -> Vec<u32> { ... }
fn range_rect(&self, rect: &impl RectTrait<T = N>) -> Vec<u32> { ... }
fn within(&self, qx: N, qy: N, r: N) -> Vec<u32> { ... }
fn within_coord(&self, coord: &impl CoordTrait<T = N>, r: N) -> Vec<u32> { ... }
fn root(&self) -> Node<'_, N, Self> { ... }
}
Expand description
A trait for searching and accessing data out of a KDTree.
Required Methods§
Sourcefn metadata(&self) -> &KDTreeMetadata<N>
fn metadata(&self) -> &KDTreeMetadata<N>
Access the metadata describing this KDTree
Provided Methods§
Sourcefn range(&self, min_x: N, min_y: N, max_x: N, max_y: N) -> Vec<u32>
fn range(&self, min_x: N, min_y: N, max_x: N, max_y: N) -> Vec<u32>
Search the index for items within a given bounding box.
- min_x: bbox
- min_y: bbox
- max_x: bbox
- max_y: bbox
Returns indices of found items
Sourcefn range_rect(&self, rect: &impl RectTrait<T = N>) -> Vec<u32>
fn range_rect(&self, rect: &impl RectTrait<T = N>) -> Vec<u32>
Search the index for items within a given bounding box.
Returns indices of found items
Sourcefn within(&self, qx: N, qy: N, r: N) -> Vec<u32>
fn within(&self, qx: N, qy: N, r: N) -> Vec<u32>
Search the index for items within a given radius.
- qx: x value of query point
- qy: y value of query point
- r: radius
Returns indices of found items
Sourcefn within_coord(&self, coord: &impl CoordTrait<T = N>, r: N) -> Vec<u32>
fn within_coord(&self, coord: &impl CoordTrait<T = N>, r: N) -> Vec<u32>
Search the index for items within a given radius.
- coord: coordinate of query point
- r: radius
Returns indices of found items
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.