BoundingBox

Struct BoundingBox 

Source
pub struct BoundingBox { /* private fields */ }
Expand description

Bounding box of a Zerometry.

The bounding box is a rectangle that contains the Zerometry. It is represented by two coordinates: the bottom-left and top-right corners.

The coordinates are stored in a Coords struct, which is a slice of f64 values. The first coordinate is the bottom-left corner, and the second coordinate is the top-right corner.

Implementations§

Source§

impl BoundingBox

Source

pub fn from_bytes(data: &[u8]) -> &Self

Source

pub fn from_slice(data: &[f64]) -> &Self

Source

pub fn from_slice_mut(data: &mut [f64]) -> &mut Self

Source

pub fn from_coords(coords: &Coords) -> &Self

Source

pub fn from_coords_mut(coords: &mut Coords) -> &mut Self

Source

pub fn write_from_geometry( writer: &mut impl Write, points: impl Iterator<Item = Point<f64>>, ) -> Result<(), Error>

Source

pub fn coords(&self) -> &Coords

Source

pub fn bottom_left(&self) -> &Coord

Source

pub fn top_right(&self) -> &Coord

Source

pub fn bottom(&self) -> f64

Source

pub fn top(&self) -> f64

Source

pub fn left(&self) -> f64

Source

pub fn right(&self) -> f64

Source

pub fn horizontal_range(&self) -> RangeInclusive<f64>

Source

pub fn vertical_range(&self) -> RangeInclusive<f64>

Source

pub fn contains_coord(&self, coord: &Coord) -> bool

Source

pub fn to_geo(&self) -> Rect<f64>

Trait Implementations§

Source§

impl Debug for BoundingBox

Source§

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

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

impl RelationBetweenShapes<BoundingBox> for BoundingBox

Source§

fn relation( &self, other: &BoundingBox, relation: InputRelation, ) -> OutputRelation

Source§

fn all_relation(&self, other: &Other) -> OutputRelation

Source§

fn any_relation(&self, other: &Other) -> OutputRelation

Source§

fn contains(&self, other: &Other) -> bool

Source§

fn strict_contains(&self, other: &Other) -> bool

Source§

fn contained(&self, other: &Other) -> bool

Source§

fn strict_contained(&self, other: &Other) -> bool

Source§

fn intersects(&self, other: &Other) -> bool

Source§

fn disjoint(&self, other: &Other) -> bool

Source§

impl RelationBetweenShapes<Coord> for BoundingBox

Source§

fn relation(&self, other: &Coord, relation: InputRelation) -> OutputRelation

Source§

fn all_relation(&self, other: &Other) -> OutputRelation

Source§

fn any_relation(&self, other: &Other) -> OutputRelation

Source§

fn contains(&self, other: &Other) -> bool

Source§

fn strict_contains(&self, other: &Other) -> bool

Source§

fn contained(&self, other: &Other) -> bool

Source§

fn strict_contained(&self, other: &Other) -> bool

Source§

fn intersects(&self, other: &Other) -> bool

Source§

fn disjoint(&self, other: &Other) -> bool

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more