GET STROKE(3P) — SUNPHIGS LIBRARY
NAME
GET STROKE − retrieve the 2D STROKE measure from the PHIGS current event report
SYNOPSIS
C Syntax
void
pgetstroke ( stroke )
Pstroke∗stroke;OUT stroke data
FORTRAN Syntax
SUBROUTINE pgtsk ( N, VIEWI, NP, PXA, PYA )
INTEGERNmaximum number of points
INTEGERVIEWIOUT view index
INTEGERNPOUT number of points
REALPXA(N), PYA(N)OUT points in stroke in world coordinates
Required PHIGS Operating States
(PHOP, WSOP, ∗, ∗)
DESCRIPTION
Purpose
Use GET STROKE to retrieve the 2D components of the measure (logical input value) of the STROKE device from the current event report in the PHIGS state list.
A STROKE device measure consists of a list of World Coordinate (WC) points and a view index. The points correspond to positions on the workstation selected by the operator. The view index is the index of the view used to transform these positions from Device Coordinates (DC) to World Coordinates.
C Output Parameters
strokeA pointer to a Pstroke structure in which to store the STROKE measure. Pstroke is defined in phigs.h as follows:
typedef struct {
Pintview_index;
Pintn_points;
Ppoint∗points;
} Pstroke;
view index is the view index used to transform the DC positions to WC points.
n_points is the number of points in points.
points is the array of Ppoint structures specifying the 2D points in World Coordinates. This array must be allocated by the calling program and the array pointer assigned to this field before calling this function. The array must be at least as large as the buffer of the STROKE device that generated the event. This buffer size is set when the device is initialized. Ppoint is defined in phigs.h as follows:
typedef struct {
Pfloatx;/∗ x coordinate ∗/
Pfloaty;/∗ y coordinate ∗/
} Ppoint;
FORTRAN Input Parameter
NPThe maximum number of points to store in PXA and PYA.
FORTRAN Output Parameters
VIEWI
The view index used to transform the DC positions to WC points.
NPThe number of points in the measure.
PXA, PYA
The arrays in which to store the points in World Coordinates. The arrays must be at least as large as NP.
Execution
GET STROKE retrieves the 2D components of the STROKE measure from the current event report in the PHIGS state list. The X and Y components are returned; the Z component is discarded.
When an input device that is set to EVENT mode is triggered by the operator, an event report is added to the input event queue. The event report contains the identity and current measure of the device. AWAIT EVENT moves the measure of the oldest event in the input queue to the current event report in the PHIGS state list. If the event was a STROKE event, GET STROKE is used to retrieve the measure from the current event report.
See INITIALIZE STROKE 3 for a description of the available STROKE devices and how their measure values are determined.
ERRORS
003Ignoring function, function requires state (PHOP, WSOP, ∗, ∗)
259Ignoring function, the input device class of the current input report does not match the class being requested
SEE ALSO
INITIALIZE STROKE (3P)
AWAIT EVENT (3P)
GET STROKE 3 (3P)
Sun Release 4.0 — Last change: 1 August 1989