Trait spade::SpatialObject
source · pub trait SpatialObject {
type Point: PointN;
fn mbr(&self) -> BoundingRect<Self::Point>;
fn distance2(&self, point: &Self::Point) -> <Self::Point as PointN>::Scalar;
fn contains(&self, point: &Self::Point) -> bool { ... }
}
Expand description
Describes objects that can be located by r-trees.
See the primitives
module for some basic implementations which can also serve
as useful examples for own implementations.
Required Associated Types
Required Methods
sourcefn mbr(&self) -> BoundingRect<Self::Point>
fn mbr(&self) -> BoundingRect<Self::Point>
Returns the object’s minimal bounding rectangle.
The minimal bounding rectangle is the smallest axis aligned rectangle that completely contains the object. Note: The rectangle must be as small as possible, otherwise some queries might fail.