zpatial/interface/
i_spatial_accel.rs

1extern crate mazth;
2
3use self::mazth::i_bound::IBound;
4
5/// acceleration interface for building and querying spatial data
6pub trait ISpatialAccel<T>
7where
8    T: Default + Clone,
9{
10    /// query for a list of objects intersecting with input
11    fn query_intersect(&self, input: &dyn IBound) -> Result<Vec<T>, &'static str>;
12    fn query_intersect_single(&self, input: &dyn IBound) -> Result<Vec<T>, &'static str>;
13    /// build a acceleration structure with input bounds and object ids
14    fn build_all(&mut self, &[(T, &dyn IBound)]) -> Result<(), &'static str>;
15}