[][src]Struct arcs::BoundingBox

pub struct BoundingBox<S> { /* fields omitted */ }

An axis-aligned bounding box.

Implementations

impl<S> BoundingBox<S>[src]

pub fn new(first: Point2D<f64, S>, second: Point2D<f64, S>) -> BoundingBox<S>[src]

Create a new BoundingBox around two points.

pub fn new_unchecked(
    bottom_left: Point2D<f64, S>,
    top_right: Point2D<f64, S>
) -> BoundingBox<S>
[src]

Create a new BoundingBox without ensuring the bottom-left and top-right corners are actually in the bottom-left and top-right.

pub fn from_centre_and_size(
    centre: Point2D<f64, S>,
    size: Size2D<f64, S>
) -> BoundingBox<S>
[src]

Create a BoundingBox based on it's centre and dimensions (as an euclid::Size2D).

pub fn from_centre_and_dimensions(
    centre: Point2D<f64, S>,
    width: Length<f64, S>,
    height: Length<f64, S>
) -> BoundingBox<S>
[src]

Create a BoundingBox based on it's centre and dimensions.

pub fn width(self) -> Length<f64, S>[src]

How wide is the BoundingBox in the X direction.

pub fn height(self) -> Length<f64, S>[src]

How high is the BoundingBox in the Y direction.

pub fn area(self) -> f64[src]

Calculate the box's area.

pub fn diagonal(self) -> Vector2D<f64, S>[src]

A vector from the bottom-left corner to the top-right corner.

pub fn merge(left: BoundingBox<S>, right: BoundingBox<S>) -> BoundingBox<S>[src]

Merge two BoundingBoxes.

pub fn around<I, B>(items: I) -> Option<BoundingBox<S>> where
    B: Bounded<S>,
    I: IntoIterator<Item = B>, 
[src]

Create a BoundingBox which fully encompasses a set of [Bounded] items.

pub fn bottom_left(self) -> Point2D<f64, S>[src]

The bottom-left corner.

pub fn bottom_right(self) -> Point2D<f64, S>[src]

The bottom-right corner.

pub fn top_right(self) -> Point2D<f64, S>[src]

The top-right corner.

pub fn top_left(self) -> Point2D<f64, S>[src]

The top-left corner.

pub fn min_x(self) -> f64[src]

The minimum X value.

pub fn min_y(self) -> f64[src]

The minimum Y value.

pub fn max_x(self) -> f64[src]

The maximum X value.

pub fn max_y(self) -> f64[src]

The maximum Y value.

pub fn fully_contains(self, other: BoundingBox<S>) -> bool[src]

Does this BoundingBox fully contain another?

pub fn intersects_with(&self, other: BoundingBox<S>) -> bool[src]

Do these two BoundingBoxes overlap?

Trait Implementations

impl<S> Bounded<S> for BoundingBox<S>[src]

impl<Space> Clone for BoundingBox<Space>[src]

impl<S> Component for BoundingBox<S> where
    S: 'static, 
[src]

type Storage = FlaggedStorage<BoundingBox<S>, DenseVecStorage<BoundingBox<S>>>

Associated storage type for this component.

impl<Space> Copy for BoundingBox<Space>[src]

impl<S> Debug for BoundingBox<S> where
    S: Debug
[src]

impl<S> PartialEq<BoundingBox<S>> for BoundingBox<S> where
    S: PartialEq<S>, 
[src]

impl<Space> ScaleNonUniform for BoundingBox<Space>[src]

impl<S> Send for BoundingBox<S>[src]

impl<S> StructuralPartialEq for BoundingBox<S>[src]

impl<S> Sync for BoundingBox<S>[src]

impl<Space> Translate<Space> for BoundingBox<Space>[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for BoundingBox<S> where
    S: RefUnwindSafe

impl<S> Unpin for BoundingBox<S> where
    S: Unpin

impl<S> UnwindSafe for BoundingBox<S> where
    S: UnwindSafe

Blanket Implementations

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

impl<T> Any for T where
    T: Any
[src]

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

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

impl<T> Event for T where
    T: Send + Sync + 'static, 
[src]

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

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

impl<T> Resource for T where
    T: Any + Send + Sync
[src]

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

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 
[src]

impl<S> Scale for S where
    S: ScaleNonUniform
[src]

impl<A> ScaleNonUniform for A where
    A: AffineTransformable
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<Space, A> Translate<Space> for A where
    A: AffineTransformable
[src]

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.