next up previous
Next: Raster Graphics classes generic Up: Graphic Relations a generic Previous: Design Solution

Implementation

The graphic relation itself is represented by a header object which records the relation dimensionality (say, 100x100) and then contains a pointer to the linklist of arrays implementing the "columns" in the relation. (Naturally, all arrays in a graphic relation must have that same dimensionality as the relation itself!)

To the Lisp programmer, Skandha4 graphic arrays behave in most respects just like standard scalar arrays: They may be created, dimensioned and redimensioned using exactly the same syntax. Getting and setting individual graphic relation slots may be done using the same syntax used to get or set an array slot, except of course that the "value" read or written will be a tuple of named values instead of a single scalar value.

Of course, graphic relations support operations not present for normal scalar arrays, for such things as "insert a column," "delete a column," or "add this column to that column."

In a classical relation, each "column" is one-dimensional, and the relation as a whole is treated as unordered.

In the graphics context, it is often convenient to have each column be multidimensional: For example, we represent an image as a two-dimensional graphic relation with separate 2-D "columns" for the red, green, blue and alpha components, and a multimodal MRI volume dataset as a three-dimensional graphic relation with separate 3-D "columns" for anatomical, venous and arterial density values.

Skandha4 graphic relations are not unordered sets of tuples (as are classical mathematical relations) but are instead arrays of tuples: When attempting to render megapolygon size datasets at interactive speeds, it is a tremendous win to be able to index directly via array-style positional operations, and to expose this underlying order to the application programmer for purposes of modelling the inherent order of the dataset (such as the 3D-acquisition grid of an MRI dataset), something which is not typically present in classical database applications, and hence lent little support by the Codd's classical mathematical relation abstraction.


next up previous
Next: Raster Graphics classes generic Up: Graphic Relations a generic Previous: Design Solution
Kevin Hinshaw 2003-01-13