The appearance of segments depends on the following segment attributes:
A segment transformation is a transformation of all the coordinates within a segment and is performed by a 2 x 3 matrix stored in the segment header. It maps from NDC to NDC. As an example of the use of segment transformations, consider a circuit design application which has symbols for transistors, capacitors, resistors, etc. Such an application would store each symbol in a separate segment, and then call INsert SeGement specifying a transformation matrix in order to duplicate a particular symbol at the positions and orientations required.
When a segment is created GKS sets a default null transformation which leaves the original coordinates unchanged. Before setting a transformation it is necessary to evaluate the transformation matrix by either using one's own algorithm, or by using the routines:
CALL GEVTM(X0, Y0, DX, DY, PHI, FX, FY, SW, MXOUT)
and/or
CALL GACTM(MXIN, X0, Y0, DX, DY, PHI, FX, FY, SW, MXOUT)
GEVTM evaluates a matrix (MXOUT), whilst GACTM accumulates changes to
an existing matrix (MXIN).
Both routines require the definition of:
Once the transformation matrix has been evaluated, it may then be Set in the SeGmenT by calling the routine:
CALL GSSGT(SGNA, MTX)An example of using a segment transformation may be found in Appendix on Page
Segment VISibility (GSVIS) determines whether or not the segment is displayed; the default is for the segment to be visible. The values are 'GINVIS' or 'GVISI'. As an example of its use, messages or icons could be created in segments which would normally be invisible, but which could be made visible at the appropriate time by the application program. The call is:
CALL GSVIS(SGNA, GVISI)Note that if a segment is invisible it is not detectable (cannot be picked), even if detectability is enabled. Also, even if a segment has visibility enabled, it may not actually be drawn if the deferral state is set to something other than 'GASAP' (see section on Page
Many display systems have some means for highlighting graphical output, eg by making it brighter, or by causing it to blink. The implementation of this attribute is dependent on the device being used. Note that in order for a Segment to be HighLIghTed (GSHLIT), it must first be made visible. The default is not highlighted. The possible values are 'GNORML' or 'GHILIT'. The call is:
CALL GSHLIT(SGNA, GHILIT)
SeGment Priority, a real number in the range 0.0 to 1.0, enables the control of the order in which segments are re-drawn when the picture has been changed. It also controls the order in which segments are picked. If parts of segments overlap, then the segment with the highest priority will be picked first and displayed on top of all the others. If two segments with the same priority occupy the same area of the display surface, then the last one will be drawn on top. The default priority is 0.0. The call is:
CALL GSSGP(SGNA, PRIOR)
The number of segment priority levels available (NSGP) for a particular workstation, WTYPE, may be inquired using:
CALL GQSGP(WTYPE, ERRIND, NSGP)
Segment DeTECtability controls which segments can be picked by the operator using a Logical Pick Device, and which ones cannot. Values are 'GUNDET' or 'GDETEC'. If a segment is detectable, it can be picked. The default setting is un-detectable. The call is:
CALL GSDTEC(SGNA, GDETEC)Note that if a segment is invisible it is not detectable (cannot be picked), even if detectability is enabled.