pub trait Winding {
    type Scalar: CoordNum;

    // Required methods
    fn winding_order(&self) -> Option<WindingOrder>;
    fn points_cw(&self) -> Points<'_, Self::Scalar> ;
    fn points_ccw(&self) -> Points<'_, Self::Scalar> ;
    fn make_cw_winding(&mut self);
    fn make_ccw_winding(&mut self);

    // Provided methods
    fn is_cw(&self) -> bool { ... }
    fn is_ccw(&self) -> bool { ... }
    fn clone_to_winding_order(&self, winding_order: WindingOrder) -> Self
       where Self: Sized + Clone { ... }
    fn make_winding_order(&mut self, winding_order: WindingOrder) { ... }
}
Expand description

Determine and operate on how a LineString is wound. This functionality, and our implementation is based on CGAL’s Polygon_2::orientation.

Required Associated Types§

Required Methods§

source

fn winding_order(&self) -> Option<WindingOrder>

Return the winding order of this object if it contains at least three distinct coordinates, and None otherwise.

source

fn points_cw(&self) -> Points<'_, Self::Scalar>

Iterate over the points in a clockwise order

The object isn’t changed, and the points are returned either in order, or in reverse order, so that the resultant order makes it appear clockwise

source

fn points_ccw(&self) -> Points<'_, Self::Scalar>

Iterate over the points in a counter-clockwise order

The object isn’t changed, and the points are returned either in order, or in reverse order, so that the resultant order makes it appear counter-clockwise

source

fn make_cw_winding(&mut self)

Change this object’s points so they are in clockwise winding order

source

fn make_ccw_winding(&mut self)

Change this line’s points so they are in counterclockwise winding order

Provided Methods§

source

fn is_cw(&self) -> bool

True iff this is wound clockwise

source

fn is_ccw(&self) -> bool

True iff this is wound counterclockwise

source

fn clone_to_winding_order(&self, winding_order: WindingOrder) -> Self
where Self: Sized + Clone,

Return a clone of this object, but in the specified winding order

source

fn make_winding_order(&mut self, winding_order: WindingOrder)

Change the winding order so that it is in this winding order

Implementors§

source§

impl<T, K> Winding for LineString<T>
where T: GeoNum<Ker = K>, K: Kernel<T>,

§

type Scalar = T