next up previous contents index
Next: Specifying Text Up: The Output Attributes Previous: Specifying Marker Types

Specifying Fill Areas

Many applications need shaded or coloured areas as well as lines and points. GKS allows one to draw such an area by specifying an array of points representing a closed polygon. If the last point in the array is not the same as the first, these two will be joined. The interior style of the area can be set to one of the four values hollow, solid, pattern, and hatch, which are demonstrated in gif ('GHOLLO', 'GSOLID', 'GPATTR', 'GHATCH'). Examples for setting fill area interior style are:

CALL GSFAIS(GHOLLO)
     or
CALL GSFAIS(GSOLID)

For interior style hollow the boundary polygon only is drawn as a solid line. For style solid the interior is completely filled with a uniform colour, as specified by the fill area colour index set by calling GSFACI.

Workstations for devices which support area filling of polygons by hardware should normally make use of this feature. However, this is not always possible, as some monochrome terminals do not use the correct algorithm to perform the area fill.

For interior styles hatch and pattern, the particular hatch algorithm or pattern used may be chosen by specifying a fill area style index. This represents a second level of selection on the way the area is filled, and the index points into either a hatch or pattern table stored at the workstation. Thus, hatches and patterns are workstation-dependent. The fill area style index is set by calling:

CALL GSFASI(FASI)
where FASI is an integer value. To find out the effect of setting a particular index, it is necessary to consult the workstation documentation.

The GKS standard provides calls to modify patterns by setting the pattern reference point (GSPARF) and pattern size (GSPA). The pattern representation attribute bundle is set using GSPAR. The GKSGRAL package also allows the possibility to define one's own hatch styles by calling the routine GUSHTR, although this is not a standard GKS feature. None of these routines will be described further in this Primer, and the reader is referred to the texts in the bibliography for more information.

 

 


Figure: GKS fill area styles



next up previous contents index
Next: Specifying Text Up: The Output Attributes Previous: Specifying Marker Types


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