pub enum Geometry {
Point([f64; 2]),
BoundingBox(BoundingBox),
ArcSegment(ArcSegment),
LineSegment(LineSegment),
Line(Line),
Segment(Segment),
Polysegment(Polysegment),
Contour(Contour),
Shape(Shape),
}Expand description
A container enum for owned geometric types. See the module-level documentation for more.
Variants§
Point([f64; 2])
An owned point ([f64; 2]).
BoundingBox(BoundingBox)
An owned BoundingBox.
ArcSegment(ArcSegment)
An owned ArcSegment.
LineSegment(LineSegment)
An owned LineSegment.
Line(Line)
An owned Line.
Segment(Segment)
An owned Segment.
Polysegment(Polysegment)
An owned Polysegment.
Contour(Contour)
An owned Contour.
Shape(Shape)
An owned Shape.
Implementations§
Source§impl Geometry
impl Geometry
Sourcepub fn segment(&self, key: SegmentKey) -> Option<&Segment>
pub fn segment(&self, key: SegmentKey) -> Option<&Segment>
If self holds a Composite, returns a reference to the Segment
specified by the given SegmentKey. Otherwise, returns None.
Sourcepub fn intersections<'b, T: Into<GeometryRef<'b>>>(
&self,
other: T,
epsilon: f64,
max_ulps: u32,
) -> Vec<Intersection>
pub fn intersections<'b, T: Into<GeometryRef<'b>>>( &self, other: T, epsilon: f64, max_ulps: u32, ) -> Vec<Intersection>
Returns all intersections between self and other.
See GeometryRef::intersections for details and examples.
Sourcepub fn intersections_par<'b, T: Into<GeometryRef<'b>>>(
&self,
other: T,
epsilon: f64,
max_ulps: u32,
) -> Vec<Intersection>
pub fn intersections_par<'b, T: Into<GeometryRef<'b>>>( &self, other: T, epsilon: f64, max_ulps: u32, ) -> Vec<Intersection>
Returns all intersections between self and other.
This is a parallelized version of Geometry::intersections, see its
docstring for details. It uses parallel variants of the specialized
intersection algorithms, if available.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Geometry
impl<'de> Deserialize<'de> for Geometry
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 From<&Geometry> for BoundingBox
impl From<&Geometry> for BoundingBox
Source§impl<'a> From<&'a Geometry> for GeometryCow<'a>
impl<'a> From<&'a Geometry> for GeometryCow<'a>
Source§impl<'a> From<&'a Geometry> for GeometryRef<'a>
impl<'a> From<&'a Geometry> for GeometryRef<'a>
Source§impl From<ArcSegment> for Geometry
impl From<ArcSegment> for Geometry
Source§fn from(value: ArcSegment) -> Self
fn from(value: ArcSegment) -> Self
Converts to this type from the input type.
Source§impl From<BoundingBox> for Geometry
impl From<BoundingBox> for Geometry
Source§fn from(value: BoundingBox) -> Self
fn from(value: BoundingBox) -> Self
Converts to this type from the input type.
Source§impl<'a> From<Geometry> for GeometryCow<'a>
impl<'a> From<Geometry> for GeometryCow<'a>
Source§impl From<LineSegment> for Geometry
impl From<LineSegment> for Geometry
Source§fn from(value: LineSegment) -> Self
fn from(value: LineSegment) -> Self
Converts to this type from the input type.
Source§impl From<Polysegment> for Geometry
impl From<Polysegment> for Geometry
Source§fn from(value: Polysegment) -> Self
fn from(value: Polysegment) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Geometry
impl RefUnwindSafe for Geometry
impl Send for Geometry
impl Sync for Geometry
impl Unpin for Geometry
impl UnsafeUnpin for Geometry
impl UnwindSafe for Geometry
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<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToBoundingBox for T
impl<T> ToBoundingBox for T
Source§fn bounding_box(&self) -> BoundingBox
fn bounding_box(&self) -> BoundingBox
Returns a bounding box for the implementor. Read more