[vtk-developers] XML readers/writers with user streams
goodwin.lawlor at ucd.ie
Fri Jun 29 07:28:51 EDT 2007
Reading through vtkXMLWriter/vtkXMLReader its looks like they were coded
to allow the reading and writing of datasets to/from a user stream
instead of to/from disk.
Was there any method to do this envisioned originally?
Below is what I've got working at the moment - is there a better way?
A new class vtkStringStream is a wrapper around std::stringstream just
like vtkOutputStream wraps std::ostream. It has an additional method
Get/SetString for use with tcl,python etc. C++ can use Get/SetStream
vtkXMLReader/vtkXMLWriter has new methods Get/SetStringStream
writer SetInputConnection [cone GetOutputPort]
writer SetStringStream ss
set cone_file [ss GetString]
This is useful with Tcl's "virtual file system"...
More information about the vtk-developers