Struct geom::bounds::Bounds [−][src]
Represents a rectangular boundary of Pt2D
points.
Fields
min_x: f64
min_y: f64
max_x: f64
max_y: f64
Implementations
impl Bounds
[src]
impl Bounds
[src]pub fn new() -> Bounds
[src]
A boundary including no points.
pub fn zero() -> Self
[src]
pub fn from(pts: &[Pt2D]) -> Bounds
[src]
Create a boundary covering some points.
pub fn update(&mut self, pt: Pt2D)
[src]
Update the boundary to include this point.
pub fn union(&mut self, other: Bounds)
[src]
Unions two boundaries.
pub fn add_buffer(&mut self, sides: Distance)
[src]
Expand the existing boundary by some distance evenly on all sides.
pub fn contains(&self, pt: Pt2D) -> bool
[src]
True if the point is within the boundary.
pub fn as_bbox(&self) -> Rect
[src]
Converts the boundary to the format used by aabb_quadtree
.
pub fn get_rectangle(&self) -> Polygon
[src]
Creates a rectangle covering this boundary.
pub fn width(&self) -> f64
[src]
The width of this boundary.
pub fn height(&self) -> f64
[src]
The height of this boundary.
pub fn center(&self) -> Pt2D
[src]
The center point of this boundary.
Trait Implementations
impl<'de> Deserialize<'de> for Bounds
[src]
impl<'de> Deserialize<'de> for Bounds
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,