POLYGON
[GREG2\]POLYGON [(File)Name] [/VARIABLE]
[GREG2\]POLYGON [/PLOT] [/FILL [Colour]] [/HATCH [Ipen] [Angle]
[Separ] [Phase]]
[GREG2\]POLYGON [(File)Name] /RESET
The first syntax defines the polygon either from:
CURSOR
If no argument and no option, the interactive cursor is invoked to
define the polygon summits. Type any key to go to next summit, C to
correct the last one, D to delete it, and type E to end the polygon
definition. The last polygon side will then appear. The polygon def-
inition may be aborted by typing Q. For graphical displays, you may
use the mouse buttons for the commands. The left mouse button draws
a vertex, the middle mouse button deletes the last vertex, and the
right mouse button ends the polygon definition. After the use of the
cursor, the polygon plot is stored in the GTV metacode in a segment
named POLYGON. You can delete it with the command CLEAR SEGMENT.
FILE
If a file name is given as argument, the cursor is not called. The
summit coordinates are read from the named ASCII file (X in column
1, Y in column 2).
VARIABLE
If a SIC variable name is given with the /VARIABLE option, the sum-
mit coordinates are read either from a variable array of the form:
VAR[NXY,2] Real or Double
or a structure of the form (i.e. same as output):
VAR%NXY Integer or Long
VAR%X[VAR%NXY] Real or Double
VAR%Y[VAR%NXY] Real or Double
Whereever they come from (cursor, file, or variable), the polygon values
are stored internally; they can be printed with the command
GREG2\WRITE POLYGON, and they correspond to the variables POLY%NXY (num-
ber of vertices), POLY%X and POLY%Y (the corresponding coordinates). The
currently defined POLYGON is used by the commands MEAN and MASK.
The polygon loaded by the command can be directly or later plotted with
the following options:
/FILL [Colour]
the polygon is color-filled with the current pen colour or with the
specified colour (see HELP PEN /COL for possibilities),
/HATCH [Ipen] [Angle] [Separ] [Phase]
the polygon is filled with parallel hatch lines with the specified
pen (default current), with the given angle in degrees (default 45),
separation in physical units (default 0.25 cm), and phase from 0 to
1 to displace the lines by this fraction of the separation from a
fixed reference (default 0).
/PLOT
the polygon contours are drawn with the current pen,
For a color-filled and/or hatched and/or contoured polygon, these three
options can be combined; they will be executed in the above order.
Finally, the third syntax with the /RESET option allows to undefine the
POLY% variable and free the internal buffers.