[Paraview] Import time steps using C++ reader

Nehme Bilal nehmebilal at gmail.com
Mon Jul 30 16:43:03 EDT 2012


Hello,

I am trying to make a C++ reader for a point set file containing time steps.
The output of the reader is a vtkPolyData.

The file format is similar to:
x1,y1,z1,prop1,prop2,...,time

I would like to import the field "time" as time steps, in order to animate
using "snap to time steps" mode.

The code looks like:

    vtkPolyData *output =
vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));

    Loop:
            time = readTime();
            coords = readCoords();

            vtkIdType id = outPoints->InsertNextPoint(coords[0], coords[1],
coords[2]);
            outCells->InsertNextCell(1);
            outCells->InsertCellPoint(id);

    output->SetPoints(outPoints);
    output->SetVerts(outCells);

Assuming time is an integer, how do I insert the time steps into the output
?

I tried to import the time as an "int property" instead of time steps and
animate using threshold, but I can't display one time step at a time
because only one slider is animated. I tried a threshold on a threshold to
animate 2 sliders but couldn't get the exact effect that "snap to time
steps" would give if I had time steps.

Thank you,

Nehme
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120730/d0bdb761/attachment.htm>


More information about the ParaView mailing list