GDDM-GKS V1R1 Programming Guide and Reference
Previous topic | Next topic | Contents | Index | Contact z/OS | Library | PDF | BOOK


GCA

GDDM-GKS V1R1 Programming Guide and Reference
SC33-0334-00



Purpose



 GCA
                                    
 (px, py, qx, qy, dimx, dimy, isc,
 isr, dx, dy, colia)
   
 APL code  1316
 GKS RCP code  X'38001000' (939528192)
   


Function: To cell array.

Output function. Generates a cell array primitive.

Parameters


px (specified by user) (short floating point)

py (specified by user) (short floating point)

qx (specified by user) (short floating point)

qy (specified by user) (short floating point)
The corners of the cell rectangle in world coordinates.

dimx (specified by user) (fullword integer)

dimy (specified by user) (fullword integer)
The dimensions of the color index array, colia.

isc (specified by user) (fullword integer)

isr (specified by user) (fullword integer)
The indexes of the start column and the start row in colia of the cell array.

dx (specified by user) (fullword integer)

dy (specified by user) (fullword integer)
The number of columns and the number of rows of the cell array.

colia (specified by user) (an array of fullword integers)
The color index array (dimx groups of dimy elements).


Operating states


WSAC, SGOP

Related functions


None

Description


A cell array is a primitive generated by associating a color index array with a rectangle, called the cell rectangle, which is aligned with the world coordinate axes.

The cell rectangle is defined by two corners, P and Q, with world coordinates (px, py) and (qx, qy).

The rectangle is divided into a grid, dxdy, of equal-sized cells. The width of each cell is orpx-qxordx, and the height is orpy-qyordy. (The symbol "or" signifies that the absolute value is used; this is the value irrespective of the sign.)

To generate the cell array output primitive, the color of each cell is specified by the index of the associated element of the color index array colia. The color index array elements correspond to the cells in the cell rectangle as follows:

  • Element (isc, isr) corresponds to the cell having P at one corner.
    
    
  • Element (isc+dx-1, isr+dy-1) corresponds to the cell having Q at one corner.
    
    
  • Element (isc, isr+dy-1) corresponds to the cell having point (px, qy) at one corner.
    
    
  • Element (isc+dx-1, isr) corresponds to the cell having point (qx, py) at one corner.
    
    

The color index array can be mapped to the cell rectangle in any combination of directions along the x and y axes. Assuming that P is the top-left corner and Q is the bottom-right corner of the cell rectangle, a one-for-one mapping is performed. If P and Q are reversed, the color index array is mapped to a reflection of the cell rectangle, in both axes.

An entire color index array can be used by setting isc=1, isr=1, dx=dimx, and dy=dimy. Alternatively, a portion of the color index array can be used by setting isc and isr to indicate the start column and row in colia, and dx and dy to the number of columns and number of rows to be used.

If a color index is not present in the color table at a workstation, GDDM-GKS will substitute a workstation-dependent index at that workstation.

The cell array is subject to all transformations, potentially transforming the rectangular cells into rhomboids (diamond-shaped parallelograms).

The following example shows a function call to create a simple 10-by-10 cell array:


           INTEGER COLIA(10,10)/4,4,4,4,5,5,4,4,4,4,
          $                     4,4,4,4,1,1,4,4,4,4,
          $                     2,4,4,4,1,1,4,4,4,2,
          $                     2,2,1,2,2,2,2,1,2,2,
          $                     2,4,1,1,3,3,1,1,4,2,
          $                     4,4,4,4,3,3,4,4,4,4,
          $                     4,4,4,1,3,3,1,4,4,4,
          $                     4,4,4,1,4,4,1,4,4,4,
          $                     4,4,4,5,4,4,5,4,4,4,
          $                     4,4,5,5,4,4,5,5,4,4/

CALL GCA (25.0,75.0,75.0,25.0,10,10,1,1,10,10,COLIA)

This is the cell array that is created:


                               PICTURE 25          

The cell array function is not fully supported on plotter workstations. On these workstations, cell arrays are simulated by drawing the outline of the transformed cells in the color associated with color index 1, and using solid line style and normal line width.

Principal errors


5
GKS not in proper state: GKS shall be either in the state WSAC or in the state SGOP
91
Dimensions of color array are invalid

Go to the previous page Go to the next page



Copyright IBM Corporation 1990, 2012