File: IOXMLInformationFormat.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 (121 lines) | stat: -rw-r--r-- 2,450 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# VTK XML Reader/Writer Information Format

## Overview

The vtk xml data file readers / writers store certain `vtkInformation`
entries that are set on `vtkAbstractArray`'s `GetInformation()` object. Support
is currently limited to numeric and string information keys, both single- and
vector-valued. Only the information objects attached to arrays are written/read.

## Array Information

Array information is embedded in the `<DataArray>` XML element as a series of
`<InformationKey>` elements. The required attributes `name` and `location`
specify the name and location strings associated with the key -- for instance,
the `vtkDataArray::UNITS_LABEL()` key has `name="UNITS_LABEL"` and
`location="vtkDataArray"`. The `length` attribute is required for vector keys.

```{code-block} xml
:force: true
<DataArray [...]>
  <InformationKey name="KeyName" location="KeyLocation" [ length="N" ]>
    [...]
  </InformationKey>
  <InformationKey [...]>
    [...]
  </InformationKey>
  [...]
</DataArray>
```

Specific examples of supported key types:

### vtkInformationDoubleKey

```xml
<InformationKey name="Double" location="XMLTestKey">
  1
</InformationKey>
```

### vtkInformationDoubleVectorKey

```xml
<InformationKey name="DoubleVector" location="XMLTestKey" length="3">
  <Value index="0">
    1
  </Value>
  <Value index="1">
    90
  </Value>
  <Value index="2">
    260
  </Value>
</InformationKey>
```

### vtkInformationIdTypeKey

```xml
<InformationKey name="IdType" location="XMLTestKey">
  5
</InformationKey>
```

### vtkInformationStringKey

```xml
<InformationKey name="String" location="XMLTestKey">
  Test String!
Line2
</InformationKey>
```

### vtkInformationIntegerKey

```xml
<InformationKey name="Integer" location="XMLTestKey">
  408
</InformationKey>
```

### vtkInformationIntegerVectorKey

```xml
<InformationKey name="IntegerVector" location="XMLTestKey" length="3">
  <Value index="0">
    1
  </Value>
  <Value index="1">
    5
  </Value>
  <Value index="2">
    45
  </Value>
</InformationKey>
```

### vtkInformationStringVectorKey

```xml
<InformationKey name="StringVector" location="XMLTestKey" length="3">
  <Value index="0">
    First
  </Value>
  <Value index="1">
    Second (with whitespace!)
  </Value>
  <Value index="2">
    Third (with
newline!)
  </Value>
</InformationKey>
```

### vtkInformationUnsignedLongKey

```xml
<InformationKey name="UnsignedLong" location="XMLTestKey">
  9
</InformationKey>
```