GDDM-GKS V1R1 Programming Guide and Reference
|
Previous topic |
Next topic |
Contents |
Index |
Contact z/OS |
Library |
PDF |
BOOK
Workstation transformations GDDM-GKS V1R1 Programming Guide and Reference SC33-0334-00 |
|
Each workstation has its own workstation transformation. When you set a workstation transformation, you are mapping a range of NDC to a range of DC. The workstation window, set with the Set workstation window (GSWKWN) function, encloses the range of NDC points that you want to map to the display surface. (Note that this NDC range is not necessarily the same as a viewport.) The workstation viewport, set with the Set workstation viewport (GSWKVP) function, specifies the range of DC points to which your workstation window will be mapped. The transformation functions provide device-independence and application portability. You can adapt your GKS application to any display device supported by GDDM-GKS. There are two ways you can do this without knowing in advance the specific properties of the device. You can:
This illustration shows how the default values for workstation window and workstation viewport preserve the aspect ratio of the picture in NDC. The largest workstation window that you can set is (0.0,1.0)x(0.0,1.0). The maximum workstation viewport is the full display surface of the workstation. There is a simple way to ensure that your application makes use of the entire workstation display surface, no matter what kind of output device it may be used with. The function Inquire display space size (GQDSP) returns, among other information, the maximum x and y ranges for DC units. Find the larger of these, and set the aspect ratio of the NDC workstation window equal to the aspect ratio of the display surface. The workstation transformation will then map the graphics picture to the entire display surface. Here is a method for setting the workstation transformation:
SET WINDOW (2, 0.0, 100.0, 0.0, 100.0)
INQUIRE DISPLAY SPACE SIZE (wtype, error,
dcunits, xdevice, ydevice, xraster, yraster)
if xdevice > ydevice
then scale = xdevice
else scale = ydevice
xndc = xdevice/scale
yndc = ydevice/scale
SET VIEWPORT (2, 0.0, xndc, 0.0, yndc)
SET WORKSTATION WINDOW (wkid, 0.0, xndc, 0.0,
yndc)
SET WORKSTATION VIEWPORT (wkid, 0.0, xdevice,
0.0, ydevice)
You can use this procedure to make use of the entire display surface in
your application. However, you may lose the one-to-one correspondence
with the graphics picture in WC. If after the above procedure, you enter:
SELECT NORMALIZATION TRANSFORMATION (2)
and then draw the picture, it looks like this:
When a segment is created, the current normalization transformation is stored with it as a clipping rectangle. Therefore subsequent changes in the normalization transformation have no effect on previously created segments. Changing the workstation transformation changes the location of a displayed segment, but not its aspect ratio. This illustration shows two different workstation transformations. |
Copyright IBM Corporation 1990, 2012 |