[][src]Trait lyon_tessellation::geometry_builder::GeometryBuilder

pub trait GeometryBuilder {
    fn begin_geometry(&mut self);
fn end_geometry(&mut self) -> Count;
fn add_triangle(&mut self, a: VertexId, b: VertexId, c: VertexId);
fn abort_geometry(&mut self); }

An interface separating tessellators and other geometry generation algorithms from the actual vertex construction.

Depending on which tessellator a geometry builder interfaces with, it also has to implement one or several of the following traits (Which contain the hooks to generate vertices):

See the geometry_builder module documentation for more detailed explanation.

Required methods

fn begin_geometry(&mut self)

Called at the beginning of a generation.

end_geometry must be called before begin_geometry is called again.

fn end_geometry(&mut self) -> Count

Called at the end of a generation. Returns the number of vertices and indices added since the last time begin_geometry was called.

fn add_triangle(&mut self, a: VertexId, b: VertexId, c: VertexId)

Insert a triangle made of vertices that were added after the last call to begin_geometry.

This method can only be called between begin_geometry and end_geometry.

fn abort_geometry(&mut self)

abort_geometry is called instead of end_geometry if an error occurred while producing the geometry and we won't be able to finish.

The implementation is expected to discard the geometry that was generated since the last time begin_geometry was called, and to remain in a usable state.

Loading content...

Implementors

impl GeometryBuilder for NoOutput[src]

impl<'l, OutputVertex, OutputIndex, Ctor> GeometryBuilder for BuffersBuilder<'l, OutputVertex, OutputIndex, Ctor> where
    OutputVertex: 'l,
    OutputIndex: Add + From<VertexId> + MaxIndex
[src]

Loading content...