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.
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 Index
es 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 NewPolygon
s are idempotent, and NewPolygon
s 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
Implementations on Foreign Types
impl<'a, V: Vertex> PolygonList<'a> for &'a Vec<Vec<V>>
[src]
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]
impl<'a, V: Vertex> PolygonList<'a> for &'a Vec<V>
[src]impl<'a, V: Vertex> PolygonList<'a> for &'a [V]
[src]
impl<'a, V: Vertex> PolygonList<'a> for &'a [V]
[src]Implementors
impl<'a, P: PolygonList<'a, Index = (usize, usize)>> PolygonList<'a> for IndexWithU16U16<'a, P>
[src]
impl<'a, P: PolygonList<'a, Index = (usize, usize)>> PolygonList<'a> for IndexWithU16U16<'a, P>
[src]impl<'a, P: PolygonList<'a, Index = (usize, usize)>> PolygonList<'a> for IndexWithU32U32<'a, P>
[src]
impl<'a, P: PolygonList<'a, Index = (usize, usize)>> PolygonList<'a> for IndexWithU32U32<'a, P>
[src]impl<'a, P: PolygonList<'a, Index = usize>> PolygonList<'a> for IndexWithU16<'a, P>
[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]
impl<'a, P: PolygonList<'a, Index = usize>> PolygonList<'a> for IndexWithU32<'a, P>
[src]