[−][src]Struct arcs::BoundingBox
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]
bottom_left: Point2D<f64, S>,
top_right: Point2D<f64, S>
) -> BoundingBox<S>
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]
centre: Point2D<f64, S>,
size: Size2D<f64, S>
) -> BoundingBox<S>
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]
centre: Point2D<f64, S>,
width: Length<f64, S>,
height: Length<f64, S>
) -> BoundingBox<S>
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 BoundingBox
es.
pub fn around<I, B>(items: I) -> Option<BoundingBox<S>> where
B: Bounded<S>,
I: IntoIterator<Item = B>,
[src]
B: Bounded<S>,
I: IntoIterator<Item = B>,
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 BoundingBox
es overlap?
Trait Implementations
impl<S> Bounded<S> for BoundingBox<S>
[src]
fn bounding_box(&self) -> BoundingBox<S>
[src]
impl<Space> Clone for BoundingBox<Space>
[src]
fn clone(&self) -> BoundingBox<Space>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<S> Component for BoundingBox<S> where
S: 'static,
[src]
S: 'static,
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]
S: Debug,
impl<S> PartialEq<BoundingBox<S>> for BoundingBox<S> where
S: PartialEq<S>,
[src]
S: PartialEq<S>,
fn eq(&self, other: &BoundingBox<S>) -> bool
[src]
fn ne(&self, other: &BoundingBox<S>) -> bool
[src]
impl<Space> ScaleNonUniform for BoundingBox<Space>
[src]
fn scale_non_uniform(&mut self, factor_x: f64, factor_y: f64)
[src]
fn scaled_non_uniform(&self, factor_x: f64, factor_y: f64) -> Self where
Self: Clone,
[src]
Self: Clone,
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,
S: RefUnwindSafe,
impl<S> Unpin for BoundingBox<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for BoundingBox<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
[src]
T: Any,
fn get_type_id(&self) -> TypeId
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Event for T where
T: Send + Sync + 'static,
[src]
T: Send + Sync + 'static,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Resource for T where
T: Any + Send + Sync,
[src]
T: Any + Send + Sync,
impl<T> RoundFrom<T> for T
[src]
fn round_from(x: T) -> T
[src]
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
[src]
U: RoundFrom<T>,
fn round_into(self) -> U
[src]
impl<S> Scale for S where
S: ScaleNonUniform,
[src]
S: ScaleNonUniform,
fn scale(&mut self, scale_factor: f64)
[src]
fn scaled(&self, scale_factor: f64) -> Self where
Self: Clone,
[src]
Self: Clone,
impl<A> ScaleNonUniform for A where
A: AffineTransformable,
[src]
A: AffineTransformable,
fn scale_non_uniform(&mut self, factor_x: f64, factor_y: f64)
[src]
fn scaled_non_uniform(&self, factor_x: f64, factor_y: f64) -> Self where
Self: Clone,
[src]
Self: Clone,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<Space, A> Translate<Space> for A where
A: AffineTransformable,
[src]
A: AffineTransformable,
fn translate(&mut self, displacement: Vector2D<f64, Space>)
[src]
fn translated(&self, displacement: Vector2D<f64, Space>) -> Self where
Self: Clone,
[src]
Self: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,