pub struct BoundingBox {
pub x_min: f64,
pub y_min: f64,
pub x_max: f64,
pub y_max: f64,
pub width: f64,
pub height: f64,
}Fields§
§x_min: f64§y_min: f64§x_max: f64§y_max: f64§width: f64§height: f64Implementations§
Source§impl BoundingBox
impl BoundingBox
pub fn new(x_min: f64, y_min: f64, x_max: f64, y_max: f64) -> BoundingBox
pub fn merge(&self, bounding_box: &BoundingBox) -> BoundingBox
pub fn contains(&self, x: f64, y: f64) -> bool
pub fn intersects(&self, bounding_box: &BoundingBox) -> bool
pub fn get_intersection( &self, bounding_box: &BoundingBox, ) -> Option<BoundingBox>
pub fn area(&self) -> f64
Trait Implementations§
Source§impl Clone for BoundingBox
impl Clone for BoundingBox
Source§fn clone(&self) -> BoundingBox
fn clone(&self) -> BoundingBox
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BoundingBox
impl Debug for BoundingBox
Source§impl<'de> Deserialize<'de> for BoundingBox
impl<'de> Deserialize<'de> for BoundingBox
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for BoundingBox
impl Display for BoundingBox
Source§impl PartialEq for BoundingBox
impl PartialEq for BoundingBox
Source§impl Serialize for BoundingBox
impl Serialize for BoundingBox
impl Eq for BoundingBox
Auto Trait Implementations§
impl Freeze for BoundingBox
impl RefUnwindSafe for BoundingBox
impl Send for BoundingBox
impl Sync for BoundingBox
impl Unpin for BoundingBox
impl UnsafeUnpin for BoundingBox
impl UnwindSafe for BoundingBox
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
Mutably borrows from an owned value. Read more