Trait triangulate::PolygonList[][src]

pub trait PolygonList<'a>: Copy {
    type Vertex: 'a + Vertex;
    type Index: 'a + VertexIndex;
    type IntoItem: Into<PolygonVertex<Self::Index>>;
    type Iter: Iterator<Item = Self::IntoItem>;
    fn vertex_count(self) -> usize;
fn iter_polygon_vertices(self) -> Self::Iter;
fn get_vertex(self, index: Self::Index) -> &'a Self::Vertex; }

An indexable list of polygons and their vertices

Associated Types

type Vertex: 'a + Vertex[src]

The type of vertices of the polygons.

type Index: 'a + VertexIndex[src]

A type used to uniquely identify a Vertex (such as (usize, usize) could be a Vertex for a Vec<Vec<MyVertex>>)

type IntoItem: Into<PolygonVertex<Self::Index>>[src]

The contained type

type Iter: Iterator<Item = Self::IntoItem>[src]

The Iterator type that iter_polygon_vertices returns.

Loading content...

Required methods

fn vertex_count(self) -> usize[src]

Provides the total number of vertices among all polygons.

fn iter_polygon_vertices(self) -> Self::Iter[src]

Iterate through all Indexes of all polygons. Indices must be returned in either clockwise or counter-clockwise order, without repeating the initial index. Between each polygon, implementers must return a NewPolygon value.

ContinuePolygon values must be yielded in successive groups of at least 3, otherwise triangulation will fail.

Successive NewPolygons are idempotent, and NewPolygons as the initial or final iteration values have no effect.

fn get_vertex(self, index: Self::Index) -> &'a Self::Vertex[src]

Get the Vertex uniquely identified by the Index value

Loading content...

Implementations on Foreign Types

impl<'a, V: Vertex> PolygonList<'a> for &'a Vec<Vec<V>>[src]

type Vertex = V

type Index = (usize, usize)

type IntoItem = PolygonVertex<Self::Index>

type Iter = VecVecIter<'a, V>

fn vertex_count(self) -> usize[src]

fn iter_polygon_vertices(self) -> Self::Iter[src]

fn get_vertex(self, index: Self::Index) -> &'a Self::Vertex[src]

impl<'a, V: Vertex> PolygonList<'a> for &'a Vec<V>[src]

type Vertex = V

type Index = usize

type IntoItem = Self::Index

type Iter = Range<Self::Index>

fn vertex_count(self) -> usize[src]

fn iter_polygon_vertices(self) -> Self::Iter[src]

fn get_vertex(self, index: Self::Index) -> &'a Self::Vertex[src]

impl<'a, V: Vertex> PolygonList<'a> for &'a [V][src]

type Vertex = V

type Index = usize

type IntoItem = Self::Index

type Iter = Range<Self::Index>

fn vertex_count(self) -> usize[src]

fn iter_polygon_vertices(self) -> Self::Iter[src]

fn get_vertex(self, index: Self::Index) -> &'a Self::Vertex[src]

Loading content...

Implementors

impl<'a, P: PolygonList<'a, Index = (usize, usize)>> PolygonList<'a> for IndexWithU16U16<'a, P>[src]

type Vertex = P::Vertex

type Index = (u16, u16)

type IntoItem = PolygonVertex<Self::Index>

type Iter = IndexWithIter<'a, usize, u16, (usize, usize), P>

fn vertex_count(self) -> usize[src]

fn iter_polygon_vertices(self) -> Self::Iter[src]

fn get_vertex(self, index: Self::Index) -> &'a Self::Vertex[src]

impl<'a, P: PolygonList<'a, Index = (usize, usize)>> PolygonList<'a> for IndexWithU32U32<'a, P>[src]

type Vertex = P::Vertex

type Index = (u32, u32)

type IntoItem = PolygonVertex<Self::Index>

type Iter = IndexWithIter<'a, usize, u32, (usize, usize), P>

fn vertex_count(self) -> usize[src]

fn iter_polygon_vertices(self) -> Self::Iter[src]

fn get_vertex(self, index: Self::Index) -> &'a Self::Vertex[src]

impl<'a, P: PolygonList<'a, Index = usize>> PolygonList<'a> for IndexWithU16<'a, P>[src]

type Vertex = P::Vertex

type Index = u16

type IntoItem = PolygonVertex<Self::Index>

type Iter = IndexWithIter<'a, usize, u16, usize, P>

fn vertex_count(self) -> usize[src]

fn iter_polygon_vertices(self) -> Self::Iter[src]

fn get_vertex(self, index: Self::Index) -> &'a Self::Vertex[src]

impl<'a, P: PolygonList<'a, Index = usize>> PolygonList<'a> for IndexWithU32<'a, P>[src]

type Vertex = P::Vertex

type Index = u32

type IntoItem = PolygonVertex<Self::Index>

type Iter = IndexWithIter<'a, usize, u32, usize, P>

fn vertex_count(self) -> usize[src]

fn iter_polygon_vertices(self) -> Self::Iter[src]

fn get_vertex(self, index: Self::Index) -> &'a Self::Vertex[src]

Loading content...