pub struct ParticleVtkWriter {
pub binary: bool,
pub scalar_attributes: Vec<String>,
pub include_velocity: bool,
pub include_ids: bool,
}Expand description
Writes particle data as VTK PolyData (.vtp) for visualization in ParaView.
Each particle is represented as a point; glyph scaling by radius is encoded
as a scalar array "radius" that ParaView’s Glyph filter can use.
Fields§
§binary: boolWhether to write binary VTK (faster) or ASCII (human-readable).
scalar_attributes: Vec<String>Additional scalar attribute names to include.
include_velocity: boolWhether to include velocity vectors.
include_ids: boolWhether to include particle IDs.
Implementations§
Source§impl ParticleVtkWriter
impl ParticleVtkWriter
Sourcepub fn with_binary(self) -> Self
pub fn with_binary(self) -> Self
Enable binary output.
Sourcepub fn with_scalar(self, name: impl Into<String>) -> Self
pub fn with_scalar(self, name: impl Into<String>) -> Self
Add an extra scalar attribute to write.
Sourcepub fn write_to_string(&self, ds: &ParticleDataset) -> Result<String>
pub fn write_to_string(&self, ds: &ParticleDataset) -> Result<String>
Generate VTK PolyData XML string for the given dataset.
Sourcepub fn write_to_file(&self, ds: &ParticleDataset, path: &str) -> Result<()>
pub fn write_to_file(&self, ds: &ParticleDataset, path: &str) -> Result<()>
Write to a file at path.
Trait Implementations§
Source§impl Debug for ParticleVtkWriter
impl Debug for ParticleVtkWriter
Source§impl Default for ParticleVtkWriter
impl Default for ParticleVtkWriter
Source§fn default() -> ParticleVtkWriter
fn default() -> ParticleVtkWriter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ParticleVtkWriter
impl RefUnwindSafe for ParticleVtkWriter
impl Send for ParticleVtkWriter
impl Sync for ParticleVtkWriter
impl Unpin for ParticleVtkWriter
impl UnsafeUnpin for ParticleVtkWriter
impl UnwindSafe for ParticleVtkWriter
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.