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
impl StructuredGrid
pub fn new() -> Self
Sourcepub fn from_dimensions_and_points(
dimensions: [usize; 3],
points: Points<f64>,
) -> Self
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.
pub fn dimensions(&self) -> [usize; 3]
pub fn set_dimensions(&mut self, dims: [usize; 3])
Sourcepub fn ijk_from_index(&self, idx: usize) -> (usize, usize, usize)
pub fn ijk_from_index(&self, idx: usize) -> (usize, usize, usize)
Convert a flat point index to (i, j, k).
Sourcepub fn index_from_ijk(&self, i: usize, j: usize, k: usize) -> usize
pub fn index_from_ijk(&self, i: usize, j: usize, k: usize) -> usize
Convert (i, j, k) to a flat point index.
pub fn point_data(&self) -> &DataSetAttributes
pub fn point_data_mut(&mut self) -> &mut DataSetAttributes
pub fn cell_data(&self) -> &DataSetAttributes
pub fn cell_data_mut(&mut self) -> &mut DataSetAttributes
Sourcepub fn from_function(
dims: [usize; 3],
f: impl Fn(usize, usize, usize) -> [f64; 3],
) -> Self
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.
Sourcepub fn uniform(dims: [usize; 3], spacing: [f64; 3], origin: [f64; 3]) -> Self
pub fn uniform(dims: [usize; 3], spacing: [f64; 3], origin: [f64; 3]) -> Self
Create a uniform structured grid (same as ImageData geometry but explicit).
Sourcepub fn with_point_array(self, array: AnyDataArray) -> Self
pub fn with_point_array(self, array: AnyDataArray) -> Self
Builder: add point data.
Trait Implementations§
Source§impl Clone for StructuredGrid
impl Clone for StructuredGrid
Source§fn clone(&self) -> StructuredGrid
fn clone(&self) -> StructuredGrid
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl DataObject for StructuredGrid
impl DataObject for StructuredGrid
fn field_data(&self) -> &FieldData
fn field_data_mut(&mut self) -> &mut FieldData
Source§impl DataSet for StructuredGrid
impl DataSet for StructuredGrid
fn num_points(&self) -> usize
fn num_cells(&self) -> usize
fn point(&self, idx: usize) -> [f64; 3]
fn bounds(&self) -> BoundingBox
fn point_data(&self) -> &DataSetAttributes
fn point_data_mut(&mut self) -> &mut DataSetAttributes
fn cell_data(&self) -> &DataSetAttributes
fn cell_data_mut(&mut self) -> &mut DataSetAttributes
Source§fn num_point_arrays(&self) -> usize
fn num_point_arrays(&self) -> usize
Number of point data arrays.
Source§fn num_cell_arrays(&self) -> usize
fn num_cell_arrays(&self) -> usize
Number of cell data arrays.
Source§impl Debug for StructuredGrid
impl Debug for StructuredGrid
Source§impl Default for StructuredGrid
impl Default for StructuredGrid
Source§impl Display for StructuredGrid
impl Display for StructuredGrid
Source§impl From<StructuredGrid> for AnyDataSet
impl From<StructuredGrid> for AnyDataSet
Source§fn from(d: StructuredGrid) -> Self
fn from(d: StructuredGrid) -> Self
Converts to this type from the input type.
Source§impl From<StructuredGrid> for Block
impl From<StructuredGrid> for Block
Source§fn from(sg: StructuredGrid) -> Self
fn from(sg: StructuredGrid) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for StructuredGrid
impl RefUnwindSafe for StructuredGrid
impl Send for StructuredGrid
impl Sync for StructuredGrid
impl Unpin for StructuredGrid
impl UnsafeUnpin for StructuredGrid
impl UnwindSafe for StructuredGrid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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