Trait pasture_core::containers::PointBufferExt[][src]

pub trait PointBufferExt<B: PointBuffer + ?Sized> {
    fn get_point<T: PointType>(&self, index: usize) -> T;
fn get_attribute<T: PrimitiveType>(
        &self,
        attribute: &PointAttributeDefinition,
        index: usize
    ) -> T;
fn iter_point<T: PointType>(&self) -> PointIteratorByValue<'_, T, B>

Notable traits for PointIteratorByValue<'a, T, B>

impl<'a, T: PointType, B: PointBuffer + ?Sized> Iterator for PointIteratorByValue<'a, T, B> type Item = T;
;
fn iter_attribute<'a, T: PrimitiveType>(
        &'a self,
        attribute: &'a PointAttributeDefinition
    ) -> AttributeIteratorByValue<'a, T, B>

Notable traits for AttributeIteratorByValue<'a, T, B>

impl<'a, T: PrimitiveType, B: PointBuffer + ?Sized> Iterator for AttributeIteratorByValue<'a, T, B> type Item = T;
;
fn iter_attribute_as<'a, T: PrimitiveType>(
        &'a self,
        attribute: &'a PointAttributeDefinition
    ) -> AttributeIteratorByValueWithConversion<'a, T, B>

Notable traits for AttributeIteratorByValueWithConversion<'a, T, B>

impl<'a, T: PrimitiveType, B: PointBuffer + ?Sized> Iterator for AttributeIteratorByValueWithConversion<'a, T, B> type Item = T;
; }

Extension trait that provides generic methods for accessing point data in a PointBuffer

Required methods

fn get_point<T: PointType>(&self, index: usize) -> T[src]

Returns the point at index from the associated PointBuffer, strongly typed to the PointType T

fn get_attribute<T: PrimitiveType>(
    &self,
    attribute: &PointAttributeDefinition,
    index: usize
) -> T
[src]

Returns the given attribute for the point at index from the associated PointBuffer, strongly typed to the PrimitiveType T

fn iter_point<T: PointType>(&self) -> PointIteratorByValue<'_, T, B>

Notable traits for PointIteratorByValue<'a, T, B>

impl<'a, T: PointType, B: PointBuffer + ?Sized> Iterator for PointIteratorByValue<'a, T, B> type Item = T;
[src]

Returns an iterator over all points in the associated PointBuffer, strongly typed to the PointType T

fn iter_attribute<'a, T: PrimitiveType>(
    &'a self,
    attribute: &'a PointAttributeDefinition
) -> AttributeIteratorByValue<'a, T, B>

Notable traits for AttributeIteratorByValue<'a, T, B>

impl<'a, T: PrimitiveType, B: PointBuffer + ?Sized> Iterator for AttributeIteratorByValue<'a, T, B> type Item = T;
[src]

Returns an iterator over the given attribute of all points in the associated PointBuffer, strongly typed to the PrimitiveType T.

For iterating over multiple attributes at once, use the attributes! macro.

Panics

Panics if attribute is not part of the PointLayout of the buffer.
Panics if the data type of attribute inside the associated PointBuffer is not equal to T. If you want a conversion, use iter_attribute_as.

fn iter_attribute_as<'a, T: PrimitiveType>(
    &'a self,
    attribute: &'a PointAttributeDefinition
) -> AttributeIteratorByValueWithConversion<'a, T, B>

Notable traits for AttributeIteratorByValueWithConversion<'a, T, B>

impl<'a, T: PrimitiveType, B: PointBuffer + ?Sized> Iterator for AttributeIteratorByValueWithConversion<'a, T, B> type Item = T;
[src]

Returns an iterator over the given attribute of all points in the associated PointBuffer, converted to the PrimitiveType T. This iterator supports conversion of types, so it works even if the attribute inside the buffer is stored as some other type U, as long as there is a valid conversion from U to T. Regarding conversions, see the conversions module.

For iterating over multiple attributes at once, use the attributes! macro.

Panics

Panics if attribute is not part of the PointLayout of the buffer.
Panics if no valid conversion exists from the type that the attribute is stored as inside the buffer into type T.

Loading content...

Implementors

impl<B: PointBuffer + ?Sized> PointBufferExt<B> for B[src]

Loading content...