Trait spade::SpatialObject[][src]

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

The object's point type.

Required Methods

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.

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

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

Implementors