[][src]Trait plexus::index::CollectWithIndexer

pub trait CollectWithIndexer<P, Q> where
    P: Topological,
    Q: Topological<Vertex = P::Vertex>, 
{ fn collect_with_indexer<T, N>(self, indexer: N) -> Result<T, T::Error>
    where
        T: FromIndexer<P, Q>,
        N: Indexer<Q, P::Vertex>
; }

Functions for collecting a stream of $n$-gons into a mesh data structure.

These functions can be used to collect data from a generator into a MeshBuffer or MeshGraph.

See HashIndexer and LruIndexer.

Required methods

fn collect_with_indexer<T, N>(self, indexer: N) -> Result<T, T::Error> where
    T: FromIndexer<P, Q>,
    N: Indexer<Q, P::Vertex>, 

Collects a stream of $n$-gons into a mesh data structure using the given indexer.

Unlike collect, this function allows the indexer to be specified.

Errors

Returns an error defined by the implementer if the target type cannot be constructed from the indexed vertices.

Examples

use decorum::N32;
use nalgebra::Point3;
use plexus::graph::MeshGraph;
use plexus::prelude::*;
use plexus::primitive::cube::Cube;
use plexus::primitive::generate::Position;
use plexus::index::HashIndexer;

let graph = Cube::new()
    .polygons::<Position<Point3<N32>>>()
    .collect_with_indexer::<MeshGraph<Point3<f32>>, _>(HashIndexer::default())
    .unwrap();
Loading content...

Implementors

impl<P, Q, I> CollectWithIndexer<P, Q> for I where
    I: Iterator<Item = P>,
    P: Topological,
    Q: Topological<Vertex = P::Vertex>, 
[src]

Loading content...