Struct spade::BoundingRect[][src]

pub struct BoundingRect<V: PointN> { /* fields omitted */ }

An axis aligned minimal bounding rectangle.

An axis aligned minimal bounding rectangle is the smallest rectangle that completely surrounds an object and is aligned along all axes. The vector type V's dimension determines if this is a rectangle, a box or a higher dimensional volume.

Methods

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

Creates a bounding rectangle that contains exactly one point.

This will create a bounding rectangle with lower == upper == point.

Create a bounding rectangle from a set of points

Panics

Panics if the given iterator is empty.

Creates a bounding rectangle that contains two points.

Returns the lower corner of the bounding rectangle.

The lower corner has the smaller coordinates.

Returns the upper corner of the bounding rectangle.

The upper corner has the larger coordinates.

Checks if a point is contained within the bounding rectangle.

A point lying exactly on the bounding rectangle's border is also contained.

Checks if another bounding rectangle is completley contained withing this rectangle.

A rectangle is contained if and only if all four corner are contained (see contains_point).

Enlarges this bounding rectangle to contain a point.

If the point is already contained, nothing will be changed. Otherwise, this will enlarge self to be just large enough to contain the new point.

Enlarges this bounding rectangle to contain a rectangle.

If the rectangle is already contained, nothing will be changed. Otherwise, this will enlarge self to be just large enough to contain the new rectangle.

Returns the rectangle's area.

Returns half of the rectangle's margin, thus width + height.

Returns the rectangle's center.

Returns the intersection of this and another bounding rectangle.

If the rectangles do not intersect, a bounding rectangle with an area and margin of zero is returned.

Returns true if this and another bounding rectangle intersect each other. If the rectangles just "touch" each other at one side, true is returned.

Trait Implementations

impl<V: Clone + PointN> Clone for BoundingRect<V>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<V: PartialEq + PointN> PartialEq for BoundingRect<V>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<V: Debug + PointN> Debug for BoundingRect<V>
[src]

Formats the value using the given formatter. Read more

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

The object's point type.

Returns the object's minimal bounding rectangle. Read more

Returns the squared euclidean distance from the object's contour. Returns a value samller than zero if the point is contained within the object. Read more

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

Auto Trait Implementations

impl<V> Send for BoundingRect<V> where
    V: Send

impl<V> Sync for BoundingRect<V> where
    V: Sync