next up previous contents index
Next: The Pick Identifier Up: Segments Previous: Segment AssociationCopying,

Segment Attributes

The appearance of segments depends on the following segment attributes:

Segment attributes may be modified after the segment has been closed, and the changes will become visible on all active workstations on which the segment has been stored. However, the timing of when these changes take place is workstation-dependent, and may also be affected by the deferral mode which is in force (see sections on Page gif and on Page gif). This is because some workstations may require picture regeneration to produce the new attribute state on the display.

Segment Transformations

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:
X0, Y0
(real) a fixed reference point about which 2D rotations take place.
DX, DY
(real) a translation (or shift) vector.
PHI
(real) an angle of rotation about X0, Y0.
FX, FY
(real) X and Y scale factors.
SW
(enumerated) a switch specifying whether the reference point and shift vector are given in World Coordinates or Normalized Device Coordinates ('GWC' or 'GNDC').
The transformation is composed in the order: scale, rotate, shift. In the case of GACTM, the matrix MXIN is pre-concatenated with that formed from the scale, rotate, and shift parameters, so MXOUT = SHIFT * ROTATE * SCALE * MXIN.

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 gif.

Visibility

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 gif).

Highlighting

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)

Priority

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)

Detectability

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.

next up previous contents index
Next: The Pick Identifier Up: Segments Previous: Segment AssociationCopying,


Janne Saarela
Mon Apr 3 17:00:12 METDST 1995