pub enum Geometry2D {
LineString(LineString),
MultiLineString(MultiLineString),
Polygon(Polygon),
MultiPolygon(MultiPolygon),
Rect(Rect),
Line(Line),
Collection(Geometries2D),
}Expand description
A 2D Geometry which is independent from resolution.
Variants§
LineString(LineString)
Line string.
MultiLineString(MultiLineString)
Multiple line strings.
Polygon(Polygon)
Polygon.
MultiPolygon(MultiPolygon)
Multiple polygons.
Rect(Rect)
Rectangle.
Line(Line)
Line.
Collection(Geometries2D)
Collection,
Implementations§
Source§impl Geometry2D
impl Geometry2D
Sourcepub fn boolean_op(self, other: Self, op: &BooleanOp) -> MultiPolygon
pub fn boolean_op(self, other: Self, op: &BooleanOp) -> MultiPolygon
Apply boolean operation.
Sourcepub fn to_multi_polygon(&self) -> MultiPolygon
pub fn to_multi_polygon(&self) -> MultiPolygon
Convert geometry to a multi_polygon.
Sourcepub fn is_areal(&self) -> bool
pub fn is_areal(&self) -> bool
Returns true if this geometry fills an area (e.g. like a polygon or circle).
Sourcepub fn with_bounds(self) -> WithBounds2D<Geometry2D>
pub fn with_bounds(self) -> WithBounds2D<Geometry2D>
Return this geometry with calculated bounds.
Trait Implementations§
Source§impl CalcBounds2D for Geometry2D
impl CalcBounds2D for Geometry2D
Source§fn calc_bounds_2d(&self) -> Bounds2D
fn calc_bounds_2d(&self) -> Bounds2D
Fetch bounds.
Source§impl Clone for Geometry2D
impl Clone for Geometry2D
Source§fn clone(&self) -> Geometry2D
fn clone(&self) -> Geometry2D
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 Geometry2D
impl Debug for Geometry2D
Source§impl<'_derivative_strum> From<&'_derivative_strum Geometry2D> for &'static str
impl<'_derivative_strum> From<&'_derivative_strum Geometry2D> for &'static str
Source§fn from(x: &'_derivative_strum Geometry2D) -> &'static str
fn from(x: &'_derivative_strum Geometry2D) -> &'static str
Converts to this type from the input type.
Source§impl From<Geometry2D> for &'static str
impl From<Geometry2D> for &'static str
Source§fn from(x: Geometry2D) -> &'static str
fn from(x: Geometry2D) -> &'static str
Converts to this type from the input type.
Source§impl From<Geometry2D> for MultiPolygon
impl From<Geometry2D> for MultiPolygon
Source§fn from(geo: Geometry2D) -> Self
fn from(geo: Geometry2D) -> Self
Converts to this type from the input type.
Source§impl From<Geometry2D> for WithBounds2D<Geometry2D>
impl From<Geometry2D> for WithBounds2D<Geometry2D>
Source§fn from(geo: Geometry2D) -> Self
fn from(geo: Geometry2D) -> Self
Converts to this type from the input type.
Source§impl Transformed2D for Geometry2D
impl Transformed2D for Geometry2D
Source§fn transformed_2d(&self, mat: &Mat3) -> Self
fn transformed_2d(&self, mat: &Mat3) -> Self
Transform from matrix.
Auto Trait Implementations§
impl Freeze for Geometry2D
impl RefUnwindSafe for Geometry2D
impl !Send for Geometry2D
impl !Sync for Geometry2D
impl Unpin for Geometry2D
impl UnwindSafe for Geometry2D
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more