pub struct PointBlock {
pub len: usize,
/* private fields */
}Expand description
SoA (Structure of Arrays) storage for point cloud data.
Internally uses Vec
Fields§
§len: usizeNumber of points
Implementations§
Source§impl PointBlock
impl PointBlock
pub fn new(schema: &Vec<(String, ValueType)>, capacity: usize) -> Self
pub fn resize(&mut self, new_len: usize)
Sourcepub fn get_column(&self, name: &str) -> Option<&Column>
pub fn get_column(&self, name: &str) -> Option<&Column>
Get a column by name (backwards-compatible API).
For performance-critical code, prefer get_column_by_index.
Sourcepub fn get_column_mut(&mut self, name: &str) -> Option<&mut Column>
pub fn get_column_mut(&mut self, name: &str) -> Option<&mut Column>
Get a mutable column by name (backwards-compatible API).
For performance-critical code, prefer get_column_mut_by_index.
Sourcepub fn get_column_by_index(&self, index: usize) -> Option<&Column>
pub fn get_column_by_index(&self, index: usize) -> Option<&Column>
O(1) indexed access to a column.
Sourcepub fn get_column_mut_by_index(&mut self, index: usize) -> Option<&mut Column>
pub fn get_column_mut_by_index(&mut self, index: usize) -> Option<&mut Column>
O(1) mutable indexed access to a column.
Sourcepub fn get_column_index(&self, name: &str) -> Option<usize>
pub fn get_column_index(&self, name: &str) -> Option<usize>
Get the index of a column by name.
Sourcepub fn num_columns(&self) -> usize
pub fn num_columns(&self) -> usize
Number of columns.
Sourcepub fn get_columns_mut(&mut self, names: &[String]) -> Option<Vec<&mut Column>>
pub fn get_columns_mut(&mut self, names: &[String]) -> Option<Vec<&mut Column>>
Optimized: Get multiple mutable columns simultaneously. Returns None if any column is missing or if names contain duplicates. This avoids O(N*M) lookup inside tight loops.
Sourcepub fn columns_mut(&mut self) -> &mut [Column]
pub fn columns_mut(&mut self) -> &mut [Column]
Access underlying columns mutably.
Sourcepub fn xyz(&self) -> Option<(&[f32], &[f32], &[f32])>
pub fn xyz(&self) -> Option<(&[f32], &[f32], &[f32])>
Get XYZ coordinates as f32 slices. Returns None if any of x, y, z columns are missing or not F32.
Sourcepub fn xyzi(&self) -> Option<(&[f32], &[f32], &[f32], &[f32])>
pub fn xyzi(&self) -> Option<(&[f32], &[f32], &[f32], &[f32])>
Get XYZ + intensity as f32 slices. Returns None if any column is missing or has wrong type.
Sourcepub fn xyzrgb(&self) -> Option<(&[f32], &[f32], &[f32], &[u32])>
pub fn xyzrgb(&self) -> Option<(&[f32], &[f32], &[f32], &[u32])>
Get XYZ + RGB (packed as u32) slices. Returns None if any column is missing or has wrong type.
Sourcepub fn xyzir(&self) -> Option<(&[f32], &[f32], &[f32], &[f32], &[u16])>
pub fn xyzir(&self) -> Option<(&[f32], &[f32], &[f32], &[f32], &[u16])>
Get XYZ + intensity + ring (common LiDAR format). Returns None if any column is missing or has wrong type.
- intensity: F32
- ring: U16