Trait PolygonSet

Source
pub trait PolygonSet<C: CoordinateConcept>: IntoSegments<C> {
    type Point: PointConcept<C>;
    type Segment: Segment<C, Point = Self::Point>;
    type AllPoints: Iterator<Item = Self::Point>;

    // Required methods
    fn num_polygons(&self) -> usize;
    fn convolved(self, p: &Self::Point) -> Self;
    fn convolve(&mut self, p: &Self::Point);
    fn scaled(self, scale: C::Coord) -> Self;
    fn scale(&mut self, scale: C::Coord);
    fn all_points(&self) -> Self::AllPoints;
}
Expand description

Set of multiple polygons edges.

Required Associated Types§

Source

type Point: PointConcept<C>

Point type used for the vertices.

Source

type Segment: Segment<C, Point = Self::Point>

Type used for the polygon segments.

Source

type AllPoints: Iterator<Item = Self::Point>

Iterator over all points.

Required Methods§

Source

fn num_polygons(&self) -> usize

Get number of polygons.

Source

fn convolved(self, p: &Self::Point) -> Self

Add the point p to all vertices.

Source

fn convolve(&mut self, p: &Self::Point)

Add the point p to all vertices.

Source

fn scaled(self, scale: C::Coord) -> Self

Multiply all vertices with a factor.

Source

fn scale(&mut self, scale: C::Coord)

Multiply all vertices with a factor.

Source

fn all_points(&self) -> Self::AllPoints

Iterate over all vertices.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§