WIP: Addition of Rectilinear and Uniform grid writer.
Don't examine this yet; it's still garbage. Looking through the .vtk
file spec shows that this is somewhat more complicated than I'd hoped, and therefore I'm putting this half-baked code out in public to shame myself into finishing it!
Will fix #507 and partially fix #512 (closed).
The VTKDataSetWriter
class is now removed, as it had only one static method Write
. Normally when examining a class that takes a filename as a constructor and allows multiple calls to a Write
, I would expect append behavior, but instead the class performs truncation. In addition, the constructor is trivial, so as @nadavi points out, there's really no need to break this into two calls.
The new implementation is just a pure function, which accepts a vtkm::cont::DataSet
, a std::string const & filename
(sadly, not yet a std::filesystem::path
), and a std::string const & description
. The description is put into Part 2 of the file, and is mandatory.
Previously, in a discussion I can't find, @robertmaynard had indicated that throwing exceptions from a write routine was frowned upon, which I agree with. Therefore, I've performed logging and returned error codes and begun to remove all throws.