pub struct VtkUnstructuredGrid {
pub points: Vec<[f64; 3]>,
pub cells: Vec<Vec<usize>>,
pub cell_types: Vec<VtkCellTypeW>,
pub point_data: Vec<VtkDataArrayW>,
pub cell_data: Vec<VtkDataArrayW>,
}Expand description
An unstructured grid for VTK output.
Build up the grid with add_point and
add_cell, attach field data with the
add_point_* / add_cell_* helpers, then serialise with
LegacyVtkWriter::write or XmlVtuWriter::write.
Fields§
§points: Vec<[f64; 3]>3-D coordinates of every point.
cells: Vec<Vec<usize>>Cell connectivity (variable-length point-index lists).
cell_types: Vec<VtkCellTypeW>VTK cell type for each cell (parallel to cells).
point_data: Vec<VtkDataArrayW>Per-vertex data arrays.
cell_data: Vec<VtkDataArrayW>Per-cell data arrays.
Implementations§
Source§impl VtkUnstructuredGrid
impl VtkUnstructuredGrid
Sourcepub fn add_point(&mut self, p: [f64; 3]) -> usize
pub fn add_point(&mut self, p: [f64; 3]) -> usize
Append a point and return its zero-based index.
Sourcepub fn add_cell(&mut self, connectivity: Vec<usize>, cell_type: VtkCellTypeW)
pub fn add_cell(&mut self, connectivity: Vec<usize>, cell_type: VtkCellTypeW)
Append a cell defined by connectivity (point indices) and a cell_type.
Sourcepub fn add_point_scalars(&mut self, name: &str, values: Vec<f64>)
pub fn add_point_scalars(&mut self, name: &str, values: Vec<f64>)
Attach a per-point scalar field.
Sourcepub fn add_point_vectors(&mut self, name: &str, values: Vec<[f64; 3]>)
pub fn add_point_vectors(&mut self, name: &str, values: Vec<[f64; 3]>)
Attach a per-point vector field.
Sourcepub fn add_cell_scalars(&mut self, name: &str, values: Vec<f64>)
pub fn add_cell_scalars(&mut self, name: &str, values: Vec<f64>)
Attach a per-cell scalar field.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VtkUnstructuredGrid
impl RefUnwindSafe for VtkUnstructuredGrid
impl Send for VtkUnstructuredGrid
impl Sync for VtkUnstructuredGrid
impl Unpin for VtkUnstructuredGrid
impl UnsafeUnpin for VtkUnstructuredGrid
impl UnwindSafe for VtkUnstructuredGrid
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.