Struct libreda_db::layout::prelude::MultiPolygon
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>
impl<T> MultiPolygon<T>
pub fn new() -> MultiPolygon<T>
pub fn new() -> MultiPolygon<T>
Create an empty set of polygons.
pub fn from_polygons(polygons: Vec<Polygon<T>, Global>) -> MultiPolygon<T>
pub fn from_polygons(polygons: Vec<Polygon<T>, Global>) -> MultiPolygon<T>
Create a MultiPolygon from a vector of Polygons.
§impl<T> MultiPolygon<T>where
T: Copy,
impl<T> MultiPolygon<T>where T: Copy,
pub 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§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§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§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§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§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 more§impl<T> Clone for MultiPolygon<T>where
T: Clone,
impl<T> Clone for MultiPolygon<T>where T: Clone,
§fn clone(&self) -> MultiPolygon<T>
fn clone(&self) -> MultiPolygon<T>
Returns a copy 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 more§impl<T> Debug for MultiPolygon<T>where
T: Debug,
impl<T> Debug for MultiPolygon<T>where T: Debug,
§impl<T> Default for MultiPolygon<T>where
T: Default,
impl<T> Default for MultiPolygon<T>where T: Default,
§fn default() -> MultiPolygon<T>
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>,
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>,
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>>,
impl<T, IP> From<IP> for MultiPolygon<T>where IP: Into<Polygon<T>>,
§fn from(x: IP) -> MultiPolygon<T>
fn from(x: IP) -> MultiPolygon<T>
Converts to this type from the input type.
§impl<T, IP> FromIterator<IP> for MultiPolygon<T>where
IP: Into<Polygon<T>>,
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>,
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,
impl<T> Hash for MultiPolygon<T>where T: Hash,
§impl<T> IntoIterator for MultiPolygon<T>
impl<T> IntoIterator for MultiPolygon<T>
§impl<T> MapPointwise<T> for MultiPolygon<T>where
T: CoordinateType,
impl<T> MapPointwise<T> for MultiPolygon<T>where T: CoordinateType,
§impl<T> Serialize for MultiPolygon<T>where
T: Serialize,
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,
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,
impl<T> TryBoundingBox<T> for MultiPolygon<T>where T: CoordinateType,
§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.
§impl<T> WindingNumber<T> for MultiPolygon<T>where
T: CoordinateType,
impl<T> WindingNumber<T> for MultiPolygon<T>where T: CoordinateType,
§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
§fn contains_point_non_oriented(&self, point: Point<T>) -> bool
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
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 moreAuto 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§
§impl<S, T> RotateOrtho<T> for Swhere
T: Copy + Zero + Sub<T, Output = T>,
S: MapPointwise<T>,
impl<S, T> RotateOrtho<T> for Swhere T: Copy + Zero + Sub<T, Output = T>, S: MapPointwise<T>,
§fn rotate_ortho(&self, a: Angle) -> S
fn rotate_ortho(&self, a: Angle) -> S
Rotate the geometrical shape by a multiple of 90 degrees.