POLYGON(3G)
NAME
polygon − defines a polygonal region to be filled and/or edged.
SYNOPSIS
C SYNTAX
void polygon2d(fildes,clist,numverts,flags);
int fildes,flags,numverts;
float clist[];
void polygon3d(fildes,clist,numverts,flags);
int fildes,flags,numverts;
float clist[];
void dcpolygon(fildes,clist,numverts,flags);
int fildes,flags,numverts;
int clist[];
FORTRAN77 SYNTAX
subroutine polygon2d(fildes,clist,numverts,flags)
integer*4 fildes,flags,numverts
real clist(numverts*(2+flags))
subroutine polygon3d(fildes,clist,numverts,flags)
integer*4 fildes,flags,numverts
real clist(numverts*(3+flags))
subroutine dcpolygon(fildes,clist,numverts,flags)
integer*4 fildes,flags,numverts
integer*4 clist(numverts*(2+flags))
PASCAL SYNTAX
procedure polygon2d(fildes:integer;
var clist:array[lo..hi:integer] of real;
numverts,flags:integer);
procedure polygon3d(fildes:integer;
var clist:array[lo..hi:integer]of real;
numverts,flags:integer);
procedure dcpolygon(fildes:integer;
var clist:array[lo..hi:integer] of integer;
numverts,flags:integer);
HP-UX COMPATIBILITY
Level: HP-UX/STANDARD
Origin: ANSI Computer Graphics Interface
DESCRIPTION
INPUT PARAMETERS
fildes
is an integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
flags
If set to FALSE (0), all edges are drawn if interior_style is set to be edged.
If set to TRUE (1), each polygon edge can either be a drawn boundary or a non-drawn boundary depending on the value of the corresponding move-draw indicator and whether interior_style is set to be edged. If the indicator is non-zero (draw) and interior_style is set to edged, then the boundary is drawn, otherwise it is not drawn. Non-drawn boundaries simply define an edge to be filled to.
Move-draw indicators occupy the same space as one coordinate and are interspersed with the coordinate data. All bits of the indicator must be zero to indicate a move (integer 0 or real 0.0). If the data is 2d, each (x,y) pair of coordinates is followed by a move draw indicator. If the data is 3d, each (x,y,z) triplet is followed by a move-draw indicator. For example:
2-dimensions3_dimensions
x1x1
y1y1
m/d1z1
x2m/d1
y2x2
m/d2y2
.z2
.m/d2
..
..
clist
array of real endpoint data or device coordinate data with or without move/draw indicators embedded after each endpoint.
numverts
number of polygon vertices in the clist array.
DISCUSSION
A boundary of a polygonal region is defined by connecting each vertex to it successor in the coordinate list.
It is filled and/or outlined according to the current interior style. polygon uses the current fill color and perimeter attributes. As with all output primitives it is affected by the current drawing mode and write enable.
Move-draw indicators occupy the same space as one coordinate (one 32-bit value), and are interspersed with the coordinate data. For polygon2d, each (x,y) pair of coordinates is followed by a move-draw indicator if flags is TRUE (1 for Pascal). For polygon_3d, each (x,y,z) triplet is followed by a move-draw indicator if flags is TRUE (1 for Pascal).
The polygon vertex list will be added to and not cleared upon entry. The polygon list will then be processed by filling all vertices in the list and then cleared upon exit. Sub-polygons are achieved using the flag at the beginning of partial_polygon.
The current position is updated to the first vertex in the first partial_polygon/polygon upon completion of the polygon.
SEE ALSO
drawing_mode(3g), fill_color(3g), interior_style(3g), partial_polygon(3g), perimeter_color(3g), perimeter_type(3g), perimeter_repeat_length(3g), write_enable(3g).
Hewlett-Packard Company — May 11, 2021