Skip to main content

StructuredGrid

Struct StructuredGrid 

Source
pub struct StructuredGrid {
    pub points: Points<f64>,
    /* private fields */
}
Expand description

Curvilinear grid with explicit point coordinates.

Analogous to VTK’s vtkStructuredGrid. Points are stored explicitly (unlike ImageData/RectilinearGrid), but the topology is implicitly structured as an i×j×k grid.

Fields§

§points: Points<f64>

Implementations§

Source§

impl StructuredGrid

Source

pub fn new() -> Self

Source

pub fn from_dimensions_and_points( dimensions: [usize; 3], points: Points<f64>, ) -> Self

Create a StructuredGrid with given dimensions and points. The number of points must equal nx * ny * nz.

Source

pub fn dimensions(&self) -> [usize; 3]

Source

pub fn set_dimensions(&mut self, dims: [usize; 3])

Source

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

Convert a flat point index to (i, j, k).

Source

pub fn index_from_ijk(&self, i: usize, j: usize, k: usize) -> usize

Convert (i, j, k) to a flat point index.

Source

pub fn point_data(&self) -> &DataSetAttributes

Source

pub fn point_data_mut(&mut self) -> &mut DataSetAttributes

Source

pub fn cell_data(&self) -> &DataSetAttributes

Source

pub fn cell_data_mut(&mut self) -> &mut DataSetAttributes

Source

pub fn from_function( dims: [usize; 3], f: impl Fn(usize, usize, usize) -> [f64; 3], ) -> Self

Create a structured grid from a function that maps (i,j,k) to position.

Source

pub fn uniform(dims: [usize; 3], spacing: [f64; 3], origin: [f64; 3]) -> Self

Create a uniform structured grid (same as ImageData geometry but explicit).

Source

pub fn with_point_array(self, array: AnyDataArray) -> Self

Builder: add point data.

Trait Implementations§

Source§

impl Clone for StructuredGrid

Source§

fn clone(&self) -> StructuredGrid

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 DataObject for StructuredGrid

Source§

impl DataSet for StructuredGrid

Source§

fn num_points(&self) -> usize

Source§

fn num_cells(&self) -> usize

Source§

fn point(&self, idx: usize) -> [f64; 3]

Source§

fn bounds(&self) -> BoundingBox

Source§

fn point_data(&self) -> &DataSetAttributes

Source§

fn point_data_mut(&mut self) -> &mut DataSetAttributes

Source§

fn cell_data(&self) -> &DataSetAttributes

Source§

fn cell_data_mut(&mut self) -> &mut DataSetAttributes

Source§

fn center(&self) -> [f64; 3]

Center of the bounding box.
Source§

fn diagonal(&self) -> f64

Diagonal length of the bounding box.
Source§

fn is_empty(&self) -> bool

Whether the dataset has no points.
Source§

fn num_point_arrays(&self) -> usize

Number of point data arrays.
Source§

fn num_cell_arrays(&self) -> usize

Number of cell data arrays.
Source§

impl Debug for StructuredGrid

Source§

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

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

impl Default for StructuredGrid

Source§

fn default() -> Self

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

impl Display for StructuredGrid

Source§

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

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

impl From<StructuredGrid> for AnyDataSet

Source§

fn from(d: StructuredGrid) -> Self

Converts to this type from the input type.
Source§

impl From<StructuredGrid> for Block

Source§

fn from(sg: StructuredGrid) -> Self

Converts to this type from the input type.

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.