[][src]Struct voronoice::BoundingBox

pub struct BoundingBox { /* fields omitted */ }

Defines a rectangular bounding box.

Implementations

impl BoundingBox[src]

pub fn new(origin: Point, width: f64, height: f64) -> Self[src]

Constructs a new bounding box.

Arguments

  • origin - The position of the center of the bounding box
  • width - The bounding box's width
  • height - The bounding box's height

pub fn new_centered(width: f64, height: f64) -> Self[src]

Constructs a new bounding box centeterd at origin with the provided width and height.

pub fn new_centered_square(width: f64) -> Self[src]

Constructs a new square bounding box centeterd at origin with the provided width.

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

Gets the position of the box's center.

pub fn top_right(&self) -> &Point[src]

Gets the position of the top right corner of the bounding box.

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

Getst the width of the bounding box.

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

Getst the height of the bounding box.

pub fn is_inside(&self, point: &Point) -> bool[src]

Returns whether a given point is inside (or on the edges) of the bounding box.

Trait Implementations

impl Clone for BoundingBox[src]

impl Debug for BoundingBox[src]

impl Default for BoundingBox[src]

Auto Trait Implementations

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> From<T> for T[src]

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

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.