Jump Over Left Menu
Chapter 11: Workstations
11.1 MAIN CHARACTERISTICS
In Section 1.2.3, the concept of a workstation was introduced as the part of a PHIGS system that controlled a specific device. While a great deal of the PHIGS system is concerned with the production of pictures in Normalized Projection Coordinates (NPC) from the traversal of structures, at some stage consideration must be taken of the characteristics of the device upon which the output will appear and from which input is received. This part of the system is called the workstation and contains the device dependent code needed to interact with a device.
The standard workstation will have a display surface and a set of input devices attached to it (this is called an OUTIN workstation). A workstation is only allowed a single display surface in PHIGS so if an operator wishes to interact with an application through several display screens, several workstations must be in operation together. PHIGS is designed to allow this and to provide separate control of the pictures displayed on each workstation. Some devices only have the ability to input data (digitizers) or display information (plotters). These are defined as INPUT and OUTPUT workstations respectively. They are categorized differently as these workstations are less complex than OUTIN workstations and so can be optimized differently. Two other workstation categories exist, MO and MI. These workstations do not have a display surface or input devices but, instead, are used to spool information for transmission to a remote device or storage and to read back previously stored graphical information. Their characteristics are implementation dependent and the reader is advised to consult the implementation manual for the PHIGS system being used to find out what has been provided.
PHIGS can be used on a conventional workstation with a bit-map display. If the operator wishes to interact with graphical output in several distinct windows on the display, these will be treated as separate workstations of type OUTIN.
11.2 SETTING UP A WORKSTATION
Before a workstation can be used, the application program has to invoke the function:
OPEN WORKSTATION(WS, CONID, WSTYPE)
This defines a workstation with name WS to be used by the application. Structures can be posted to it as described in Section 2.5 and the result of structure traversal will appear as a picture on the workstation display. The parameter CONID defines the channel that connects the workstation to the application. The way CONID is specified will depend on the language used, the operating system and the type of usage (connecting windows on a display may be different from the way real devices are connected). Again, it is necessary to consult the installation guide for your PHIGS system.
The third parameter, WSTYPE, defines the type of workstation to be connected. A PHIGS implementation will define a set of workstation types that it can handle, effectively the set of devices for which drivers have been written. For each of these, it provides a workstation description table containing information about the workstation. For example, it will give the category (OUTIN etc), the size of the display, whether it is a raster device, what aspects of primitives it can handle (for example, the number of linestyles available), what the bundle tables (see Section 4.4) are set to initially, and the input devices it supports. It will also indicate which changes to the display will require the complete picture to be redrawn. Generic workstation types can be defined so that it is not necessary to have a different one for each variant of a manufacturer's range that have similar characteristics.
The execution of OPEN WORKSTATION sets up a workstation state list which, initially, contains information drawn from the workstation description table together with standard initialization conditions. The initial bundle settings will come from the workstation description table while the set of posted structures will initially be set to empty. As the session proceeds, the workstation state list will change dependent on what the application does. For example, specific views will be set up for the workstation, structures will be posted to it and input devices will be asked to deliver logical input values.
11.3 WORKSTATION TRANSFORMATION
When a workstation is opened and structures posted to it, the NPC picture created as a result of the viewing operation will be displayed on the workstation such that the NPC unit square in the X and Y -directions will appear as large as possible starting from the bottom left hand corner of the display. For square displays, it will cover the whole display surface while for rectangular displays some display surface will be unused either above or to the right of the area displaying the unit square.
To change the place on the display surface where the output will appear, or to change the size of the area, requires one or more of the following functions to be invoked:
SET WORKSTATION WINDOW (WS, XWMIN, XWMAX, YWMIN, YWMAX) SET WORKSTATION WINDOW 3(WS, WA) SET WORKSTATION VIEWPORT (WS, XVMIN, XVMAX, YVMIN, YVMAX) SET WORKSTATION VIEWPORT 3(WS, VA)
In the 2D forms, the area of NPC space defined by the last four parameters of SET WORKSTATION WINDOW is mapped onto the area of the device defined by the last four parameters of SET WORKSTATION VIEWPORT. Initially, the window is defined as though the function:
SET WORKSTATION WINDOW(WS, 0, 1, 0, 1)
had been called and the viewport as though the function:
SET WORKSTATION VIEWPORT(WS, 0, MAX, 0, MAX)
where MAX is the minimum of the device coordinate range in the X and Y-directions.
One major use of redefining the workstation window to viewport mapping is to select some part of the NPC unit square for display. No output will appear outside the workstation viewport.
The display on the device should be an accurate image of the picture in the NPC space. Consequently, no change in aspect ratio is allowed in the definition of the workstation window to viewport mapping. Thus, a circle in the NPC picture will appear as a circle, not an ellipse, on the display surface.
Another reason for limiting the part of the display surface used to display the NPC picture is when space is required to echo input device values so that they do not overlap the displayed picture.
The 3D form of the functions has an array of 6 values as the second parameter. The first four are the equivalent of the 2D parameters defining the area while the last two give the limits in the Z-direction. This allows the mapping of the workstation window to viewport to perform clipping in the Z-direction also. It may also effect how depth cueing or hidden surface calculations are performed.
11.4 DISPLAY UPDATE
The structures posted to a workstation will be traversed and the resulting scene viewed by a transformation specific to a workstation (see Chapter 6 and Chapter 7). The rendering of the primitives on the display surface will depend on the individual attributes and bundle tables as defined by the relevant aspect source flags (see Section 4.5). Many of the parameters that affect the rendering and viewing of the posted structure can be changed by the application while the structure is posted. Normally, the operator will expect changes to such parameters to occur immediately. This is particularly important if the operator is interacting with what is believed to be the current display. In some cases, it may be less important (for example, if the output is being sent to a plotter). Also, if updating the display takes a long time (the whole picture may need to be redrawn), the operator may prefer to interact with an out-of-date display or one that is poorly rendered.
PHIGS provides facilities for specifying how quickly updates should take place and whether a lower grade of update is acceptable. If changes can be deferred, functions are provided to force an update of the workstation display. These facilities are very dependent on the implementation and the device. Readers should consult the local meanings of SET DISPLAY UPDATE STATE and UPDATE WORKSTATION.
11.5 WORKSTATION CLOSURE
When interaction with a workstation is complete, the application should invoke the function:
This ensures that all the output is delivered to the workstation and input received. The workstation state list is also deleted. The function can be used to reset a workstation to its initial values (CLOSE followed by OPEN). It may also be necessary if the application needs to use more workstations in a session than the maximum allowed by the implementation.