pub trait FanBuilder<'p, P: PolygonList<'p> + ?Sized>: Sized {
    type Output;
    type Error: Error;

    const WINDING: TriangleWinding = TriangleWinding::Counterclockwise;

    // Required methods
    fn new_fan(
        &mut self,
        vi0: P::Index,
        vi1: P::Index,
        vi2: P::Index
    ) -> Result<(), Self::Error>;
    fn extend_fan(&mut self, vi: P::Index) -> Result<(), Self::Error>;
    fn build(self) -> Result<Self::Output, Self::Error>;
    fn fail(self, error: &TriangulationError<Self::Error>);
}
Expand description

Performs the construction of triangle fans

Required Associated Types§

source

type Output

The triangle fans output type

source

type Error: Error

The error type when the builder fails

Provided Associated Constants§

source

const WINDING: TriangleWinding = TriangleWinding::Counterclockwise

The winding direction this builder expects for triangles

Required Methods§

source

fn new_fan( &mut self, vi0: P::Index, vi1: P::Index, vi2: P::Index ) -> Result<(), Self::Error>

Starts a new fan with the given triangle

source

fn extend_fan(&mut self, vi: P::Index) -> Result<(), Self::Error>

Extends the current fan with a triangle containing the given vertex

source

fn build(self) -> Result<Self::Output, Self::Error>

Called when triangulation has completed to get the resulting output

source

fn fail(self, error: &TriangulationError<Self::Error>)

Called when triangulation encounters an error.

Any required cleanup (e.g. removing the partial triangulation added to an existing Vec) should be done here

Implementors§