[vtkusers] vtkDataWriter and Java

Thomas Krueger krueger at techinfo.rwth-aachen.de
Tue Aug 7 08:24:07 EDT 2001


Hi,
I used the vtkPolyDataWriter (and the vtkDataWriter) with Java for storing
object information in a byte array. This worked fine with the vtk 3.2. Since I
now use the vtkNightly, I have the problem, that the GetBinaryOutputString()
method has disappeared.

public byte[] writeVTKDataToByte() {
    vtkPanel libLoader = new vtkPanel();
    vtkPolyDataWriter theWriter = new vtkPolyDataWriter();
    theWriter.SetInput(data);             // data is a vtkPolyData

    theWriter.SetFileTypeToBinary();
    theWriter.WriteToOutputStringOn();
    theWriter.Write();

    // this has to be replaced, but how??
    return theWriter.GetBinaryOutputString();
} // works with vtk 3.2 but fails with vtk Nightly

The use of Strings:
public String writeVTKDataToString() {
    ...
    theWriter.SetFileTypeToASCII();
    ...
    return theWriter.GetOutputString();
}

is not possible since the vtkDataWriter reports an error:
ERROR: In vtkDataWriter.cxx, line 915
vtkPolyDataWriter (0x??????????): OutputString was not long enough.

Who can help me with these problems?

Thanks,
Tom




More information about the vtkusers mailing list