[vtkusers] datareader/writer problem (writting multiple scalars using a vtkDataWriter)
Jose Paulo Moitinho de Almeida
moitinho at civil.ist.utl.pt
Fri Mar 22 03:50:19 EST 2002
On Tuesday 19 March 2002 13:02, Simon Faust wrote:
> Hi
> I'm trying to read a rectilineargrid vtk file in order to write it to
> binary format. Problems result from the fact that there are a few
> scalarfields in the original, but allways just one in the file writen by
> the writer. How could i handle the different scalarfields.
> When I write ascii files with my writer there is the same problem. here
> some code fragments:
>
> vtkRectilinearGridReader reader
> reader SetFileName "multipleScalarsFields.vtk"
>
> vtkRectilinearGridWriter writer
> writer SetInput [reader GetOutput]
> writer SetFileName "OutmultipleScalarsFields.vtk"
> writer SetFileType 1
> writer Write
>
> the scalar fields are named scalar0, scalar1 etc., many thanks for any
> hints
I managed to solve a similar problem by reopening the output file and
writing the other point scalars on my own.
I looked at the info and tried to use the WriteHeader, WritePoints,
WriteCells, etc, functions, but could not make my program (in python) work
that way.
I think that another alternative may be to use FIELD data. The examples in
Graphics/Testing/Tcl may help.... Understanding field data will certainly
help.
Regards
Ze Paulo
More information about the vtkusers
mailing list