XY_IO
XY File Input/Output routines.


XY_IO is a C++ library which reads and writes files in the XY, XYL and XYF formats.

XY files are a simple way of storing information about sets of points in 2D.

An XY file has a simple structure. There are three kinds of records:

Here is an example of an XY file containing 13 points:

#  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
      

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 through each point listed on a record. Thus, an XYL file associated with the above XY file might be:

#  house.xyl
#
 0 1 2 3 4 0
 5 6 7 8 5
 9 10 11 12
      

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:

#  house.xyf
#
 0 1 2 3 4
 5 6 7 8
 9 10 11 12
      

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages:

XY_IO is available in a C++ version and a FORTRAN90 version and a MATLAB version.

Related Data and Programs:

CIRCLE_POINTS, a FORTRAN90 program which computes points equally spaced on a circular arc, and writes them to an XY file;

GRF_TO_XYL, a FORTRAN90 program which converts information describing the adjacency and embedding of an abstract graph from GRF to XYL format.

TABLE, a data directory which contains examples of TABLE files, a simple format for N points in M dimensions;

XY, a data directory which contains examples of XY files, a simple 2D graphics point format;

XY_DISPLAY, a MATLAB program which reads an XY file containing the coordinates of points in 2D, and displays a plot of the points in a MATLAB graphics window;

XY_DISPLAY_OPENGL, a C++ program which reads an XY file of 2D point coordinates, and displays an image of those points using OpenGL.

XYF, a data directory which contains examples of XYF files, a simple 2D graphics point and face format;

XYF_DISPLAY, a MATLAB program which reads XYF information defining points and faces in 2D, and displays an image using MATLAB.

XYF_DISPLAY_OPENGL, a C++ program which reads XYF information defining points and faces in 2D, and displays an image using OpenGL.

XYL, a data directory which contains examples of XYL files, a simple 2D graphics point and line format;

XYL_DISPLAY, a MATLAB program which reads XYL information defining points and lines in 2D, and displays an image using MATLAB.

XYL_DISPLAY_OPENGL, a C++ program which reads XYL information defining points and lines in 2D, and displays an image using OpenGL.

XYZ_IO, a C++ library which reads and writes XYZ files, a simple 3D graphics point format.

Source Code:

Examples and Tests:

List of Routines:

You can go up one level to the C++ source codes.


Last revised on 08 January 2009.