pub struct MultiPolygon<T> {
pub polygons: Vec<Polygon<T>>,
}
Expand description
A MultiPolygon
is a list of polygons. There is no restrictions on the polygons (they can be
intersecting, empty, etc.).
Fields§
§polygons: Vec<Polygon<T>>
The list of polygons which defines the content of this multi polygon.
Implementations§
Source§impl<T> MultiPolygon<T>
impl<T> MultiPolygon<T>
Sourcepub fn new() -> MultiPolygon<T>
pub fn new() -> MultiPolygon<T>
Create an empty set of polygons.
Sourcepub fn from_polygons(polygons: Vec<Polygon<T>>) -> MultiPolygon<T>
pub fn from_polygons(polygons: Vec<Polygon<T>>) -> MultiPolygon<T>
Create a MultiPolygon
from a vector of Polygon
s.
Source§impl<T> MultiPolygon<T>where
T: Copy,
impl<T> MultiPolygon<T>where
T: Copy,
Sourcepub fn all_edges_iter(&self) -> impl Iterator<Item = Edge<T>>
pub fn all_edges_iter(&self) -> impl Iterator<Item = Edge<T>>
Iterate over all edges of the polygons including holes.
Trait Implementations§
Source§impl BooleanOp<Ratio<i32>> for MultiPolygon<Ratio<i32>>
impl BooleanOp<Ratio<i32>> for MultiPolygon<Ratio<i32>>
Source§fn boolean_op(
&self,
operation: Operation,
other: &MultiPolygon<Ratio<i32>>,
polygon_semantics: PolygonSemantics,
) -> MultiPolygon<Ratio<i32>>
fn boolean_op( &self, operation: Operation, other: &MultiPolygon<Ratio<i32>>, polygon_semantics: PolygonSemantics, ) -> MultiPolygon<Ratio<i32>>
Source§fn intersection(&self, other: &Self) -> MultiPolygon<T>
fn intersection(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean intersection
self & other
. Read moreSource§fn difference(&self, other: &Self) -> MultiPolygon<T>
fn difference(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean difference
self - other
. Read moreSource§fn union(&self, other: &Self) -> MultiPolygon<T>
fn union(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean union
self | other
. Read moreSource§fn xor(&self, other: &Self) -> MultiPolygon<T>
fn xor(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean exclusive OR
self ^ other
. Read moreSource§impl BooleanOp<Ratio<i64>> for MultiPolygon<Ratio<i64>>
impl BooleanOp<Ratio<i64>> for MultiPolygon<Ratio<i64>>
Source§fn boolean_op(
&self,
operation: Operation,
other: &MultiPolygon<Ratio<i64>>,
polygon_semantics: PolygonSemantics,
) -> MultiPolygon<Ratio<i64>>
fn boolean_op( &self, operation: Operation, other: &MultiPolygon<Ratio<i64>>, polygon_semantics: PolygonSemantics, ) -> MultiPolygon<Ratio<i64>>
Source§fn intersection(&self, other: &Self) -> MultiPolygon<T>
fn intersection(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean intersection
self & other
. Read moreSource§fn difference(&self, other: &Self) -> MultiPolygon<T>
fn difference(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean difference
self - other
. Read moreSource§fn union(&self, other: &Self) -> MultiPolygon<T>
fn union(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean union
self | other
. Read moreSource§fn xor(&self, other: &Self) -> MultiPolygon<T>
fn xor(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean exclusive OR
self ^ other
. Read moreSource§impl BooleanOp<f32> for MultiPolygon<f32>
impl BooleanOp<f32> for MultiPolygon<f32>
Source§fn boolean_op(
&self,
operation: Operation,
other: &MultiPolygon<f32>,
polygon_semantics: PolygonSemantics,
) -> MultiPolygon<f32>
fn boolean_op( &self, operation: Operation, other: &MultiPolygon<f32>, polygon_semantics: PolygonSemantics, ) -> MultiPolygon<f32>
Source§fn intersection(&self, other: &Self) -> MultiPolygon<T>
fn intersection(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean intersection
self & other
. Read moreSource§fn difference(&self, other: &Self) -> MultiPolygon<T>
fn difference(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean difference
self - other
. Read moreSource§fn union(&self, other: &Self) -> MultiPolygon<T>
fn union(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean union
self | other
. Read moreSource§fn xor(&self, other: &Self) -> MultiPolygon<T>
fn xor(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean exclusive OR
self ^ other
. Read moreSource§impl BooleanOp<f64> for MultiPolygon<f64>
impl BooleanOp<f64> for MultiPolygon<f64>
Source§fn boolean_op(
&self,
operation: Operation,
other: &MultiPolygon<f64>,
polygon_semantics: PolygonSemantics,
) -> MultiPolygon<f64>
fn boolean_op( &self, operation: Operation, other: &MultiPolygon<f64>, polygon_semantics: PolygonSemantics, ) -> MultiPolygon<f64>
Source§fn intersection(&self, other: &Self) -> MultiPolygon<T>
fn intersection(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean intersection
self & other
. Read moreSource§fn difference(&self, other: &Self) -> MultiPolygon<T>
fn difference(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean difference
self - other
. Read moreSource§fn union(&self, other: &Self) -> MultiPolygon<T>
fn union(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean union
self | other
. Read moreSource§fn xor(&self, other: &Self) -> MultiPolygon<T>
fn xor(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean exclusive OR
self ^ other
. Read moreSource§impl BooleanOp<i32> for MultiPolygon<i32>
impl BooleanOp<i32> for MultiPolygon<i32>
Source§fn boolean_op(
&self,
operation: Operation,
other: &MultiPolygon<i32>,
polygon_semantics: PolygonSemantics,
) -> MultiPolygon<i32>
fn boolean_op( &self, operation: Operation, other: &MultiPolygon<i32>, polygon_semantics: PolygonSemantics, ) -> MultiPolygon<i32>
Source§fn intersection(&self, other: &Self) -> MultiPolygon<T>
fn intersection(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean intersection
self & other
. Read moreSource§fn difference(&self, other: &Self) -> MultiPolygon<T>
fn difference(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean difference
self - other
. Read moreSource§fn union(&self, other: &Self) -> MultiPolygon<T>
fn union(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean union
self | other
. Read moreSource§fn xor(&self, other: &Self) -> MultiPolygon<T>
fn xor(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean exclusive OR
self ^ other
. Read moreSource§impl BooleanOp<i64> for MultiPolygon<i64>
impl BooleanOp<i64> for MultiPolygon<i64>
Source§fn boolean_op(
&self,
operation: Operation,
other: &MultiPolygon<i64>,
polygon_semantics: PolygonSemantics,
) -> MultiPolygon<i64>
fn boolean_op( &self, operation: Operation, other: &MultiPolygon<i64>, polygon_semantics: PolygonSemantics, ) -> MultiPolygon<i64>
Source§fn intersection(&self, other: &Self) -> MultiPolygon<T>
fn intersection(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean intersection
self & other
. Read moreSource§fn difference(&self, other: &Self) -> MultiPolygon<T>
fn difference(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean difference
self - other
. Read moreSource§fn union(&self, other: &Self) -> MultiPolygon<T>
fn union(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean union
self | other
. Read moreSource§fn xor(&self, other: &Self) -> MultiPolygon<T>
fn xor(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean exclusive OR
self ^ other
. Read moreSource§impl<T> Clone for MultiPolygon<T>where
T: Clone,
impl<T> Clone for MultiPolygon<T>where
T: Clone,
Source§fn clone(&self) -> MultiPolygon<T>
fn clone(&self) -> MultiPolygon<T>
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<T> Debug for MultiPolygon<T>where
T: Debug,
impl<T> Debug for MultiPolygon<T>where
T: Debug,
Source§impl<T> Default for MultiPolygon<T>where
T: Default,
impl<T> Default for MultiPolygon<T>where
T: Default,
Source§fn default() -> MultiPolygon<T>
fn default() -> MultiPolygon<T>
Returns the “default value” for a type. Read more
Source§impl<'de, T> Deserialize<'de> for MultiPolygon<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for MultiPolygon<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MultiPolygon<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MultiPolygon<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T, IP> From<IP> for MultiPolygon<T>
impl<T, IP> From<IP> for MultiPolygon<T>
Source§fn from(x: IP) -> MultiPolygon<T>
fn from(x: IP) -> MultiPolygon<T>
Converts to this type from the input type.
Source§impl<T, IP> FromIterator<IP> for MultiPolygon<T>
impl<T, IP> FromIterator<IP> for MultiPolygon<T>
Source§fn from_iter<I>(iter: I) -> MultiPolygon<T>where
I: IntoIterator<Item = IP>,
fn from_iter<I>(iter: I) -> MultiPolygon<T>where
I: IntoIterator<Item = IP>,
Creates a value from an iterator. Read more
Source§impl<T> Hash for MultiPolygon<T>where
T: Hash,
impl<T> Hash for MultiPolygon<T>where
T: Hash,
Source§impl<T> IntoIterator for MultiPolygon<T>
impl<T> IntoIterator for MultiPolygon<T>
Source§impl<T> MapPointwise<T> for MultiPolygon<T>where
T: CoordinateType,
impl<T> MapPointwise<T> for MultiPolygon<T>where
T: CoordinateType,
Source§impl<T> Serialize for MultiPolygon<T>where
T: Serialize,
impl<T> Serialize for MultiPolygon<T>where
T: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<T> TryBoundingBox<T> for MultiPolygon<T>where
T: CoordinateType,
impl<T> TryBoundingBox<T> for MultiPolygon<T>where
T: CoordinateType,
Source§fn try_bounding_box(&self) -> Option<Rect<T>>
fn try_bounding_box(&self) -> Option<Rect<T>>
Return the bounding box of this geometry if a bounding box is defined.
Source§impl<T> WindingNumber<T> for MultiPolygon<T>where
T: CoordinateType,
impl<T> WindingNumber<T> for MultiPolygon<T>where
T: CoordinateType,
Source§fn winding_number(&self, point: Point<T>) -> isize
fn winding_number(&self, point: Point<T>) -> isize
Calculate the winding number of the polygon around this point. Read more
Auto Trait Implementations§
impl<T> Freeze for MultiPolygon<T>
impl<T> RefUnwindSafe for MultiPolygon<T>where
T: RefUnwindSafe,
impl<T> Send for MultiPolygon<T>where
T: Send,
impl<T> Sync for MultiPolygon<T>where
T: Sync,
impl<T> Unpin for MultiPolygon<T>where
T: Unpin,
impl<T> UnwindSafe for MultiPolygon<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
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 moreSource§impl<S, T> RotateOrtho<T> for S
impl<S, T> RotateOrtho<T> for S
Source§fn rotate_ortho(&self, a: Angle) -> S
fn rotate_ortho(&self, a: Angle) -> S
Rotate the geometrical shape by a multiple of 90 degrees.