-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathxy_io.html
416 lines (380 loc) · 11.5 KB
/
xy_io.html
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
<html>
<head>
<title>
XY_IO - XY File Input/Output routines.
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
XY_IO <br> XY File Input/Output routines.
</h1>
<hr>
<p>
<b>XY_IO</b>
is MATLAB library which
reads and writes files in the XY, XYL and XYF formats.
</p>
<p>
XY files are a simple way of storing information about sets of points in 2D.
</p>
<p>
An XY file has a simple structure. There are three kinds of records:
<ul>
<li>
COMMENT LINES begin with the character '#' and are ignored;
</li>
<li>
BLANK LINES are ignored;
</li>
<li>
COORDINATE LINES each contain one pair of X, Y coordinates;
</li>
</ul>
</p>
<p>
Here is an example of an XY file containing 13 points:
<pre>
# house.xy
#
0.000000 0.000000
6.000000 0.000000
6.000000 7.000000
3.000000 10.000000
0.000000 7.000000
4.000000 1.000000
5.000000 1.000000
5.000000 4.000000
4.000000 4.000000
5.000000 8.000000
5.000000 11.000000
4.000000 11.000000
4.000000 9.000000
</pre>
</p>
<p>
Of course, in many cases, we would like to describe LINES between the points.
We can add this information by including a second file, called an XYL file,
which consists of a string of point indices. A line is drawn from one point
to the next, and so on for each point index in a record. Thus, an XYL file
associated with the above XY file might be:
<pre>
# house.xyl
#
1 2 3 4 5 1
6 7 8 9 6
10 11 12 13
</pre>
</p>
<p>
We might also like to describe FACES defined by the points.
We can add this information by including a file, called an XYF file,
which consists of a string of point indices. A face is defined by
listing in counterclockwise order the vertices that lie on it.
The first vertex is not repeated
as the final vertex. Thus, an XYF file
associated with the above XY file might be:
<pre>
# house.xyf
#
1 2 3 4 5
6 7 8 9
10 11 12 13
</pre>
</p>
<h3 align = "center">
Licensing:
</h3>
<p>
The computer code and data files described and made available on this web page
are distributed under
<a href = "../../txt/gnu_lgpl.txt">the GNU LGPL license.</a>
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>XY_IO</b> is available in
<a href = "../../cpp_src/xy_io/xy_io.html">a C++ version</a> and
<a href = "../../f_src/xy_io/xy_io.html">a FORTRAN90 version</a> and
<a href = "../../m_src/xy_io/xy_io.html">a MATLAB version</a>.
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../f_src/grf_to_xyl/grf_to_xyl.html">
GRF_TO_XYL</a>,
a FORTRAN90 program which
converts information describing the adjacency and embedding of an
abstract graph from GRF to XYL format.
</p>
<p>
<a href = "../../data/xy/xy.html">
XY</a>,
a data directory of examples of XY files,
a simple 2D graphics point format;
</p>
<p>
<a href = "../../m_src/xy_display/xy_display.html">
XY_DISPLAY</a>,
a MATLAB program which
reads a set of 2D points from
a file and plots them in a the MATLAB graphics window.
</p>
<p>
<a href = "../../cpp_src/xy_display_opengl/xy_display_opengl.html">
XY_DISPLAY_OPENGL</a>,
a C++ program which
reads an XY file of 2D point coordinates, and displays
an image of those points using OpenGL.
</p>
<p>
<a href = "../../data/xyf/xyf.html">
XYF</a>,
a data directory which
contains examples of XYF files,
a simple 2D graphics point and face format;
</p>
<p>
<a href = "../../m_src/xyf_display/xyf_display.html">
XYF_DISPLAY</a>,
a MATLAB program which
reads XYF information defining points and faces in 2D, and displays
an image using MATLAB.
</p>
<p>
<a href = "../../cpp_src/xyf_display_opengl/xyf_display_opengl.html">
XYF_DISPLAY_OPENGL</a>,
a C++ program which
reads XYF information defining points and faces in 2D, and displays
an image using OpenGL.
</p>
<p>
<a href = "../../data/xyl/xyl.html">
XYL</a>,
a data directory which
contains examples of XYL files,
a simple 2D graphics point and line format;
</p>
<p>
<a href = "../../m_src/xyl_display/xyl_display.html">
XYL_DISPLAY</a>,
a MATLAB program which
reads XYL information defining points and lines in 2D, and displays
an image using MATLAB.
</p>
<p>
<a href = "../../cpp_src/xyl_display_opengl/xyl_display_opengl.html">
XYL_DISPLAY_OPENGL</a>,
a C++ program which
reads XYL information defining points and lines in 2D, and displays
an image using OpenGL.
</p>
<p>
<a href = "../../m_src/xyz_io/xyz_io.html">
XYZ_IO</a>,
a MATLAB library which
reads and writes XYZ files, a simple 3D graphics point format.
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "s_len_trim.m">s_len_trim.m</a>,
returns the length of a string to the last nonblank.
</li>
<li>
<a href = "s_word_count.m">s_word_count.m</a>,
returns the number of "words" in a string.
</li>
<li>
<a href = "timestamp.m">timestamp.m</a>,
prints the current YMDHMS date as a timestamp.
</li>
<li>
<a href = "xy_data_print.m">xy_data_print.m</a>,
prints the data of an XY file.
</li>
<li>
<a href = "xy_data_read.m">xy_data_read.m</a>,
reads the data of an XY file.
</li>
<li>
<a href = "xy_data_write.m">xy_data_write.m</a>,
writes the data of an XY file.
</li>
<li>
<a href = "xy_example.m">xy_example.m</a>,
sets up sample XY data.
</li>
<li>
<a href = "xy_header_print.m">xy_header_print.m</a>,
prints the header of an XY file.
</li>
<li>
<a href = "xy_header_read.m">xy_header_read.m</a>,
reads the header of an XY file.
</li>
<li>
<a href = "xy_header_write.m">xy_header_write.m</a>,
writes the header of an XY file.
</li>
<li>
<a href = "xy_read.m">xy_read.m</a>,
reads an XY file.
</li>
<li>
<a href = "xy_write.m">xy_write.m</a>,
writes an XY file.
</li>
<li>
<a href = "xy_write_test.m">xy_write_test.m</a>,
tests the XY write routines.
</li>
<li>
<a href = "xyf_data_print.m">xyf_data_print.m</a>,
prints the data of an XYF file.
</li>
<li>
<a href = "xyf_data_read.m">xyf_data_read.m</a>,
reads the data of an XYF file.
</li>
<li>
<a href = "xyf_data_write.m">xyf_data_write.m</a>,
writes the data of an XYF file.
</li>
<li>
<a href = "xyf_example.m">xyf_example.m</a>,
sets up sample XYF data.
</li>
<li>
<a href = "xyf_example_size.m">xyf_example_size.m</a>,
sizes the sample XYF data.
</li>
<li>
<a href = "xyf_header_print.m">xyf_header_print.m</a>,
prints the header of an XYF file.
</li>
<li>
<a href = "xyf_header_read.m">xyf_header_read.m</a>,
reads the header of an XYF file.
</li>
<li>
<a href = "xyf_header_write.m">xyf_header_write.m</a>,
writes the header of an XYF file.
</li>
<li>
<a href = "xyf_write.m">xyf_write.m</a>,
writes an XYF file.
</li>
<li>
<a href = "xyl_data_print.m">xyl_data_print.m</a>,
prints the data of an XYL file.
</li>
<li>
<a href = "xyl_data_read.m">xyl_data_read.m</a>,
reads the data of an XYL file.
</li>
<li>
<a href = "xyl_data_write.m">xyl_data_write.m</a>,
writes the data of an XYL file.
</li>
<li>
<a href = "xyl_example.m">xyl_example.m</a>,
sets up sample XYL data.
</li>
<li>
<a href = "xyl_example_size.m">xyl_example_size.m</a>,
sizes the sample XYL data.
</li>
<li>
<a href = "xyl_header_print.m">xyl_header_print.m</a>,
prints the header of an XYL file.
</li>
<li>
<a href = "xyl_header_read.m">xyl_header_read.m</a>,
reads the header of an XYL file.
</li>
<li>
<a href = "xyl_header_write.m">xyl_header_write.m</a>,
writes the header of an XYL file.
</li>
<li>
<a href = "xyl_write.m">xyl_write.m</a>,
writes an XYL file.
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<ul>
<li>
<a href = "xy_io_test.m">xy_io_test.m</a>,
a sample calling program.
</li>
<li>
<a href = "xy_io_test_output.txt">xy_io_test_output.txt</a>,
the output from a run of the sample program.
</li>
<li>
<a href = "xy_io_test01.m">xy_io_test01.m</a>,
demonstrates the use of XY_WRITE routines.
</li>
<li>
<a href = "xy_io_test02.m">xy_io_test02.m</a>,
demonstrates the use of XY_READ routines.
</li>
<li>
<a href = "xy_io_test03.m">xy_io_test03.m</a>,
demonstrates the use of XYL_WRITE routines.
</li>
<li>
<a href = "xy_io_test04.m">xy_io_test04.m</a>,
demonstrates the use of XYL_READ routines.
</li>
<li>
<a href = "xy_io_test05.m">xy_io_test05.m</a>,
demonstrates the use of XYF_WRITE routines.
</li>
<li>
<a href = "xy_io_test06.m">xy_io_test06.m</a>,
demonstrates the use of XYF_READ routines.
</li>
<li>
<a href = "xy_io_test_01.xy">xy_io_test_01.xy</a>,
an XY file created by the example program.
</li>
<li>
<a href = "xy_io_test_02.xy">xy_io_test_02.xy</a>,
an XY file created by the example program.
</li>
<li>
<a href = "house.xy">house.xy</a>,
an XY file of points created by the example program.
</li>
<li>
<a href = "house.xyl">house.xyl</a>,
an XYL file of lines created by the example program.
</li>
<li>
<a href = "annulus.xy">annulus.xy</a>,
an XY file of points created by the example program.
</li>
<li>
<a href = "annulus.xyf">annulus.xyf</a>,
an XYF file of lines created by the example program.
</li>
</ul>
</p>
<hr>
<i>
Last revised on 08 January 2009.
</i>
<!-- John Burkardt -->
</body>
<!-- Initial HTML skeleton created by HTMLINDEX. -->
</html>