pub struct MultiPolygon<T> {
    pub polygons: Vec<Polygon<T>, Global>,
}
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>, Global>

The list of polygons which defines the content of this multi polygon.

Implementations§

§

impl<T> MultiPolygon<T>

pub fn new() -> MultiPolygon<T>

Create an empty set of polygons.

pub fn from_polygons(polygons: Vec<Polygon<T>, Global>) -> MultiPolygon<T>

Create a MultiPolygon from a vector of Polygons.

pub fn len(&self) -> usize

Return the number of polygons.

pub fn is_empty(&self) -> bool

Check if polygon is empty.

pub fn insert(&mut self, polygon: Polygon<T>)

Insert a polygon into the region.

§

impl<T> MultiPolygon<T>where T: Copy,

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>>

source§

fn boolean_op( &self, operation: Operation, other: &MultiPolygon<Ratio<i32>>, polygon_semantics: PolygonSemantics ) -> MultiPolygon<Ratio<i32>>

Compute the boolean operation of self and other. Read more
source§

fn intersection(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean intersection self & other. Read more
source§

fn difference(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean difference self - other. Read more
source§

fn union(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean union self | other. Read more
source§

fn xor(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean exclusive OR self ^ other. Read more
source§

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>>

Compute the boolean operation of self and other. Read more
source§

fn intersection(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean intersection self & other. Read more
source§

fn difference(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean difference self - other. Read more
source§

fn union(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean union self | other. Read more
source§

fn xor(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean exclusive OR self ^ other. Read more
source§

impl BooleanOp<f32> for MultiPolygon<f32>

source§

fn boolean_op( &self, operation: Operation, other: &MultiPolygon<f32>, polygon_semantics: PolygonSemantics ) -> MultiPolygon<f32>

Compute the boolean operation of self and other. Read more
source§

fn intersection(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean intersection self & other. Read more
source§

fn difference(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean difference self - other. Read more
source§

fn union(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean union self | other. Read more
source§

fn xor(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean exclusive OR self ^ other. Read more
source§

impl BooleanOp<f64> for MultiPolygon<f64>

source§

fn boolean_op( &self, operation: Operation, other: &MultiPolygon<f64>, polygon_semantics: PolygonSemantics ) -> MultiPolygon<f64>

Compute the boolean operation of self and other. Read more
source§

fn intersection(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean intersection self & other. Read more
source§

fn difference(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean difference self - other. Read more
source§

fn union(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean union self | other. Read more
source§

fn xor(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean exclusive OR self ^ other. Read more
source§

impl BooleanOp<i32> for MultiPolygon<i32>

source§

fn boolean_op( &self, operation: Operation, other: &MultiPolygon<i32>, polygon_semantics: PolygonSemantics ) -> MultiPolygon<i32>

Compute the boolean operation of self and other. Read more
source§

fn intersection(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean intersection self & other. Read more
source§

fn difference(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean difference self - other. Read more
source§

fn union(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean union self | other. Read more
source§

fn xor(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean exclusive OR self ^ other. Read more
source§

impl BooleanOp<i64> for MultiPolygon<i64>

source§

fn boolean_op( &self, operation: Operation, other: &MultiPolygon<i64>, polygon_semantics: PolygonSemantics ) -> MultiPolygon<i64>

Compute the boolean operation of self and other. Read more
source§

fn intersection(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean intersection self & other. Read more
source§

fn difference(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean difference self - other. Read more
source§

fn union(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean union self | other. Read more
source§

fn xor(&self, other: &Self) -> MultiPolygon<T>

Compute the boolean exclusive OR self ^ other. Read more
§

impl<T> Clone for MultiPolygon<T>where T: Clone,

§

fn clone(&self) -> MultiPolygon<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T> Debug for MultiPolygon<T>where T: Debug,

§

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

Formats the value using the given formatter. Read more
§

impl<T> Default for MultiPolygon<T>where T: Default,

§

fn default() -> MultiPolygon<T>

Returns the “default value” for a type. Read more
§

impl<'de, T> Deserialize<'de> for MultiPolygon<T>where T: Deserialize<'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
§

impl<T, IP> From<IP> for MultiPolygon<T>where IP: Into<Polygon<T>>,

§

fn from(x: IP) -> MultiPolygon<T>

Converts to this type from the input type.
§

impl<T> From<Vec<Polygon<T>, Global>> for MultiPolygon<T>

§

fn from(polygons: Vec<Polygon<T>, Global>) -> MultiPolygon<T>

Converts to this type from the input type.
§

impl<T, IP> FromIterator<IP> for MultiPolygon<T>where IP: Into<Polygon<T>>,

§

fn from_iter<I>(iter: I) -> MultiPolygon<T>where I: IntoIterator<Item = IP>,

Creates a value from an iterator. Read more
§

impl<T> Hash for MultiPolygon<T>where T: Hash,

§

fn hash<__H>(&self, state: &mut __H)where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<T> IntoIterator for MultiPolygon<T>

§

type Item = Polygon<T>

The type of the elements being iterated over.
§

type IntoIter = IntoIter<Polygon<T>, Global>

Which kind of iterator are we turning this into?
§

fn into_iter(self) -> <MultiPolygon<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
§

impl<T> MapPointwise<T> for MultiPolygon<T>where T: CoordinateType,

§

fn transform<F>(&self, tf: F) -> MultiPolygon<T>where F: Fn(Point<T>) -> Point<T>,

Point wise transformation.
§

impl<T> Serialize for MultiPolygon<T>where T: Serialize,

§

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
§

impl<T> TryBoundingBox<T> for MultiPolygon<T>where T: CoordinateType,

§

fn try_bounding_box(&self) -> Option<Rect<T>>

Return the bounding box of this geometry if a bounding box is defined.
§

impl<T> WindingNumber<T> for MultiPolygon<T>where T: CoordinateType,

§

fn winding_number(&self, point: Point<T>) -> isize

Calculate the winding number of the polygon around this point. Read more
§

fn contains_point_non_oriented(&self, point: Point<T>) -> bool

Check if point is inside the polygon, i.e. the polygons winds around the point a non-zero number of times. Read more
§

fn contains_point(&self, point: Point<T>) -> bool

Check if point is inside the polygon, i.e. the polygon winds around the point an odd number of times. Read more

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<S, T> Mirror<T> for Swhere T: Copy + Zero + Sub<T, Output = T>, S: MapPointwise<T>,

§

fn mirror_x(&self) -> S

Return the geometrical object mirrored at the x axis.

§

fn mirror_y(&self) -> S

Return the geometrical object mirrored at the y axis.

§

impl<S, T> RotateOrtho<T> for Swhere T: Copy + Zero + Sub<T, Output = T>, S: MapPointwise<T>,

§

fn rotate_ortho(&self, a: Angle) -> S

Rotate the geometrical shape by a multiple of 90 degrees.
§

impl<S, T> Scale<T> for Swhere T: Copy + Mul<T, Output = T>, S: MapPointwise<T>,

§

fn scale(&self, factor: T) -> S

Scale the geometrical shape. Scaling center is the origin (0, 0).
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<S, T> Translate<T> for Swhere T: Copy + Add<T, Output = T>, S: MapPointwise<T>,

§

fn translate(&self, v: Vector<T>) -> S

Translate the geometrical object by a vector v.
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,