Trait synth::EnvelopeTrait []

pub trait EnvelopeTrait<'a, P> where P: 'a, Self::Points::Item == &'a P {
    type Points: 'a + Clone + Iterator + DoubleEndedIterator + ExactSizeIterator;
    fn points(&'a self) -> Self::Points;

    fn point_idx_before<X, Y>(&'a self, x: X) -> Option<usize> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn point_idx_on_or_before<X, Y>(&'a self, x: X) -> Option<usize> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn point_idx_after<X, Y>(&'a self, x: X) -> Option<usize> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn point_idx_on_or_after<X, Y>(&'a self, x: X) -> Option<usize> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn point_before<X, Y>(&'a self, x: X) -> Option<&'a P> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn point_on_or_before<X, Y>(&'a self, x: X) -> Option<&'a P> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn point_before_with_idx<X, Y>(&'a self, x: X) -> Option<(usize, &'a P)> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn point_on_or_before_with_idx<X, Y>(&'a self, x: X) -> Option<(usize, &'a P)> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn point_after<X, Y>(&'a self, x: X) -> Option<&'a P> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn point_on_or_after<X, Y>(&'a self, x: X) -> Option<&'a P> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn point_after_with_idx<X, Y>(&'a self, x: X) -> Option<(usize, &'a P)> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn point_on_or_after_with_idx<X, Y>(&'a self, x: X) -> Option<(usize, &'a P)> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn point_at<X, Y>(&'a self, x: X) -> Option<&'a P> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn point_at_with_idx<X, Y>(&'a self, x: X) -> Option<(usize, &'a P)> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn surrounding_points<X, Y>(&'a self, x: X) -> (Option<&'a P>, Option<&'a P>) where P: Point<X, Y> + 'a, X: Copy + PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn closest_point<X, Y>(&'a self, x: X) -> Option<&'a P> where P: Point<X, Y> + 'a, X: Copy + PartialOrd<X> + Sub<X, Output=X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
    fn y<X, Y>(&'a self, x: X) -> Option<Y> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + PartialEq<Y> + 'a, Y::Scalar: Float, Y::Scalar: 'a { ... }
}

Types representable as an Envelope.

Associated Types

type Points: 'a + Clone + Iterator + DoubleEndedIterator + ExactSizeIterator

An iterator yielding references to Ps.

Required Methods

fn points(&'a self) -> Self::Points

An iterator yielding the Points of the Envelope.

Provided Methods

fn point_idx_before<X, Y>(&'a self, x: X) -> Option<usize> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

The index of the Point that comes directly before the given x.

fn point_idx_on_or_before<X, Y>(&'a self, x: X) -> Option<usize> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

The index of the Point that either lands on or comes directly before the given x.

fn point_idx_after<X, Y>(&'a self, x: X) -> Option<usize> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

The index of the Point that comes directly after the given x.

fn point_idx_on_or_after<X, Y>(&'a self, x: X) -> Option<usize> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

The index of the Point that comes directly after the given x.

fn point_before<X, Y>(&'a self, x: X) -> Option<&'a P> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

A reference to the first point that comes before the given x.

fn point_on_or_before<X, Y>(&'a self, x: X) -> Option<&'a P> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

A reference to the first point that is equal to or comes before the given x.

fn point_before_with_idx<X, Y>(&'a self, x: X) -> Option<(usize, &'a P)> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

A reference to the first point that comes before the given x along with its index.

fn point_on_or_before_with_idx<X, Y>(&'a self, x: X) -> Option<(usize, &'a P)> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

A reference to the first point that is equal to or comes before the given x along with its index.

fn point_after<X, Y>(&'a self, x: X) -> Option<&'a P> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

A reference to the first point that comes after the given x.

fn point_on_or_after<X, Y>(&'a self, x: X) -> Option<&'a P> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

A reference to the first point that is equal to or comes after the given x.

fn point_after_with_idx<X, Y>(&'a self, x: X) -> Option<(usize, &'a P)> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

A reference to the first point that comes after the given x along with its index.

fn point_on_or_after_with_idx<X, Y>(&'a self, x: X) -> Option<(usize, &'a P)> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

A reference to the first point that is equal to or comes after the given x along with its index.

fn point_at<X, Y>(&'a self, x: X) -> Option<&'a P> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

A reference to the first point lying directly on the given x if there is one.

fn point_at_with_idx<X, Y>(&'a self, x: X) -> Option<(usize, &'a P)> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

A reference to the first point (along with it's index) lying directly on the given x if there is one.

fn surrounding_points<X, Y>(&'a self, x: X) -> (Option<&'a P>, Option<&'a P>) where P: Point<X, Y> + 'a, X: Copy + PartialOrd<X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

The points that lie on either side of the given x.

FIXME: This could be much faster.

fn closest_point<X, Y>(&'a self, x: X) -> Option<&'a P> where P: Point<X, Y> + 'a, X: Copy + PartialOrd<X> + Sub<X, Output=X> + 'a, Y: Spatial + 'a, Y::Scalar: Float, Y::Scalar: 'a

A reference point that is closest to the given x if there is one.

FIXME: This could be much faster.

fn y<X, Y>(&'a self, x: X) -> Option<Y> where P: Point<X, Y> + 'a, X: PartialOrd<X> + 'a, Y: Spatial + PartialEq<Y> + 'a, Y::Scalar: Float, Y::Scalar: 'a

Return y for the given x.

If there is less than two points interpolation is not meaningful, thus we should just return None.

Note: It is assumed that the points owned by the Envelope are sorted by x.

Implementors