pub struct BBox<T = f64> {
pub left: T,
pub bottom: T,
pub right: T,
pub top: T,
}
Expand description
A BBOX is defined in lon-lat space and helps with zooming motion to see the entire line or polygon The order is (left, bottom, right, top) If WM, then the projection is lon-lat If S2, then the projection is s-t
Fields§
§left: T
left most longitude (WM) or S (S2)
bottom: T
bottom most latitude (WM) or T (S2)
right: T
right most longitude (WM) or T (S2)
top: T
top most latitude (WM) or S (S2)
Implementations§
Source§impl<T> BBox<T>
impl<T> BBox<T>
Sourcepub fn point_overlap(&self, point: VectorPoint) -> bool
pub fn point_overlap(&self, point: VectorPoint) -> bool
Checks if a point is within the BBox
Sourcepub fn merge(&self, other: &BBox<T>) -> BBox<T>where
T: PartialOrd + Copy,
pub fn merge(&self, other: &BBox<T>) -> BBox<T>where
T: PartialOrd + Copy,
Merges another bounding box with this one
Source§impl BBox<f64>
impl BBox<f64>
Sourcepub fn from_point(point: &VectorPoint) -> Self
pub fn from_point(point: &VectorPoint) -> Self
Creates a new BBox from a point
Sourcepub fn extend_from_point(&mut self, point: &VectorPoint)
pub fn extend_from_point(&mut self, point: &VectorPoint)
Extends the bounding box with a point
Sourcepub fn from_uv_zoom(u: f64, v: f64, zoom: u8) -> Self
pub fn from_uv_zoom(u: f64, v: f64, zoom: u8) -> Self
Creates a new BBox from zoom-uv coordinates
Sourcepub fn from_st_zoom(s: f64, t: f64, zoom: u8) -> Self
pub fn from_st_zoom(s: f64, t: f64, zoom: u8) -> Self
Creates a new BBox from zoom-st coordinates
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for BBox<T>where
T: Deserialize<'de> + Copy,
impl<'de, T> Deserialize<'de> for BBox<T>where
T: Deserialize<'de> + Copy,
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<T: PartialOrd> PartialOrd for BBox<T>
impl<T: PartialOrd> PartialOrd for BBox<T>
impl<T: Copy> Copy for BBox<T>
impl<T> StructuralPartialEq for BBox<T>
Auto Trait Implementations§
impl<T> Freeze for BBox<T>where
T: Freeze,
impl<T> RefUnwindSafe for BBox<T>where
T: RefUnwindSafe,
impl<T> Send for BBox<T>where
T: Send,
impl<T> Sync for BBox<T>where
T: Sync,
impl<T> Unpin for BBox<T>where
T: Unpin,
impl<T> UnwindSafe for BBox<T>where
T: UnwindSafe,
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