pub struct Contour<Point> { /* private fields */ }Expand description
Simple crate::Contour implementation.
Implementations§
Source§impl<Point> Contour<Point>
impl<Point> Contour<Point>
Sourcepub fn into_closed(self) -> Option<ClosedContour<Point>>
pub fn into_closed(self) -> Option<ClosedContour<Point>>
Converts self into a ClosedContour instance if the contour is closed, or returns None if the contour is
open.
Sourcepub fn project_points<P, Proj>(&self, projection: &Proj) -> Option<Contour<P>>where
Proj: Projection<InPoint = Point, OutPoint = P> + ?Sized,
pub fn project_points<P, Proj>(&self, projection: &Proj) -> Option<Contour<P>>where
Proj: Projection<InPoint = Point, OutPoint = P> + ?Sized,
Projects all the points of the contour with the given projection.
Trait Implementations§
Source§impl<P: Copy> Contour for Contour<P>
impl<P: Copy> Contour for Contour<P>
Source§fn iter_points(&self) -> impl Iterator<Item = P>
fn iter_points(&self) -> impl Iterator<Item = P>
Iterate over the points of the contour. Read more
Source§fn iter_points_closing(&self) -> impl Iterator<Item = Self::Point>
fn iter_points_closing(&self) -> impl Iterator<Item = Self::Point>
Same as
Contour::iter_points but for closed contours repeats the first point again at the end of the iterator.Source§fn iter_segments(&self) -> impl Iterator<Item = Segment<Self::Point>>
fn iter_segments(&self) -> impl Iterator<Item = Segment<Self::Point>>
Iterates over segments of the contour. For closed contours this includes the segment between the last and the
first points of the contour.
Source§impl<'de, Point> Deserialize<'de> for Contour<Point>where
Point: Deserialize<'de>,
impl<'de, Point> Deserialize<'de> for Contour<Point>where
Point: Deserialize<'de>,
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<P> From<ClosedContour<P>> for Contour<P>
impl<P> From<ClosedContour<P>> for Contour<P>
Source§fn from(value: ClosedContour<P>) -> Self
fn from(value: ClosedContour<P>) -> Self
Converts to this type from the input type.
Source§impl<P: GeometryType> GeometryType for Contour<P>
impl<P: GeometryType> GeometryType for Contour<P>
Source§impl<Point: Ord> Ord for Contour<Point>
impl<Point: Ord> Ord for Contour<Point>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<Point: PartialOrd> PartialOrd for Contour<Point>
impl<Point: PartialOrd> PartialOrd for Contour<Point>
impl<Point: Eq> Eq for Contour<Point>
impl<Point> StructuralPartialEq for Contour<Point>
Auto Trait Implementations§
impl<Point> Freeze for Contour<Point>
impl<Point> RefUnwindSafe for Contour<Point>where
Point: RefUnwindSafe,
impl<Point> Send for Contour<Point>where
Point: Send,
impl<Point> Sync for Contour<Point>where
Point: Sync,
impl<Point> Unpin for Contour<Point>where
Point: Unpin,
impl<Point> UnwindSafe for Contour<Point>where
Point: 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, P> CartesianContour<P> for T
impl<T, P> CartesianContour<P> for T
Source§impl<P, C> CartesianGeometry2dSpecialization<P, ContourGeometryType> for Cwhere
C: Contour<Point = P> + GeometryType<Type = ContourGeometryType, Space = CartesianSpace2d> + Geometry<Point = P>,
P: CartesianPoint2d + Copy,
impl<P, C> CartesianGeometry2dSpecialization<P, ContourGeometryType> for Cwhere
C: Contour<Point = P> + GeometryType<Type = ContourGeometryType, Space = CartesianSpace2d> + Geometry<Point = P>,
P: CartesianPoint2d + Copy,
Source§fn is_point_inside_spec<Other>(
&self,
point: &Other,
tolerance: <P as CartesianPoint2d>::Num,
) -> bool
fn is_point_inside_spec<Other>( &self, point: &Other, tolerance: <P as CartesianPoint2d>::Num, ) -> bool
Source§fn bounding_rectangle_spec(&self) -> Option<Rect<<P as CartesianPoint2d>::Num>>
fn bounding_rectangle_spec(&self) -> Option<Rect<<P as CartesianPoint2d>::Num>>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CoordinateMetadata for Twhere
T: ?Sized,
impl<T> CoordinateMetadata for Twhere
T: ?Sized,
Source§impl<T> Disambiguate for Twhere
T: GeometryType<Space = AmbiguousSpace>,
impl<T> Disambiguate for Twhere
T: GeometryType<Space = AmbiguousSpace>,
Source§fn to_geo2d(self) -> Disambig<Self, GeoSpace2d>where
Self: Sized,
fn to_geo2d(self) -> Disambig<Self, GeoSpace2d>where
Self: Sized,
Specifies that the geometry is in geographic coordinates.
Source§fn to_cartesian2d(self) -> Disambig<Self, CartesianSpace2d>where
Self: Sized,
fn to_cartesian2d(self) -> Disambig<Self, CartesianSpace2d>where
Self: Sized,
Specifies that the geometry is in cartesian coordinates.
Source§impl<C, Space> GeometrySpecialization<ContourGeometryType, Space> for C
impl<C, Space> GeometrySpecialization<ContourGeometryType, Space> for C
Source§fn project_spec<Proj>(
&self,
projection: &Proj,
) -> Option<Geom<<Proj as Projection>::OutPoint>>where
Proj: Projection<InPoint = <C as GeometrySpecialization<ContourGeometryType, Space>>::Point> + ?Sized,
fn project_spec<Proj>(
&self,
projection: &Proj,
) -> Option<Geom<<Proj as Projection>::OutPoint>>where
Proj: Projection<InPoint = <C as GeometrySpecialization<ContourGeometryType, Space>>::Point> + ?Sized,
See
Geometry::project.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.