Struct voronoice::BoundingBox
source · [−]pub struct BoundingBox { /* private fields */ }
Expand description
Defines a rectangular bounding box.
The Y axis convention is downwards.
Implementations
sourceimpl BoundingBox
impl BoundingBox
sourcepub fn new(center: Point, width: f64, height: f64) -> Self
pub fn new(center: Point, width: f64, height: f64) -> Self
Constructs a new bounding box.
Arguments
center
- The position of the center of the bounding boxwidth
- The bounding box’s widthheight
- The bounding box’s height
sourcepub fn new_centered(width: f64, height: f64) -> Self
pub fn new_centered(width: f64, height: f64) -> Self
Constructs a new bounding box centeterd at origin with the provided width and height.
sourcepub fn new_centered_square(width: f64) -> Self
pub fn new_centered_square(width: f64) -> Self
Constructs a new square bounding box centeterd at origin with the provided width.
sourcepub fn top_right(&self) -> &Point
pub fn top_right(&self) -> &Point
Gets the position of the top right corner of the bounding box.
sourcepub fn bottom_left(&self) -> &Point
pub fn bottom_left(&self) -> &Point
Gets the position of the bottom left corner of the bounding box.
sourcepub fn is_inside(&self, point: &Point) -> bool
pub fn is_inside(&self, point: &Point) -> bool
Returns whether a given point is inside (or on the edges) of the bounding box.
pub fn is_exclusively_inside(&self, point: &Point) -> bool
Trait Implementations
sourceimpl Clone for BoundingBox
impl Clone for BoundingBox
sourcefn clone(&self) -> BoundingBox
fn clone(&self) -> BoundingBox
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for BoundingBox
impl Debug for BoundingBox
Auto Trait Implementations
impl RefUnwindSafe for BoundingBox
impl Send for BoundingBox
impl Sync for BoundingBox
impl Unpin for BoundingBox
impl UnwindSafe for BoundingBox
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more