pub struct AxisAlignedRectangle<T>where
    T: Copy + Num + NumAssignOps + NumOps,{
    pub point: Point<T>,
    pub rectangle: Rectangle<T>,
}
Expand description

axis aligned starting at x, y and ending at x + width, y + height (left to right, top to bottom)

Fields§

§point: Point<T>§rectangle: Rectangle<T>

Implementations§

source§

impl<T> AxisAlignedRectangle<T>where T: Copy + Num + NumAssignOps + NumOps + PartialOrd + Float,

source

pub fn round(&self) -> Self

source§

impl<T> AxisAlignedRectangle<T>where T: Copy + Num + NumAssignOps + NumOps,

source

pub fn new(point: &Point<T>, rectangle: &Rectangle<T>) -> Self

A rectangle in 2D space constructor

source

pub fn rect(&self) -> Rectangle<T>

source

pub fn origin(&self) -> Point<T>

source§

impl<T> AxisAlignedRectangle<T>where T: Copy + Num + NumAssignOps + NumOps + Float,

source

pub fn from_two_point(p1: &Point<T>, p2: &Point<T>) -> Self

Trait Implementations§

source§

impl<T> Clone for AxisAlignedRectangle<T>where T: Copy + Num + NumAssignOps + NumOps + Clone,

source§

fn clone(&self) -> AxisAlignedRectangle<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Debug for AxisAlignedRectangle<T>where T: Copy + Num + NumAssignOps + NumOps + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> PartialEq for AxisAlignedRectangle<T>where T: Copy + Num + NumAssignOps + NumOps + PartialEq,

source§

fn eq(&self, other: &AxisAlignedRectangle<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> RectangleSize<T> for AxisAlignedRectangle<T>where T: Copy + Num + NumAssignOps + NumOps,

A rectangle in 2D space with a width and height

source§

fn width(&self) -> T

source§

fn height(&self) -> T

source§

impl<T> SizeForAxis<T> for AxisAlignedRectangle<T>where T: Copy + Num + NumAssignOps,

source§

fn size_for_axis(&self, axis: Axis) -> T

source§

impl<T> StructuralPartialEq for AxisAlignedRectangle<T>where T: Copy + Num + NumAssignOps + NumOps,

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for AxisAlignedRectangle<T>where T: RefUnwindSafe,

§

impl<T> Send for AxisAlignedRectangle<T>where T: Send,

§

impl<T> Sync for AxisAlignedRectangle<T>where T: Sync,

§

impl<T> Unpin for AxisAlignedRectangle<T>where T: Unpin,

§

impl<T> UnwindSafe for AxisAlignedRectangle<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> Dividing<T> for Uwhere U: QuarterRotation + VerticalDividingHelper<T>, T: Copy,

source§

fn divide_vertical(&self, x: T) -> (U, U)

dividing a rectangle into two rectangles (vertical)
source§

fn divide_horizontal(&self, y: T) -> (U, U)

dividing a rectangle into two rectangles (horizontal)
source§

fn divide(&self, v: T, axis: Axis) -> (Self, Self)where Self: Sized,

dividing a rectangle into two rectangles specified by axis
source§

fn divide_by_values_and_axis(&self, values: &Vec<T>, axis: Axis) -> Vec<Self>where Self: Sized + RectangleSize<T> + Clone, T: Copy + Num + NumAssignOps,

dividing a rectangle into specified number of rectangles specified by axis
source§

fn divide_by_weights_and_axis(&self, weights: &Vec<T>, axis: Axis) -> Vec<Self>where Self: Sized + RectangleSize<T> + Clone + SizeForAxis<T>, T: Copy + for<'a> Sum<&'a T> + Num + NumAssignOps + NumOps,

dividing a rectangle into specified weights of rectangles specified by axis
source§

fn divide_vertical_then_horizontal_with_weights( &self, weights: &[T], aspect_ratio: T, boustrophedon: bool ) -> Vec<Self>where Self: Sized + RectangleSize<T> + Clone + SizeForAxis<T> + Area<T>, T: Copy + for<'a> Sum<&'a T> + Num + NumAssignOps + PartialOrd,

source§

fn divide_horizontal_then_vertical_with_weights( &self, weights: &[T], aspect_ratio: T, boustrophedon: bool ) -> Vec<Self>where Self: Sized + RectangleSize<T> + Clone + SizeForAxis<T> + Area<T> + QuarterRotation, T: Copy + Num + NumOps + NumAssignOps + PartialOrd + for<'a> Sum<&'a T>,

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.