next up previous contents index
Next: Polymorphic Flat Database Up: Geometry Creation and Management Previous: Zoidlists and Layer Expressions   Contents   Index

Spatial Parameter Tables

(int) ReadSPtable(filename)
This function reads a specification file for a spatial parameter table. A spatial parameter table is a two dimensional array of floating point values, which can be accessed via x-y coordinate pairs. The user can define any number of such tables, each of which is given a unique identifying keyword. Tables remain defined until explicitly destroyed, or until ClearAll is called.

The tables are input through a file, which uses the following format:

keyword X DX NX Y DY NY
X Y value
...

Blank lines and lines that begin with punctuation are ignored. There is one ``header'' line with the following entries:

keyword
Arbitrary word for identification. An existing database with the same identifier will be replaced.
X
Reference coordinate in microns.
DX
Grid spacing in X direction, in microns, must be > 0.
NX
Number of grid cells in X direction, must be > 0.
Y
Reference coordinate in microns.
DY
Grid spacing in Y direction, in microns, must be > 0.
NY
Number of grid cells in Y direction, must be > 0.

The header line is followed by data lines that supply a value to the cells. The X,Y given in microns specifies the cell. A second access to a cell will simply overwrite the data value for that cell. Unwritten cells will have a zero value.

The function returns 1 on success, 0 otherwise with an error message available from the GetError function.

(int) ClearSPtable(name)
This will destroy the spatial parameter table whose keyword matches the string given. If a numeric 0 (NULL) or a null string is passed, all spatial parameter tables will be destroyed. The return value is the number of tables destroyed.

(real) GetSPdata(name, x, y)
This function returns the value from the spatial parameter table keyed by name, at coordinate x,y given in microns. If the table is not found or x,y is out of range, 0 is returned.

(int) SetSPdata(name, x, y, value)
This function will set the data cell corresponding to x,y (in microns) of the named spatial parameter table to the value. The return value is 1 if successful, 0 if the table can't be found, x,y is out of range, or some other error occurs.


next up previous contents index
Next: Polymorphic Flat Database Up: Geometry Creation and Management Previous: Zoidlists and Layer Expressions   Contents   Index
Stephen R. Whiteley 2006-10-23