POLYLINE(3P) — Kubota Pacfic Computer Inc. (29 February 1991)
NAME
POLYLINE − create structure element specifying 2D polyline
SYNOPSIS
C Syntax
void
ppolyline ( point_list )
Ppoint_list∗point_list;list of points
Required PHIGS Operating States
(PHOP, ∗, STOP, ∗)
DESCRIPTION
Purpose
The POLYLINE function places a structure element containing the full specification of a 2D polyline into the currently open structure, according to the current edit mode. A 2D polyline primitive is a set of connected straight lines in two dimensions, x and y. The z coordinate is assumed to be 0. The polyline is defined by a series of points in Modelling Coordinates (MC). A polyline may be closed or self-intersecting.
C Input Parameters
point_list
A pointer to a Ppoint_list structure containing a list of Ppoint structures, which contain the x and y coordinates for each point. At least two points must be specified; a polyline structure element that has fewer than two points will be treated in a workstation-dependent fashion.
The Ppoint_list structure is defined in phigs.h as follows:
typedef struct {
Pintnum_points;/∗ number of Ppoints in the list ∗/
Ppoint∗points;/∗ list of points ∗/
} Ppoint_list;
The num_points component specifies the number of elements in the list. The points component is a pointer to a list of Ppoints num_points long. The Ppoint structure is defined in phigs.h as follows:
typedef struct {
Pfloatx;/∗ x coordinate ∗/
Pfloaty;/∗ y coordinate ∗/
} Ppoint;
Execution
If the current edit mode is INSERT, the POLYLINE element is inserted into the open structure after the element pointed to by the element pointer. If the edit mode is REPLACE, the POLYLINE element replaces the element pointed to by the element pointer. In either case, the element pointer is updated to point to the new POLYLINE element.
When the structure is traversed, the polyline element draws straight lines between the points specified, beginning with the first point and ending with the last. The current values of the attributes listed below will be applied to the polyline when it is drawn.
The coordinates used to specify the polyline primitive are MC. These may be any coordinate units that are convenient to the application. At traversal, these coordinate values are transformed by the current local and global modelling transformations, the view representation selected by the current view index, and the workstation transformation current on the workstation to which the structure is posted.
Attributes Applied
The attributes listed below are used to display the POLYLINE primitive when the structure is traversed. The Aspect Source Flags (ASFs) tell where to access the output display attributes. These attributes can come directly from the traversal state list, or they can be accessed indirectly, using the appropriate index in the traversal state list and the corresponding bundled representation in the PHIGS workstation state list.
polyline colourpolyline colour index ASF
linewidth scale factorlinewidth scale factor ASF
linetypelinetype ASF
polyline shading methodpolyline shading method ASF
polyline index
depth cue index
name set
ERRORS
005Ignoring function, function requires state (PHOP, ∗, STOP, ∗)
SEE ALSO
INQUIRE POLYLINE FACILITIES (3P)
POLYLINE 3 (3P)
POLYLINE SET 3 WITH DATA (3P+)
September 02, 1992