File: IOXMLTimeInFieldData.md

package info (click to toggle)
vtk9 9.5.2%2Bdfsg4-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 206,640 kB
  • sloc: cpp: 2,340,827; ansic: 327,116; python: 114,881; yacc: 4,104; java: 3,977; sh: 3,032; xml: 2,771; perl: 2,189; lex: 1,787; javascript: 1,261; makefile: 194; objc: 153; tcl: 59
file content (32 lines) | stat: -rw-r--r-- 1,451 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Field Data as Time Meta-Data in VTK XML File Formats

As of VTK 8.2, VTK XML readers and writers support embedding time
meta-data as a field array. This is demonstrated best with an example:

```xml
<VTKFile type="PolyData" version="1.0" byte_order="LittleEndian" header_type="UInt64">
  <PolyData>
    <FieldData>
      <DataArray type="Float64" Name="TimeValue" NumberOfTuples="1">1.24
      </DataArray>
    </FieldData>
    ...
</VTKFile>
```

Here TimeValue is a regular double precision array that has a single value of 1.24.
The XML readers will treat this array in a special way. When they encounter this array
during the meta-data stage (`RequestInformation()`), they will read the value from
this array and generate a `vtkStreamingDemandDrivenPipeline::TIME_STEPS()` key
in the output information containing this value.

In addition, the XML writers will generate a field array of name TimeValue in the
output, if they encounter time value in their input (`vtkDataObject::DATA_TIME_STEP()`).
This is done even if the data does not have a TimeValue array. Furthermore, even such
an array exists, it will be replaced with one that contains the value from
`vtkDataObject::DATA_TIME_STEP()` to make sure that the value is consistent with the
pipeline value.

This change may appear pointless on its own as a single time value is not very useful.
Its main use is when reading file series as it is done by ParaView's file (time) series
readers.