Trait pasture_core::containers::PointBuffer[][src]

pub trait PointBuffer {
    fn get_raw_point(&self, point_index: usize, buf: &mut [u8]);
fn get_raw_attribute(
        &self,
        point_index: usize,
        attribute: &PointAttributeDefinition,
        buf: &mut [u8]
    );
fn get_raw_points(&self, index_range: Range<usize>, buf: &mut [u8]);
fn get_raw_attribute_range(
        &self,
        index_range: Range<usize>,
        attribute: &PointAttributeDefinition,
        buf: &mut [u8]
    );
fn len(&self) -> usize;
fn point_layout(&self) -> &PointLayout; fn is_empty(&self) -> bool { ... }
fn as_interleaved(&self) -> Option<&dyn InterleavedPointBuffer> { ... }
fn as_per_attribute(&self) -> Option<&dyn PerAttributePointBuffer> { ... } }

Base trait for all containers that store point data. A PointBuffer stores any number of point entries with a layout defined by the PointBuffers associated PointLayout structure.

Users will rarely have to work with this base trait directly as it exposes the underlying memory-unsafe API for fast point and attribute access. Instead, prefer specific PointBuffer implementations or point views!

Required methods

fn get_raw_point(&self, point_index: usize, buf: &mut [u8])[src]

Get the data for a single point from this PointBuffer and store it inside the given memory region. Panics if point_index is out of bounds. buf must be at least as big as a single point entry in the corresponding PointLayout of this PointBuffer

fn get_raw_attribute(
    &self,
    point_index: usize,
    attribute: &PointAttributeDefinition,
    buf: &mut [u8]
)
[src]

Get the data for the given attribute of a single point from this PointBuffer and store it inside the given memory region. Panics if point_index is out of bounds or if the attribute is not part of the point_layout of this PointBuffer. buf must be at least as big as a single attribute entry of the given attribute.

fn get_raw_points(&self, index_range: Range<usize>, buf: &mut [u8])[src]

Get the data for a range of points from this PointBuffer and stores it inside the given memory region. Panics if any index in index_range is out of bounds. buf must be at least as big as the size of a single point entry in the corresponding PointLayout of this PointBuffer multiplied by the number of point indices in index_range

fn get_raw_attribute_range(
    &self,
    index_range: Range<usize>,
    attribute: &PointAttributeDefinition,
    buf: &mut [u8]
)
[src]

fn len(&self) -> usize[src]

Returns the number of unique point entries stored inside this PointBuffer

fn point_layout(&self) -> &PointLayout[src]

Returns a reference to the underlying PointLayout of this PointBuffer

Loading content...

Provided methods

fn is_empty(&self) -> bool[src]

Returns true if the associated PointBuffer is empty, i.e. it stores zero points

fn as_interleaved(&self) -> Option<&dyn InterleavedPointBuffer>[src]

Try to downcast the associated PointBuffer into an InterleavedPointBuffer

fn as_per_attribute(&self) -> Option<&dyn PerAttributePointBuffer>[src]

Try to downcast the associated PointBuffer into an PerAttributePointBuffer

Loading content...

Implementors

impl PointBuffer for InterleavedVecPointStorage[src]

impl PointBuffer for PerAttributeVecPointStorage[src]

impl<'d> PointBuffer for InterleavedPointView<'d>[src]

impl<'d> PointBuffer for PerAttributePointView<'d>[src]

impl<'p> PointBuffer for InterleavedPointBufferSlice<'p>[src]

impl<'p> PointBuffer for PerAttributePointBufferSlice<'p>[src]

impl<'p> PointBuffer for PerAttributePointBufferSliceMut<'p>[src]

Loading content...