Struct pasture_core::containers::PerAttributeVecPointStorage [−][src]
PointBuffer
type that uses PerAttribute memory layout and Vec
-based owning storage for point data
Implementations
impl PerAttributeVecPointStorage
[src]
pub fn new(layout: PointLayout) -> Self
[src]
Creates a new empty PerAttributeVecPointStorage
with the given PointLayout
Examples
let layout = PointLayout::from_attributes(&[attributes::POSITION_3D]); let storage = PerAttributeVecPointStorage::new(layout);
pub fn with_capacity(capacity: usize, layout: PointLayout) -> Self
[src]
Creates a new PerAttributeVecPointStorage
with enough capacity to store capacity
points using
the given PointLayout
. Calling this method is similar to Vec::with_capacity
: Internal memory
is reserved but the len()
is not affected.
Examples
let layout = PointLayout::from_attributes(&[attributes::POSITION_3D]); let storage = PerAttributeVecPointStorage::with_capacity(16, layout);
pub fn push_point<T: PointType>(&mut self, point: T)
[src]
Pushes a single point into the associated PerAttributeVecPointStorage
.
Examples
#[repr(C)] #[derive(PointType)] struct MyPointType(#[pasture(BUILTIN_INTENSITY)] u16); { let mut storage = PerAttributeVecPointStorage::new(MyPointType::layout()); storage.push_point(MyPointType(42)); }
Panics
If the PointLayout
of type T
does not match the layout of the associated PerAttributeVecPointStorage
.
pub fn push_points<T: PointType>(&mut self, points: &[T])
[src]
Pushes a range of points into the associated PerAttributeVecPointStorage
.
Examples
#[repr(C)] #[derive(PointType)] struct MyPointType(#[pasture(BUILTIN_INTENSITY)] u16); { let mut storage = PerAttributeVecPointStorage::new(MyPointType::layout()); storage.push_points(&[MyPointType(42), MyPointType(43)]); }
Panics
If the PointLayout
of type T
does not match the layout of the associated PerAttributeVecPointStorage
.
pub fn begin_push_attributes(&mut self) -> PerAttributeVecPointStoragePusher<'_>
[src]
Create a builder for pushing attribute data into the associated PerAttributeVecPointStorage
one by one
pub fn sort_by_attribute<T: PrimitiveType + Ord>(
&mut self,
attribute: &PointAttributeDefinition
)
[src]
&mut self,
attribute: &PointAttributeDefinition
)
Sorts all points in the associated PerAttributePointBuffer
using the order of the PointType
T
.
Panics
If the PointLayout
of T
does not match the underlying layout
pub fn par_sort_by_attribute<T: PrimitiveType + Ord>(
&mut self,
attribute: &PointAttributeDefinition
)
[src]
&mut self,
attribute: &PointAttributeDefinition
)
Like sort_by_attribute
, but sorts each attribute in parallel. Uses the rayon
crate for parallelization
pub fn reserve(&mut self, additional_points: usize)
[src]
Reserves space for at least additional_points
additional points in the associated PerAttributeVecPointStorage
Trait Implementations
impl<T: PointType> From<&'_ [T]> for PerAttributeVecPointStorage
[src]
impl<T: PointType> From<&'_ mut [T]> for PerAttributeVecPointStorage
[src]
impl<T: PointType> From<Vec<T, Global>> for PerAttributeVecPointStorage
[src]
impl<T: PointType> FromIterator<T> for PerAttributeVecPointStorage
[src]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
[src]
impl PerAttributePointBuffer for PerAttributeVecPointStorage
[src]
fn get_raw_attribute_ref(
&self,
point_index: usize,
attribute: &PointAttributeDefinition
) -> &[u8]
[src]
&self,
point_index: usize,
attribute: &PointAttributeDefinition
) -> &[u8]
fn get_raw_attribute_range_ref(
&self,
index_range: Range<usize>,
attribute: &PointAttributeDefinition
) -> &[u8]
[src]
&self,
index_range: Range<usize>,
attribute: &PointAttributeDefinition
) -> &[u8]
fn slice(&self, range: Range<usize>) -> PerAttributePointBufferSlice<'_>
[src]
impl<'p> PerAttributePointBufferMut<'p> for PerAttributeVecPointStorage
[src]
fn get_raw_attribute_mut(
&mut self,
point_index: usize,
attribute: &PointAttributeDefinition
) -> &mut [u8]
[src]
&mut self,
point_index: usize,
attribute: &PointAttributeDefinition
) -> &mut [u8]
fn get_raw_attribute_range_mut(
&mut self,
index_range: Range<usize>,
attribute: &PointAttributeDefinition
) -> &mut [u8]
[src]
&mut self,
index_range: Range<usize>,
attribute: &PointAttributeDefinition
) -> &mut [u8]
fn slice_mut(
&'p mut self,
range: Range<usize>
) -> PerAttributePointBufferSliceMut<'p>
[src]
&'p mut self,
range: Range<usize>
) -> PerAttributePointBufferSliceMut<'p>
fn disjunct_slices_mut<'b>(
&'b mut self,
ranges: &[Range<usize>]
) -> Vec<PerAttributePointBufferSliceMut<'p>> where
'p: 'b,
[src]
&'b mut self,
ranges: &[Range<usize>]
) -> Vec<PerAttributePointBufferSliceMut<'p>> where
'p: 'b,
fn as_per_attribute_point_buffer(&self) -> &dyn PerAttributePointBuffer
[src]
impl PointBuffer for PerAttributeVecPointStorage
[src]
fn get_raw_point(&self, point_index: usize, buf: &mut [u8])
[src]
fn get_raw_attribute(
&self,
point_index: usize,
attribute: &PointAttributeDefinition,
buf: &mut [u8]
)
[src]
&self,
point_index: usize,
attribute: &PointAttributeDefinition,
buf: &mut [u8]
)
fn get_raw_points(&self, point_indices: Range<usize>, buf: &mut [u8])
[src]
fn get_raw_attribute_range(
&self,
point_indices: Range<usize>,
attribute: &PointAttributeDefinition,
buf: &mut [u8]
)
[src]
&self,
point_indices: Range<usize>,
attribute: &PointAttributeDefinition,
buf: &mut [u8]
)
fn len(&self) -> usize
[src]
fn point_layout(&self) -> &PointLayout
[src]
fn as_per_attribute(&self) -> Option<&dyn PerAttributePointBuffer>
[src]
fn is_empty(&self) -> bool
[src]
fn as_interleaved(&self) -> Option<&dyn InterleavedPointBuffer>
[src]
impl PointBufferWriteable for PerAttributeVecPointStorage
[src]
fn push(&mut self, points: &dyn PointBuffer)
[src]
fn splice(&mut self, range: Range<usize>, replace_with: &dyn PointBuffer)
[src]
fn clear(&mut self)
[src]
Auto Trait Implementations
impl RefUnwindSafe for PerAttributeVecPointStorage
impl Send for PerAttributeVecPointStorage
impl Sync for PerAttributeVecPointStorage
impl Unpin for PerAttributeVecPointStorage
impl UnwindSafe for PerAttributeVecPointStorage
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,
pub 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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,