VTK
/build/vtk7-70qs80/vtk7-7.1.1+dfsg1/Documentation/Doxygen/IOLegacyInformationFormat.md
Go to the documentation of this file.
1 @page IOLegacyInformationFormat VTK Legacy Reader/Writer Information Format
2 @tableofcontents
3 
4 # Overview #
5 
6 The legacy vtk data file readers / writers store certain `vtkInformation`
7 entries that are set on `vtkAbstractArray`'s `GetInformation()` object. Support
8 is currently limited to numeric and string information keys, both single- and
9 vector-valued. Only the information objects attached to arrays are encoded.
10 
11 # Array Metadata Blocks #
12 
13 A block of metadata may immediately follow the specification of an array.
14 Whitespace is permitted between the array data and the opening `METADATA` tag.
15 The metadata block is terminated by an empty line..
16 
17 ```
18 # vtk DataFile Version 4.1
19 vtk output
20 ASCII
21 DATASET UNSTRUCTURED_GRID
22 POINTS 6 float
23 0 0 0 1 0 0 0.5 1 0
24 0.5 0.5 1 0.5 -1 0 0.5 -0.5 1
25 
26 METADATA
27 COMPONENT_NAMES
28 X%20coordinates
29 Y%20coordinates
30 Z%20coordinates
31 INFORMATION 8
32 NAME Double LOCATION TestKey
33 DATA 1
34 NAME DoubleVector LOCATION TestKey
35 DATA 3 1 90 260
36 NAME IdType LOCATION TestKey
37 DATA 5
38 NAME String LOCATION TestKey
39 DATA Test%20String!%0ALine2
40 NAME Integer LOCATION TestKey
41 DATA 408
42 NAME IntegerVector LOCATION TestKey
43 DATA 3 1 5 45
44 NAME StringVector LOCATION TestKey
45 DATA 3
46 First
47 Second%20(with%20whitespace!)
48 Third%20(with%0Anewline!)
49 NAME UnsignedLong LOCATION TestKey
50 DATA 9
51 
52 CELLS 3 15
53 4 0 1 2 3
54 4 0 4 1 5
55 4 5 3 1 0
56 
57 CELL_TYPES 3
58 10
59 10
60 10
61 
62 CELL_DATA 3
63 FIELD FieldData 1
64 vtkGhostType 1 3 unsigned_char
65 0 1 1
66 METADATA
67 COMPONENT_NAMES
68 Ghost%20level%20information
69 INFORMATION 1
70 NAME UNITS_LABEL LOCATION vtkDataArray
71 DATA radians
72 
73 ```
74 
75 As shown, a metadata block can have two sections, `COMPONENT_NAMES` and
76 `INFORMATION`. The `INFORMATION` tag is followed by the number of information
77 keys that follow.
78 
79 ## COMPONENT_NAMES ##
80 
81 If the `METADATA` block contains the line `COMPONENT_NAMES`, the following lines
82 are expected to be encoded strings containing the names of each component. There
83 must be one line per component.
84 
85 ## INFORMATION ##
86 
87 If the `METADATA` block contains the line `INFORMATION`, the number of information
88 keys is read from the INFORMATION line and `vtkInformation` data that follows is
89 parsed. The general form of a single valued information entry is:
90 
91 ```
92 NAME [key name] LOCATION [key location (e.g. class name)]
93 DATA [value]
94 ```
95 
96 A vector information key is generally represented as:
97 
98 ```
99 NAME [key name] LOCATION [key location (e.g. class name)]
100 DATA [vector length] [value0] [value1] [value2] ...
101 ```
102 
103 The exception is a string vector, which contains encoded entries separated by
104 newlines.
105 
106 Specific examples of supported key types:
107 
108 ### vtkInformationDoubleKey ###
109 
110 ```
111 NAME Double LOCATION TestKey
112 DATA 1
113 ```
114 
115 ### vtkInformationDoubleVectorKey ###
116 
117 ```
118 NAME DoubleVector LOCATION TestKey
119 DATA 3 1 90 260
120 ```
121 
122 ### vtkInformationIdTypeKey ###
123 
124 ```
125 NAME IdType LOCATION TestKey
126 DATA 5
127 ```
128 
129 ### vtkInformationStringKey ###
130 
131 ```
132 NAME String LOCATION TestKey
133 DATA Test%20String!%0ALine2
134 ```
135 
136 ### vtkInformationIntegerKey ###
137 
138 ```
139 NAME Integer LOCATION TestKey
140 DATA 408
141 ```
142 
143 ### vtkInformationIntegerVectorKey ###
144 
145 ```
146 NAME IntegerVector LOCATION TestKey
147 DATA 3 1 5 45
148 ```
149 
150 ### vtkInformationStringVectorKey ###
151 
152 ```
153 NAME StringVector LOCATION TestKey
154 DATA 3
155 First
156 Second%20(with%20whitespace!)
157 Third%20(with%0Anewline!)
158 ```
159 
160 ### vtkInformationUnsignedLongKey ###
161 
162 ```
163 NAME UnsignedLong LOCATION TestKey
164 DATA 9
165 ```