[Paraview] Import time steps using C++ reader

Nehme Bilal nehmebilal at gmail.com
Wed Aug 1 10:26:48 EDT 2012


Thank you David. I'll look at vtkTimeSourceExample.

About the threshold animation, if you animate both threshold sliders,
you're most likely not going to see anything:
for example if the array contains the values 1,2,3,4,5,6,7,8,...,150 and
you animate both sliders of threshold using the "sequence" mode of 100
frames. The threshold value at each frame will be 150/100, 2*150/100, ...,
150.
So the threshold value at each frame won't match any value on the cells or
points a not much will be displayed.
A range of threshold should be animated at each frame, instead of discrete
values.
I was able to get something like that by using an "exponentional"
interpolation on threshold range 0 and a "rample" on threshold range 1. The
second slider was slightly ahead for the first and a small range of values
was displayed at each frame.

On Tue, Jul 31, 2012 at 10:57 AM, David E DeMarle
<dave.demarle at kitware.com>wrote:

> On Mon, Jul 30, 2012 at 4:43 PM, Nehme Bilal <nehmebilal at gmail.com> wrote:
> > 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
> > ?
>
> You might want to make your reader tell VTK about the time in the
> standard way instead of encoding it as a separate point associated
> array. Then the time aware filters and animation controls will know
> what to do with it. To do so, make your reader announce the time steps
> it can produce in the RequestInformation method and respond with data
> for any particular requested time RequestData. See the
> vtkTimeSourceExample in the VTK source code for hints.
>
> > 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 can't reproduce that. Use the + button twice on the animation view
> to two tracks. For one pick the threshold filter and it's threshold
> range (0) property. For the second choose it's threshold range (1)
> property. Using the pv binary on my system I can animate a dynamic
> threshold front with the wavelet source without any problem that way.
>
> >
> > Thank you,
> >
> > Nehme
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the ParaView Wiki at:
> > http://paraview.org/Wiki/ParaView
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.paraview.org/mailman/listinfo/paraview
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120801/0cdb7399/attachment.htm>


More information about the ParaView mailing list