Skip to main content

CellArray

Struct CellArray 

Source
pub struct CellArray { /* private fields */ }
Expand description

Storage for cell topology using offsets + connectivity arrays. Uses Arc<Vec> for zero-copy clone with copy-on-write semantics.

Implementations§

Source§

impl CellArray

Source

pub fn new() -> Self

Source

pub fn from_raw(offsets: Vec<i64>, connectivity: Vec<i64>) -> Self

Create a CellArray from raw offsets and connectivity.

Source

pub fn from_triangles(tris: &[[i64; 3]]) -> Self

Create a CellArray from triangle index arrays.

Source

pub fn from_quads(quads: &[[i64; 4]]) -> Self

Create a CellArray from quad index arrays.

Source

pub fn push_cell(&mut self, point_ids: &[i64])

Append a cell with the given point indices.

Source

pub fn num_cells(&self) -> usize

Source

pub fn cell(&self, idx: usize) -> &[i64]

Returns the point indices for cell idx.

Source

pub fn is_empty(&self) -> bool

Source

pub fn offsets(&self) -> &[i64]

Source

pub fn connectivity(&self) -> &[i64]

Source

pub fn connectivity_len(&self) -> usize

Total number of point index entries across all cells.

Source

pub fn clear(&mut self)

Source

pub fn cell_size(&self, idx: usize) -> usize

Get the number of points in cell at idx.

Source

pub fn cell_sizes(&self) -> impl Iterator<Item = usize> + '_

Iterator over cell sizes (number of points per cell).

Source

pub fn max_cell_size(&self) -> usize

Maximum cell size (max number of points in any cell).

Source

pub fn is_homogeneous(&self) -> Option<usize>

Check if all cells have the same size.

Source

pub fn iter(&self) -> CellIter<'_>

Iterate over cells, yielding a slice of point indices for each.

Trait Implementations§

Source§

impl Clone for CellArray

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CellArray

Source§

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

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

impl Default for CellArray

Source§

fn default() -> Self

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

impl<'a> IntoIterator for &'a CellArray

Source§

type Item = &'a [i64]

The type of the elements being iterated over.
Source§

type IntoIter = CellIter<'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl PartialEq for CellArray

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.