6.9 Shading

                         S H D P A T 

SHDPAT  selects  shading patterns  used by  routines such as
SHDCRV and AREAF.

The call is:  CALL SHDPAT (IPAT)               level 1, 2, 3

IPAT     is an integer between 0 and 17. The predefined pat-
         terns  are shown in appendix B.

                          M Y P A T

MYPAT defines a global shading pattern.

The call is:  CALL MYPAT (IANGLE, ITYPE, IDENS, ICROSS)
                                               level 1, 2, 3

IANGLE        is the angle of shading lines (0 - 179).
ITYPE         defines the type of shading lines:
        = 0   no shading lines.
        = 1   equidistant lines.
        = 2   double shading lines.
        = 3   triple shading lines.
        = 4   thick shading lines.
        = 5   dotted lines.
        = 6   dashed lines.
        = 7   dashed-dotted lines.
IDENS         defines  the  distance  between  shading lines
              (0: small distance, 9: big distance).
ICROSS        indicates  whether  shading  lines are hatched
              (0: not hatched, 1: hatched).

Examples:     The following calls to  MYPAT  show the prede-
              fined shading patterns used by SHDPAT:

  IPAT = 0:   CALL MYPAT (  0, 0, 0, 0)
  IPAT = 1:   CALL MYPAT ( 45, 1, 5, 0)
  IPAT = 2:   CALL MYPAT (150, 4, 5, 0)
  IPAT = 3:   CALL MYPAT (135, 1, 5, 0)
  IPAT = 4:   CALL MYPAT ( 45, 4, 5, 0)
  IPAT = 5:   CALL MYPAT ( 45, 1, 5, 1)
  IPAT = 6:   CALL MYPAT (135, 2, 1, 0)
  IPAT = 7:   CALL MYPAT ( 45, 4, 5, 1)
  IPAT = 8:   CALL MYPAT ( 30, 1, 4, 0)
  IPAT = 9:   CALL MYPAT ( 45, 2, 1, 1)
  IPAT = 10:  CALL MYPAT (  0, 1, 5, 1)
  IPAT = 11:  CALL MYPAT ( 45, 3, 1, 0)
  IPAT = 12:  CALL MYPAT ( 70, 4, 7, 0)
  IPAT = 13:  CALL MYPAT ( 45, 3, 1, 1)
  IPAT = 14:  CALL MYPAT (  0, 4, 5, 1)
  IPAT = 15:  CALL MYPAT ( 45, 2, 1, 0)
  IPAT = 16:  CALL MYPAT (  0, 1, 0, 0)
  IPAT = 17:  CALL MYPAT (  0, 5, 5, 0)

                         N O A R L N 

With the routine  NOARLN  the outlines of shaded regions can
be suppressed.

The call is:  CALL NOARLN                      level 1, 2, 3

6.10 Attribute Cycles

The attributes line style, colour and shading pattern can be
changed  automatically  by routines such as  CURVE,  SHDCRV,
BARS and PIEGRF according to a predefined cycle.

Line styles:  SOLID,  DOT, DASH, CHNDSH, CHNDOT, DASHM, DOTL
              and DASHL.
Colours:      WHITE/BLACK, RED, GREEN, YELLOW, BLUE, ORANGE,
              CYAN and MAGENTA.
Shading:      Pattern numbers from 0 to 17.

The following subroutines allow the redefining of cycles.

                         L I N C Y C 

LINCYC changes the line style cycle.

The call is:  CALL LINCYC (INDEX, ITYP)        level 1, 2, 3

INDEX         is an index between 1 and 30.
ITYP          is an integer between  0 and 7  containing the
              line style  (0 = SOLID,   1 = DOT,   2 = DASH,
              3 = CHNDSH,  4 = CHNDOT,  5 = DASHM, 6 = DOTL,
              7 = DASHL).

                         C L R C Y C 

CLRCYC changes the colour cycle.

The call is:  CALL CLRCYC (INDEX, ICLR)        level 1, 2, 3

INDEX         is an index between 1 and 30.
ICLR          is a colour number (see SETCLR).

                         P A T C Y C 

PATCYC changes the shading pattern cycle.

The call is:   CALL PATCYC (INDEX, IPAT)       level 1, 2, 3

INDEX          is an index between 1 and 30.
IPAT           is a pattern  number  between  0 and 17 or is
               determined by the formula  
               IANGLE * 1000 + ITYPE * 100 + IDENS * 10 +
                                                      ICROSS
               with the parameters described in MYPAT.

6.11 Base Transformations

The following  subroutines  create  a transformation  matrix
that  affects plot vectors  contained  within page  borders.
Vectors may be scaled, shifted and rotated and the transfor-
mations can be combined in any order.

                         T R F S H F 

TRFSHF affects the shifting of plot vectors.

The call is:    CALL TRFSHF (NXSHFT, NYSHFT)   level 1, 2, 3

NXSHFT, NYSHFT  are plot coordinates  that define the magni-
                tude of shifting in the X- and Y-direction.

                         T R F S C L 

TRFSCL affects the scaling of plot vectors.
 
The call is:  CALL TRFSCL (XSCL, YSCL)         level 1, 2, 3

XSCL, YSCL    are  scaling factors  for the  X- and Y-direc-
              tion.

                         T R F R O T 

TRFROT affects the rotation of plot vectors around a point.

The call is:  CALL TRFROT (XANG, NX, NY)       level 1, 2, 3

XANG          is the rotation angle measured in degrees in a
              counter-clockwise direction.
NX, NY        are  the  plot  coordinates  of  the  rotation
              point.

                         T R F R E S 

TRFRES resets base transformations.

The call is:  CALL TRFRES                      level 1, 2, 3

6.12 Shielded Regions

This section  describes how  to protect  regions  from being
overwritten.  Shielded regions can be defined  automatically
by  DISLIN  or explicitly by the user.  Shielded regions are
stored  in a  buffer  which can  then be manipulated  by the
user.

                         S H I E L D 

SHIELD  selects shielded regions which are set automatically
by DISLIN.

The call is:  CALL SHIELD (CAREA, CMODE)       level 1, 2, 3

CAREA         is a character string defining the regions:
  = 'MESSAG'  is used for text and numbers plotted by MESSAG
              and NUMBER.
  = 'SYMBOL'  will shield symbols.
  = 'BARS'    will shield bars plotted by BARS.
  = 'PIE'     will shield pie segments plotted by PIEGRF.
  = 'LEGEND'  will protect  legends.  All legend  attributes
              should be set before calling CURVE because the
              shielded region of a legend is defined by CUR-
              VE.  If there  is no legend  position  defined
              with  LEGPOS,  CURVE assumes  that the  legend
              lies  in the  upper right  corner  of the axis
              system.
CMODE         is a character string defining a status:
  = 'ON'      means that  the regions  defined above will be
              written  to the  shielding buffer and are pro-
              tected.
  = 'OFF'     means that regions will not be  written to the
              shielding  buffer.   Regions  that  are  still
              stored in the buffer will be shielded.
  = 'DELETE'  removes regions from the shielding buffer.
  = 'RESET'   is a  combination  of   'OFF'  and   'DELETE'.
              Regions are removed from and will not be writ-
              ten to the shielding buffer. To save computing
              time, this command should always be used  when
              shielding is no longer needed.
  = 'NOVIS'   The shielding of regions held in the shielding
              buffer is disabled. This is not valid for  re-
              gions newly written to the buffer.
  = 'VIS'     Disabled  regions will be  protected.  This is
              the default value for regions newly written to
              the buffer.

The following routines set user-defined regions:

The calls are: 

     CALL SHLREC  (NX, NY, NW, NH)          for rectangles
     CALL SHLRCT  (NX, NY, NW, NH, THETA)   for rotated 
                                            rectangles
     CALL SHLCIR  (NX, NY, NR)              for circles
     CALL SHLELL  (NX, NY, NA, NB, THETA)   for rotated
                                            ellipses
     CALL SHLPIE  (NX, NY, NR, ALPHA, BETA) for pie segments
     CALL SHLPOL  (NXRAY, NYRAY, N)         for polygons.

NX, NY       are  plot coordinates  of the upper left corner
             or the centre point.
NW, NH       are the width and height of rectangles.
NR, NA, NB   are radii in plot coordinates.
THETA        is a  rotation  angle  measured in degrees in a
             counter-clockwise direction.
ALPHA, BETA  are starting and ending angles for pie segments
             measured  in  degrees  in  a  counter-clockwise
             direction.
NXRAY, NYRAY are arrays  of the  dimension N containing  the
             corner points of a polygon.

                         S H L I N D 

The index of  shielded  regions  in the  buffer  can be  re-
quested with SHLIND. It returns the index of the region last
written to the buffer.

The call is:  CALL SHLIND (ID)                 level 1, 2, 3

ID            is the returned index.

                         S H L D E L 

SHLDEL removes entries from the shielding buffer.

The call is:  CALL SHLDEL (ID)                 level 1, 2, 3

ID            is the index of a shielded region. If ID is 0,
              all regions defined by the user  will be dele-
              ted.

                         S H L R E S 

SHLRES deletes regions last written to the shielding buffer.

The call is:  CALL SHLRES (N)                  level 1, 2, 3

N             is the number of regions to delete.

                         S H L V I S 

SHLVIS  disables or  enables shielded regions.  Disabled re-
gions  are no  longer protected  but are still  held  in the
shielding buffer.

The call is:  CALL SHLVIS (ID, CMODE)          level 1, 2, 3

ID            is the index of a shielded region. If ID is 0,
              all entries
              are disabled or enabled.
CMODE = 'ON'  enables shielded  regions. This is the default
              value for regions newly written to the buffer.
      = 'OFF' disables shielded regions.

Notes:     -  A frame  is plotted  around regions defined by
              the user.  The thickness  of frames can be set
              with FRAME.  Regions defined  automatically by
              DISLIN  are not enclosed by a frame but frames
              plotted  by  MESSAG  after  using  FRMESS  and
              shielded regions defined by MESSAG are identi-
              cal.
           -  Shielded regions can overlap each other. 
           -  The statement   CALL RESET  ('SHIELD')  resets
              shielding. All regions defined by  DISLIN  and
              the user are removed from the shielding buffer
              and no new regions will be written to the buf-
              fer.
           -  The number of shielded  regions is  limited to
              the size of the shielding buffer  which is set
              to  1000 words.  The number  of words  used by
              regions are: 
                  SHLREC = 6, SHLRCT = 7, SHLCIR = 5,
                  SHLELL = 7, SHLPIE = 7 and SHLPOL = 2*N+3.
           -  Shielding  of regions  is computer  intensive.
              Therefore, shielding should be used very care-
              fully  and shielded regions  should be deleted
              from the buffer when no longer needed.
           -  Base transformations  do not affect the  posi-
              tion of shielded regions.
           -  SHLPOL can be used between the routines GRFINI
              and GRFFIN.  The shielded  region will be pro-
              jected into  3-D space.  This is not valid for
              other shielded regions.

