POLYGON(3G)
NAME
dcpartial_polygon, dcpolygon, intpartial_polygon2d, intpolygon2d, partial_polygon2d, partial_polygon3d, polygon2d, polygon3d − defines a polygonal region to be filled and/or edged, or defines a group of polygon vertices that begins as subpolygon or non-edged boundary.
SYNOPSIS
C Syntax:
void dcpartial_polygon(fildes,clist,numverts,flags,closure);
int fildes,numverts,flags,closure,clist[];
void dcpolygon(fildes,clist,numverts,flags);
int fildes,numverts,flags;
int clist[];
void intpartial_polygon2d(fildes,clist,numverts,flags,closure);
int fildes,numverts,flags,closure,clist[];
void intpolygon2d(fildes,clist,numverts,flags);
int fildes,numverts,flags,clist[];
void partial_polygon2d(fildes,clist,numverts,flags,closure);
int fildes,numverts,flags,closure;
float clist[];
void partial_polygon3d(fildes,clist,numverts,flags,closure);
int fildes, numverts,flags,closure;
float clist[];
void polygon2d(fildes,clist,numverts,flags);
int fildes,numverts,flags;
float clist[];
void polygon3d(fildes,clist,numverts,flags);
int fildes,numverts,flags;
float clist[];
FORTRAN77 Syntax:
subroutine dcpartial_polygon(fildes,clist,numverts,flags,closure)
integer*4 fildes,numverts,flags,closure
integer*4 clist(numverts*(2+flags))
subroutine dcpolygon(fildes,clist,numverts,flags)
integer*4 fildes,numverts,flags
integer*4 clist(numverts*(2+flags))
subroutine intpartial_polygon2d(fildes,clist,numverts,flags,closure)
integer*4 fildes,numverts,flags,closure,clist(numverts*(2+flags))
subroutine intpolygon2d(fildes,clist,numverts,flags)
integer*4 fildes,numverts,flags,clist(numverts*(2+flags))
subroutine partial_polygon2d(fildes,clist,numverts,flags,closure)
integer*4 fildes,numverts,flags,closure
real clist(numverts*(2+flags))
subroutine partial_polygon3d(fildes,clist,numverts,flags,closure)
integer*4 fildes,numverts,flags,closure
real clist(numverts*(3+flags))
subroutine polygon2d(fildes,clist,numverts,flags)
integer*4 fildes,numverts,flags
real clist(numverts*(2+flags))
subroutine polygon3d(fildes,clist,numverts,flags)
integer*4 fildes,numverts,flags
real clist(numverts*(3+flags))
Pascal Syntax:
procedure dcpartial_polygon(fildes:integer; var clist:array[lo..hi:integer] of integer; numverts,flags,closure:integer);
procedure dcpolygon(fildes:integer; var clist:array[lo..hi:integer] of integer; numverts,flags:integer);
procedure intpartial_polygon2d(fildes:integer; var clist:array[lo..hi:integer] of integer; numverts,flags,closure:integer);
procedure intpolygon2d(fildes:integer; var clist:array[lo..hi:integer] of integer; numverts,flags:integer);
procedure partial_polygon2d(fildes:integer; var clist:array[lo..hi:integer] of real; numverts,flags,closure:integer);
procedure partial_polygon3d(fildes:integer; var clist:array[lo..hi:integer] of real; numverts,flags,closure:integer);
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);
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
flags polygon: If set to FALSE (0), all edges are drawn if interior_style is set to be edged.
partial_polygon: If FALSE (0), the first vertex represents a non-drawn boundary. The remaining vertices represent drawn boundaries if interior_style is set to be edged.
polygon and partial_polygon: If set to TRUE (1), each polygon edge can be either a drawn boundary or a non-drawn boundary, depending on the value of the corresponding move/draw indicator and whether or not interior_style is set to be edged. If the indicator is non-zero (draw) and interior_style is set to edged, the boundary is drawn. Otherwise, it is not drawn. Non-drawn boundaries simply define the edges of the filled area.
clist Array of real or integer data with or without move/draw indicators embedded after each endpoint.
closure partial_polygon: If TRUE (1), the polygon vertex list is non-empty, and the last subpolygon is not yet closed, a boundary is added to close that subpolygon within the boundary. If the first polygon vertex in the partial polygon had a draw indicator, the closure boundary is drawn. Otherwise, it is not drawn. Partial_polygon then adds the vertices in clist to the polygon vertex list.
numverts Number of polygon vertices in the clist array. If the value is less than zero, zero is substituted.
Discussion
A boundary of a polygonal region is defined by connecting each vertex to its successor in the vertex list. The polygon is filled and/or outlined according to current interior style, 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 (a single 32-bit value), and are interspersed with the coordinate data. For polygon2d, partial_polygon2d, intpolygon2d, intpartial_polygon2d, dcpartial_polygon and dcpolygon each (x,y) pair of coordinates is followed by a move/draw indicator if flags is TRUE(1). For polygon3d and partial_polygon3d each (x,y,z) triplet is followed by a move/draw indicator if flags is TRUE(1).
Partial_polygon puts polygon vertices into an internal polygon data structure. Only after a call is made to polygon, circle, arc, ellipse, or rectangle will the polygon be rendered. Partial_polygon is most commonly used to create "holes" in polygons.
Each entry in the clist can contain any number of coordinates. The actual number depends on the coord parameter specified in vertex_format if using device coordinates or floating point coordinates. vertex_format does not apply to intpolygon2d or intpartial_polygon2d . The coord parameter can be used to skip over any extra coordinates following the usual 2, 3, or 4 that can be specified with this procedure. Vertex move/draw flags follow the skipped extra coordinates.
The use parameter specified in vertex_format determines whether any of the extra parameters are used to determine the color of the primitive. The following list shows in what order the data is expected. Any extra coordinates are skipped.
use=0 For 2d,dc: x,y,...,(flag)
For 3d: x,y,z,...,(flag)
use=1 For 2d,dc: x,y,i,...,(flag)
For 3d: x,y,z,i,...,(flag)
use=3 For 2d,dc: x,y,a,b,c,...,(flag)
For 3d: x,y,z,a,b,c,...,(flag)
All extra parameters are ignored by some devices.
Upon entry, the polygon vertex list is added to, not cleared. The polygon list is then processed by filling all vertices in the list, and cleared upon exit. The flag at the beginning (i.e., the first entry) of the clist for partial_polygon is used to create sub-polygons.
The current position is updated to the first vertex in the first partial_polygon/polygon upon completion of the polygon.
If per-polygon normal is set in vertex_format, the first vertex in polygon3d is used as a normal to that polygon, and the number of vertices in the clist should be numverts + 1. The normal must contain the same number of coordinates as every other vertex (extra coordinates are ignored).
If normals per polygon is specified in vertex_format, the normal is contained in the polygon vertex list; not in the partial_polygon list. If a normal needs to be calculated, the first 3 points of the first partial_polygon are used. The vertex list for the first partial polygon must contain at least 3 points or the normal cannot be calculated correctly.
Integer operations are only available when using the INT_XFORM gopen mode. When in INT_XFORM mode, floating point operations are not available for that fildes. Floating point operations are the default, or can be specified with FLOAT_XFORM mode. For a list of integer operations, floating point operations and common operations see the starbase.3g manual page.
NOTE
Any Starbase call other than intpartial_polygon2d, intpartial_arc, intpartial_circle, partial_polygon2d, partial_polygon3d, partial_arc, partial_ellipse, or dcpartial_polygon, in the middle of a list of these procedure calls and before a call to arc, circle, ellipse, polygon or rectangle produces unpredictable, device-dependent results.
SEE ALSO
fill_color(3G), interior_style(3G), perimeter_color(3G), perimeter_repeat_length(3G), perimeter_type(3G), write_enable(3G), vertex_format(3G).
Hewlett-Packard Company — May 11, 2021