[−][src]Trait spade::SpatialObject
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.
Associated Types
Loading content...Required methods
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.
fn distance2(&self, point: &Self::Point) -> <Self::Point as PointN>::Scalar
Returns the squared euclidean distance from the object's contour. Returns a value samller than zero if the point is contained within the object.
Provided methods
fn contains(&self, point: &Self::Point) -> bool
Returns true if a given point is contained in this object.
Implementors
impl<S> SpatialObject for S where
S: HasPosition,
[src]
S: HasPosition,
type Point = S::Point
fn mbr(&self) -> BoundingRect<S::Point>
[src]
fn distance2(&self, point: &S::Point) -> <S::Point as PointN>::Scalar
[src]
fn contains(&self, point: &S::Point) -> bool
[src]
impl<V> SpatialObject for SimpleCircle<V> where
V: PointN,
V::Scalar: SpadeFloat,
[src]
V: PointN,
V::Scalar: SpadeFloat,
type Point = V
fn mbr(&self) -> BoundingRect<V>
[src]
fn distance2(&self, point: &V) -> V::Scalar
[src]
fn contains(&self, point: &V) -> bool
[src]
impl<V> SpatialObject for SimpleTriangle<V> where
V: TwoDimensional,
V::Scalar: SpadeFloat,
[src]
V: TwoDimensional,
V::Scalar: SpadeFloat,
impl<V> SpatialObject for BoundingRect<V> where
V: PointN,
[src]
V: PointN,
type Point = V
fn mbr(&self) -> BoundingRect<V>
[src]
fn distance2(&self, point: &Self::Point) -> V::Scalar
[src]
fn contains(&self, point: &Self::Point) -> bool
[src]
impl<V: PointN> SpatialObject for SimpleEdge<V> where
V::Scalar: SpadeFloat,
[src]
V::Scalar: SpadeFloat,