Previous: pgna3 Up: ../plot79_p.html Next: pgnr3


PGNR2

       SUBROUTINE  PGNR2 (DXARAY,INCX, DYARAY,INCY, NVERTX)
 C$    (Polygon Relative 2-D)
 C$    Draw a 2-D polygon.  A relative move is automatically  made
 C$    from the current point to the first vertex, relative  draws
 C$    are made between all remaining vertices, and then  implicit
 C$    closure is provided  by connecting the  last vertex to  the
 C$    first.  On return, the current point is at the first vertex.
 C$
 C$    If a polygon "plain" interior  style filling and a  visible
 C$    pattern or  color has  been  selected by  a prior  call  to
 C$    SETPIS and SETPFI/SETPCI, the  polygon is filled with  that
 C$    pattern or color.  The polygon  vertices are assumed to  be
 C$    arranged so that the interior lies to the left of each line
 C$    segment between vertices i and i+1.  The arguments are:
 C$
 C$    DXARAY(*)........Array of relative X coordinates
 C$    INCX.............Displacement between successive X
 C$                     coordinates in DXARAY(*) (normally 1).
 C$    DYARAY(*)........Array of relative Y coordinates.
 C$    INCY.............Displacement between successive Y
 C$                     coordinates in DYARAY(*) (normally 1).
 C$    NVERTX...........Number of polygon vertices (.GE. 3).
 C$
 C$    If an  increment INCX  or INCY  is negative,  the  starting
 C$    vertex is taken as (1-N)*INC + 1 instead of 1, so that  the
 C$    array is stepped through in reverse order.  Because of  the
 C$    ordering convention on the vertices, reversing the order of
 C$    traversal of the vertex list interchanges the interior  and
 C$    the exterior of the polygon.   No error is raised if  there
 C$    are fewer than 3 vertices, but filling will be suppressed.
 C$
 C$    In the  current  implementation  of  this  routine,  it  is
 C$    necessary to expand the relative coordinates internally  to
 C$    a list of  absolute coordinates  which are  then passed  to
 C$    PGNA2.  This expansion is done in working arrays in  COMMON
 C$    whose size limits the number of vertices.  If more vertices
 C$    are provided,  a warning  message will  be issued  and  the
 C$    additional vertices will simply  be ignored.  The limit  is
 C$    at present 255 vertices.
 C$    (21-APR-83)