ParaView:Live Data Introduction

From KitwarePublic
Jump to navigationJump to search

Discussion

The livedata feature only works with a pvd file. A brief review: a pvd file lists other files that, together, contain the data for several time steps. The pvd file may also list several files that, together, contain the data for the parts of each time step.

The livedata feature expects the pvd file to describe all time steps even though, at the start, most will not yet exist. PV typically complains about the missing files; those warnings have been disabled. You must create a pvd file that describes all possible time steps. It does not matter if the pvd file references time steps that are never created.

The main change to the code is a new routine, called from the animation play method, that checks whether the next time step (i.e., the file(s) containing that time step) are present. When the files are present the animation continues on to the next step. Otherwise, the animation is stopped. Only the existence of a file is checked - an empty or partial file will fool this feature.

When the animation loop option is off, and the livedata feature stops the animation, it simply stops. However, when the animation loop option is on, the animation restarts so that the most recent N timesteps are shown. N is set in the livedata.txt file.

This incarnation of the livedata feature is not very smart. It does not get information about the pvd file directly. Instead, you must provide information about the pvd file via another file, livedata.txt.

Usage

The file livedata.txt MUST be edited to describe the pvd file and it must be located in the directory from which you start PV. Comments in the sample file explain its contents. The code that reads this file is dumb - you MUST put things on the correct line, as in the sample file, with no extra spaces.

Wait until the application has written the pvd file and the first time step. Then open the pvd file or, if you have one, load a pvs file.

Set the animation loop feature on (a small button with a circular arrow).

Start the animation. This is the time when the file timedata.txt is read. If you stop the animation and then restart it later the file is read again. This is how you can change things, if needed, without restarting PV.

If the file livedata.txt cannot be found the livedata feature is turned off for that execution of the animation; no messages are printed. If the file is found then problems with its content, if any, are printed to the screen. If no problems are found its contents are printed to the screen for your amusement.

You can stop the animation at any time and jump to any desired frame. When you restart the animation it will begin at the current frame. Usually.

One bug (I think it is in the VTK part) causes the value of time that is shown to occasionally jump ahead when at the last one or two time steps. However, the data that is displayed is correct.

DO NOT change the default mode of animation (sequence), the default number of frames (taken from the PVD file) or anything else concerning the animation. If you do and it works I will take credit for doing a good job; if it fails it is your fault!

Changes

The new code is in the vtkAnimationScene class. vtkExecutive and vtkXMLReader.cxx were also changed to supress the warnings caused by the references in the pvd file to files that do not yet exist.

Tested with version 2.4.4. The following files are affected:

  <source>/VTK/Common/vtkAnimationScene.cxx
  <source>/VTK/Common/vtkAnimationScene.h
  <source>/VTK/IO/vtkXMLReader.cxx
  <source>/VTK/Filtering/vtkExecutive.cxx



ParaView: [Welcome | Site Map]