now VTK 6 compatible
This commit is contained in:
parent
c7ac903dc7
commit
7fb1a3130a
|
@ -147,19 +147,25 @@ for file in files:
|
||||||
|
|
||||||
#--- write data -----------------------------------------------------------------------------------
|
#--- write data -----------------------------------------------------------------------------------
|
||||||
if file['name'] == 'STDIN':
|
if file['name'] == 'STDIN':
|
||||||
outWriter = vtk.vtkRectilinearGridWriter()
|
writer = vtk.vtkRectilinearGridWriter()
|
||||||
outWriter.WriteToOutputStringOn()
|
writer.WriteToOutputStringOn()
|
||||||
outWriter.SetFileTypeToASCII()
|
writer.SetFileTypeToASCII()
|
||||||
outWriter.SetHeader('# powered by '+scriptID)
|
writer.SetHeader('# powered by '+scriptID)
|
||||||
outWriter.SetInput(grid)
|
if vtk.VTK_MAJOR_VERSION <= 5:
|
||||||
outWriter.Write()
|
writer.SetInput(grid)
|
||||||
sys.stdout.write(outWriter.GetOutputString()[0:outWriter.GetOutputStringLength()])
|
else:
|
||||||
|
writer.SetInputData(grid)
|
||||||
|
writer.Write()
|
||||||
|
sys.stdout.write(writer.GetOutputString()[0:writer.GetOutputStringLength()])
|
||||||
else:
|
else:
|
||||||
(head,tail) = os.path.split(file['name'])
|
(head,tail) = os.path.split(file['name'])
|
||||||
outWriter = vtk.vtkXMLRectilinearGridWriter()
|
writer = vtk.vtkXMLRectilinearGridWriter()
|
||||||
outWriter.SetDataModeToBinary()
|
writer.SetDataModeToBinary()
|
||||||
outWriter.SetCompressorTypeToZLib()
|
writer.SetCompressorTypeToZLib()
|
||||||
outWriter.SetFileName(os.path.join(head,'mesh_'+os.path.splitext(tail)[0]
|
writer.SetFileName(os.path.join(head,'mesh_'+os.path.splitext(tail)[0]
|
||||||
+'.'+outWriter.GetDefaultFileExtension()))
|
+'.'+writer.GetDefaultFileExtension()))
|
||||||
outWriter.SetInput(grid)
|
if vtk.VTK_MAJOR_VERSION <= 5:
|
||||||
outWriter.Write()
|
writer.SetInput(grid)
|
||||||
|
else:
|
||||||
|
writer.SetInputData(grid)
|
||||||
|
writer.Write()
|
||||||
|
|
Loading…
Reference in New Issue