pub struct ElementQuad {
pub top_left: Point,
pub top_right: Point,
pub bottom_right: Point,
pub bottom_left: Point,
}
Fields§
§top_left: Point
§top_right: Point
§bottom_right: Point
§bottom_left: Point
Implementations§
Source§impl ElementQuad
impl ElementQuad
pub fn from_quad(quad: &Quad) -> Self
pub fn quad_center(&self) -> Point
Sourcepub fn quad_area(&self) -> f64
pub fn quad_area(&self) -> f64
Compute sum of all directed areas of adjacent triangles https://en.wikipedia.org/wiki/Polygon#Simple_polygons
pub fn height(&self) -> f64
pub fn width(&self) -> f64
Sourcepub fn aspect_ratio(&self) -> f64
pub fn aspect_ratio(&self) -> f64
The width divided by the height
Sourcepub fn most_right(&self) -> f64
pub fn most_right(&self) -> f64
The most right (largest) x-coordinate
Sourcepub fn most_bottom(&self) -> f64
pub fn most_bottom(&self) -> f64
The most bottom (largest) y-coordinate
Sourcepub fn strictly_above(&self, other: &Self) -> bool
pub fn strictly_above(&self, other: &Self) -> bool
If the most bottom point of self
is above the most top point of
other
Sourcepub fn above(&self, other: &Self) -> bool
pub fn above(&self, other: &Self) -> bool
If the most bottom point of self
is above or on the same line as the
most top point of other
Sourcepub fn strictly_below(&self, other: &Self) -> bool
pub fn strictly_below(&self, other: &Self) -> bool
If the most top point of self
is below the most bottom point of
other
Sourcepub fn below(&self, other: &Self) -> bool
pub fn below(&self, other: &Self) -> bool
If the most top point of self
is below or on the same line as the
most bottom point of other
Sourcepub fn strictly_left_of(&self, other: &Self) -> bool
pub fn strictly_left_of(&self, other: &Self) -> bool
If the most right point of self
is left of the most left point of
other
Sourcepub fn left_of(&self, other: &Self) -> bool
pub fn left_of(&self, other: &Self) -> bool
If the most right point of self
is left or on the same line as the
most left point of other
Sourcepub fn strictly_right_of(&self, other: &Self) -> bool
pub fn strictly_right_of(&self, other: &Self) -> bool
If the most left point of self
is right of the most right point of
other
Sourcepub fn right_of(&self, other: &Self) -> bool
pub fn right_of(&self, other: &Self) -> bool
If the most left point of self
is right or on the same line as the
most right point of other
Sourcepub fn within_horizontal_bounds_of(&self, other: &Self) -> bool
pub fn within_horizontal_bounds_of(&self, other: &Self) -> bool
If self
is within the left/right boundaries defined by other
.
Sourcepub fn within_vertical_bounds_of(&self, other: &Self) -> bool
pub fn within_vertical_bounds_of(&self, other: &Self) -> bool
If self
is within the top/bottom boundaries defined by other
.
Sourcepub fn within_bounds_of(&self, other: &Self) -> bool
pub fn within_bounds_of(&self, other: &Self) -> bool
If self
is within the boundaries defined by other
.
Trait Implementations§
Source§impl Clone for ElementQuad
impl Clone for ElementQuad
Source§fn clone(&self) -> ElementQuad
fn clone(&self) -> ElementQuad
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ElementQuad
impl Debug for ElementQuad
impl Copy for ElementQuad
Auto Trait Implementations§
impl Freeze for ElementQuad
impl RefUnwindSafe for ElementQuad
impl Send for ElementQuad
impl Sync for ElementQuad
impl Unpin for ElementQuad
impl UnwindSafe for ElementQuad
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more