[][src]Crate vtkio

vtkio

Import and export library for Visualization Toolkit (VTK) files.

Legacy .vtk files as well as modern XML formats are supported. Both "serial" and "parallel" XML files are supported with facilities for lazily loading.

Examples

Many sample files can be found in the assets directory. For the following example, we will load a VTK file named tet.vtk, modify it and write it back in Legacy ASCII format.

use vtkio::model::*; // import model definition of a VTK file
use vtkio::{import, export_ascii};
fn main() {
    use std::path::PathBuf;
    let file_path = PathBuf::from("assets/tet.vtk");

    let mut vtk_file = import(&file_path)
        .expect(&format!("Failed to load file: {:?}", file_path));

    vtk_file.version = Version::new((4,2)); // arbitrary change

    export_ascii(vtk_file, &file_path)
        .expect(&format!("Failed to save file: {:?}", file_path));
}

Re-exports

pub use model::IOBuffer;

Modules

basic
model

VTK Data Model

parser
writer
xml

Internal APIs for dealing with XML VTK file types.

Macros

match_buf

Evaluate the expression $e given a Vec $v.

Enums

Error

Error type for Import/Export operations.

Functions

export

Export given Vtk file to the specified file.

export_ascii

Export given vtk data to the specified file in ASCII format.

export_be

Export the given Vtk file to the specified file in big endian binary format.

export_le

Export the given Vtk file to the specified file in little endian binary format.

import

Import a VTK file at the specified path.

import_be

Import a legacy VTK file at the specified path.

import_le

Import a legacy VTK file at the specified path.