pub struct Flat<T, const N: usize> where
Constant<N>: ToType,
TypeOf<N>: NonZero,
T: Copy + Integer + Unsigned, { /* private fields */ }
Expand description
Flat index buffer meta-grouping.
Describes a flat index buffer with a constant arity. The number of vertices
in the indexed topological structures is specified using a constant
parameter N
, which represents the number of grouped elements in the index
buffer. For example, Flat<_, 3>
describes an index buffer with indices in
implicit and contiguous groups of three. Note that this constant may be
distinct from the arity of the indexed topological structures (i.e., if N
is less than three, then arity is N - 1
and may be zero.).
Unlike structured groupings, this meta-grouping is needed to associate an
index type with an implicit grouping and arity. For example, Vec<usize>
implements both IndexBuffer<Flat<usize, 3>>
(a triangular buffer) and
IndexBuffer<Flat<usize, 4>>
(a quadrilateral buffer).
See the index
module documention for more information about index
buffers.
Examples
Creating a MeshBuffer
with a flat and triangular index buffer:
use plexus::buffer::MeshBuffer;
use plexus::index::Flat;
use plexus::prelude::*;
let mut buffer = MeshBuffer::<Flat<usize, 3>, (f64, f64, f64)>::default();
Trait Implementations
sourceimpl<T: Debug, const N: usize> Debug for Flat<T, N> where
Constant<N>: ToType,
TypeOf<N>: NonZero,
T: Copy + Integer + Unsigned,
impl<T: Debug, const N: usize> Debug for Flat<T, N> where
Constant<N>: ToType,
TypeOf<N>: NonZero,
T: Copy + Integer + Unsigned,
sourceimpl<T, const N: usize> Grouping for Flat<T, N> where
Constant<N>: ToType,
TypeOf<N>: NonZero,
T: Copy + Integer + Unsigned,
impl<T, const N: usize> Grouping for Flat<T, N> where
Constant<N>: ToType,
TypeOf<N>: NonZero,
T: Copy + Integer + Unsigned,
type Group = T
type Group = T
The elements of flat index buffers are indices. These indices are
implicitly grouped by the arity of the buffer (N
).
sourceimpl<T, const N: usize> IndexBuffer<Flat<T, N>> for Vec<T> where
Constant<N>: ToType,
TypeOf<N>: NonZero,
T: Copy + Integer + Unsigned,
impl<T, const N: usize> IndexBuffer<Flat<T, N>> for Vec<T> where
Constant<N>: ToType,
TypeOf<N>: NonZero,
T: Copy + Integer + Unsigned,
sourceimpl<T, P, const N: usize> Push<Flat<T, N>, P> for Vec<T> where
Constant<N>: ToType,
TypeOf<N>: NonZero,
T: Copy + Integer + Unsigned,
P: Monomorphic + IntoVertices + Topological<Vertex = T>,
impl<T, P, const N: usize> Push<Flat<T, N>, P> for Vec<T> where
Constant<N>: ToType,
TypeOf<N>: NonZero,
T: Copy + Integer + Unsigned,
P: Monomorphic + IntoVertices + Topological<Vertex = T>,
sourceimpl<T, const N: usize> StaticArity for Flat<T, N> where
Constant<N>: ToType,
TypeOf<N>: NonZero,
T: Copy + Integer + Unsigned,
impl<T, const N: usize> StaticArity for Flat<T, N> where
Constant<N>: ToType,
TypeOf<N>: NonZero,
T: Copy + Integer + Unsigned,
impl<T, const N: usize> Monomorphic for Flat<T, N> where
Constant<N>: ToType,
TypeOf<N>: NonZero,
T: Copy + Integer + Unsigned,
Auto Trait Implementations
impl<T, const N: usize> RefUnwindSafe for Flat<T, N>
impl<T, const N: usize> Send for Flat<T, N>
impl<T, const N: usize> Sync for Flat<T, N>
impl<T, const N: usize> Unpin for Flat<T, N>
impl<T, const N: usize> UnwindSafe for Flat<T, N>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FromGeometry<T> for T
impl<T> FromGeometry<T> for T
fn from_geometry(other: T) -> T
sourceimpl<T, U> IntoGeometry<U> for T where
U: FromGeometry<T>,
impl<T, U> IntoGeometry<U> for T where
U: FromGeometry<T>,
fn into_geometry(self) -> U
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.