[vtkusers] vtkXMLPUnstructuredGridWriter() howto?

Favre Jean jfavre at cscs.ch
Fri Aug 27 09:04:42 EDT 2010



________________________________________

I fixed the extent, but still only Test.pvti and Test_0.vti are generated:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/IO/XMLPImageDataWriter

---------------------------------------------------------------------

You need to insert a streamer into your pipeline.

here is the Python code:

N = 4

drawing = vtkImageCanvasSource2D()
drawing.SetNumberOfScalarComponents(3)
drawing.SetScalarTypeToUnsignedChar()
drawing.SetExtent(0, 50, 0, 50, 0, 0)
drawing.SetDrawColor(255.0, 255.0, 255.0, 255.0)
drawing.DrawCircle(25, 25, 10)

streamer = vtkImageDataStreamer()
streamer.SetInputConnection(drawing.GetOutputPort())

writer = vtkXMLPImageDataWriter()
writer.SetInputConnection(streamer.GetOutputPort())
writer.SetFileName("Test.pvti")
writer.SetNumberOfPieces(N)
writer.SetEndPiece(N-1)
writer.SetStartPiece(0)
writer.Write()

-----------------
Jean M. Favre
Swiss National Supercomputing Center



More information about the vtkusers mailing list