PointBlock

Struct PointBlock 

Source
pub struct PointBlock {
    pub len: usize,
    /* private fields */
}
Expand description

SoA (Structure of Arrays) storage for point cloud data.

Internally uses Vec for O(1) index-based access, with a HashMap for name-based lookups. This provides efficient iteration while maintaining backwards-compatible named access.

Fields§

§len: usize

Number of points

Implementations§

Source§

impl PointBlock

Source

pub fn new(schema: &Vec<(String, ValueType)>, capacity: usize) -> Self

Source

pub fn resize(&mut self, new_len: usize)

Source

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.

Source

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.

Source

pub fn get_column_by_index(&self, index: usize) -> Option<&Column>

O(1) indexed access to a column.

Source

pub fn get_column_mut_by_index(&mut self, index: usize) -> Option<&mut Column>

O(1) mutable indexed access to a column.

Source

pub fn get_column_index(&self, name: &str) -> Option<usize>

Get the index of a column by name.

Source

pub fn schema(&self) -> &[String]

Get the schema (field names in order).

Source

pub fn num_columns(&self) -> usize

Number of columns.

Source

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.

Source

pub fn columns(&self) -> &[Column]

Access underlying columns slice (for iteration).

Source

pub fn columns_mut(&mut self) -> &mut [Column]

Access underlying columns mutably.

Source

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.

Source

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.

Source

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.

Source

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
Source

pub fn xyzirt(&self) -> Option<(&[f32], &[f32], &[f32], &[f32], &[u16], &[f64])>

Get XYZ + intensity + ring + timestamp (full LiDAR format). Returns None if any column is missing or has wrong type.

  • intensity: F32
  • ring: U16
  • timestamp: F64
Source

pub fn xyzirt_id( &self, ) -> Option<(&[f32], &[f32], &[f32], &[f32], &[u16], &[f64], &[u32])>

Get XYZIRT + id (LiDAR format with point ID/label). Returns None if any column is missing or has wrong type.

  • intensity: F32
  • ring: U16
  • timestamp: F64
  • id: U32

Trait Implementations§

Source§

impl Debug for PointBlock

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PointBlock

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.