[][src]Trait spade::SpatialObject

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 { ... } }

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

type Point: PointN

The object's point type.

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.

Loading content...

Provided methods

fn contains(&self, point: &Self::Point) -> bool

Returns true if a given point is contained in this object.

Loading content...

Implementors

impl<S> SpatialObject for S where
    S: HasPosition
[src]

type Point = S::Point

impl<V> SpatialObject for SimpleCircle<V> where
    V: PointN,
    V::Scalar: SpadeFloat
[src]

type Point = V

impl<V> SpatialObject for SimpleTriangle<V> where
    V: TwoDimensional,
    V::Scalar: SpadeFloat
[src]

type Point = V

impl<V> SpatialObject for BoundingRect<V> where
    V: PointN
[src]

type Point = V

impl<V: PointN> SpatialObject for SimpleEdge<V> where
    V::Scalar: SpadeFloat
[src]

type Point = V

Loading content...