[][src]Struct geom::Bounds

pub struct Bounds {
    pub min_x: f64,
    pub min_y: f64,
    pub max_x: f64,
    pub max_y: f64,
}

Represents a rectangular boundary of Pt2D points.

Fields

min_x: f64min_y: f64max_x: f64max_y: f64

Implementations

impl Bounds[src]

pub fn new() -> Bounds[src]

A boundary including no points.

pub fn from(pts: &Vec<Pt2D>) -> Bounds[src]

Create a boundary covering some points.

pub fn update(&mut self, pt: Pt2D)[src]

Update the boundary to include this point.

pub fn union(&mut self, other: Bounds)[src]

Unions two boundaries.

pub fn contains(&self, pt: Pt2D) -> bool[src]

True if the point is within the boundary.

pub fn as_bbox(&self) -> Rect[src]

Converts the boundary to the format used by aabb_quadtree.

pub fn get_rectangle(&self) -> Polygon[src]

Creates a rectangle covering this boundary.

pub fn width(&self) -> f64[src]

The width of this boundary.

pub fn height(&self) -> f64[src]

The height of this boundary.

pub fn center(&self) -> Pt2D[src]

The center point of this boundary.

Trait Implementations

impl Clone for Bounds[src]

impl Debug for Bounds[src]

impl<'de> Deserialize<'de> for Bounds[src]

impl Serialize for Bounds[src]

Auto Trait Implementations

impl RefUnwindSafe for Bounds

impl Send for Bounds

impl Sync for Bounds

impl Unpin for Bounds

impl UnwindSafe for Bounds

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.