[−][src]Struct lyon_tessellation::BuffersBuilder
A temporary view on a VertexBuffers
object which facilitate the population of vertex and index
data.
BuffersBuilders
record the vertex offset from when they are created so that algorithms using
them don't need to worry about offsetting indices if some geometry was added beforehand. This
means that from the point of view of a BuffersBuilder
user, the first added vertex is at always
offset at the offset 0 and VertexBuilder
takes care of translating indices adequately.
Often, algorithms are built to generate vertex positions without knowledge of eventual other
vertex attributes. The VertexConstructor
does the translation from generic Input
to OutputVertex
.
If your logic generates the actual vertex type directly, you can use the SimpleBuffersBuilder
convenience typedef.
Methods
impl<'l, OutputVertex: 'l, OutputIndex: 'l, Ctor> BuffersBuilder<'l, OutputVertex, OutputIndex, Ctor>
[src]
pub fn new(
buffers: &'l mut VertexBuffers<OutputVertex, OutputIndex>,
ctor: Ctor
) -> Self
[src]
buffers: &'l mut VertexBuffers<OutputVertex, OutputIndex>,
ctor: Ctor
) -> Self
pub fn buffers<'a, 'b: 'a>(
&'b self
) -> &'a VertexBuffers<OutputVertex, OutputIndex>
[src]
&'b self
) -> &'a VertexBuffers<OutputVertex, OutputIndex>
Trait Implementations
impl<'l, OutputVertex, OutputIndex, Ctor> BasicGeometryBuilder for BuffersBuilder<'l, OutputVertex, OutputIndex, Ctor> where
OutputVertex: 'l,
OutputIndex: Add + From<VertexId> + MaxIndex,
Ctor: BasicVertexConstructor<OutputVertex>,
[src]
OutputVertex: 'l,
OutputIndex: Add + From<VertexId> + MaxIndex,
Ctor: BasicVertexConstructor<OutputVertex>,
fn add_vertex(&mut self, p: Point) -> Result<VertexId, GeometryBuilderError>
[src]
impl<'l, OutputVertex, OutputIndex, Ctor> FillGeometryBuilder for BuffersBuilder<'l, OutputVertex, OutputIndex, Ctor> where
OutputVertex: 'l,
OutputIndex: Add + From<VertexId> + MaxIndex,
Ctor: FillVertexConstructor<OutputVertex>,
[src]
OutputVertex: 'l,
OutputIndex: Add + From<VertexId> + MaxIndex,
Ctor: FillVertexConstructor<OutputVertex>,
fn add_fill_vertex(
&mut self,
position: Point,
attributes: FillAttributes
) -> Result<VertexId, GeometryBuilderError>
[src]
&mut self,
position: Point,
attributes: FillAttributes
) -> Result<VertexId, GeometryBuilderError>
impl<'l, OutputVertex, OutputIndex, Ctor> GeometryBuilder for BuffersBuilder<'l, OutputVertex, OutputIndex, Ctor> where
OutputVertex: 'l,
OutputIndex: Add + From<VertexId> + MaxIndex,
[src]
OutputVertex: 'l,
OutputIndex: Add + From<VertexId> + MaxIndex,
fn begin_geometry(&mut self)
[src]
fn end_geometry(&mut self) -> Count
[src]
fn abort_geometry(&mut self)
[src]
fn add_triangle(&mut self, a: VertexId, b: VertexId, c: VertexId)
[src]
impl<'l, OutputVertex, OutputIndex, Ctor> GeometryReceiver for BuffersBuilder<'l, OutputVertex, OutputIndex, Ctor> where
OutputIndex: From<VertexId>,
Ctor: BasicVertexConstructor<OutputVertex>,
[src]
OutputIndex: From<VertexId>,
Ctor: BasicVertexConstructor<OutputVertex>,
impl<'l, OutputVertex, OutputIndex, Ctor> StrokeGeometryBuilder for BuffersBuilder<'l, OutputVertex, OutputIndex, Ctor> where
OutputVertex: 'l,
OutputIndex: Add + From<VertexId> + MaxIndex,
Ctor: StrokeVertexConstructor<OutputVertex>,
[src]
OutputVertex: 'l,
OutputIndex: Add + From<VertexId> + MaxIndex,
Ctor: StrokeVertexConstructor<OutputVertex>,
fn add_stroke_vertex(
&mut self,
p: Point,
v: StrokeAttributes
) -> Result<VertexId, GeometryBuilderError>
[src]
&mut self,
p: Point,
v: StrokeAttributes
) -> Result<VertexId, GeometryBuilderError>
Auto Trait Implementations
impl<'l, OutputVertex, OutputIndex, Ctor> RefUnwindSafe for BuffersBuilder<'l, OutputVertex, OutputIndex, Ctor> where
Ctor: RefUnwindSafe,
OutputIndex: RefUnwindSafe,
OutputVertex: RefUnwindSafe,
Ctor: RefUnwindSafe,
OutputIndex: RefUnwindSafe,
OutputVertex: RefUnwindSafe,
impl<'l, OutputVertex, OutputIndex, Ctor> Send for BuffersBuilder<'l, OutputVertex, OutputIndex, Ctor> where
Ctor: Send,
OutputIndex: Send,
OutputVertex: Send,
Ctor: Send,
OutputIndex: Send,
OutputVertex: Send,
impl<'l, OutputVertex, OutputIndex, Ctor> Sync for BuffersBuilder<'l, OutputVertex, OutputIndex, Ctor> where
Ctor: Sync,
OutputIndex: Sync,
OutputVertex: Sync,
Ctor: Sync,
OutputIndex: Sync,
OutputVertex: Sync,
impl<'l, OutputVertex, OutputIndex, Ctor> Unpin for BuffersBuilder<'l, OutputVertex, OutputIndex, Ctor> where
Ctor: Unpin,
Ctor: Unpin,
impl<'l, OutputVertex, OutputIndex, Ctor> !UnwindSafe for BuffersBuilder<'l, OutputVertex, OutputIndex, Ctor>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,