Loads a VTK file from the given path and loads all its data pieces
(file_path: P)
| 38 | |
| 39 | /// Loads a VTK file from the given path and loads all its data pieces |
| 40 | pub fn load_file<P: AsRef<Path>>(file_path: P) -> Result<Self, anyhow::Error> { |
| 41 | let file_path = file_path.as_ref(); |
| 42 | let vtk_file = read_vtk(file_path) |
| 43 | .with_context(|| anyhow!("Failed to load VTK file \"{}\"", file_path.display()))?; |
| 44 | |
| 45 | Self::from_vtk(vtk_file) |
| 46 | } |
| 47 | |
| 48 | /// Returns all pieces that could be loaded from the VTK file |
| 49 | pub fn into_pieces(self) -> Vec<DataPiece> { |
nothing calls this directly
no test coverage detected