REQUEST STROKE 3(3P) — SUNPHIGS LIBRARY
NAME
REQUEST STROKE 3 − request an operator interaction with a stroke device
SYNOPSIS
C Syntax
void
preqstroke3 ( ws, dev, stroke )
Pintws;workstation identifier
Pintdev;stroke device number
Pqstroke3∗stroke;OUT requested stroke data
FORTRAN Syntax
SUBROUTINE prqsk3 ( WKID, SKDNR, N, STAT, VIEWI, NP, PXA, PYA, PZA )
INTEGERWKIDworkstation identifier
INTEGERSKDNRstroke device number
INTEGERNmaximum number of points
INTEGERSTATOUT status (PNONE, POK)
INTEGERVIEWIOUT view index
INTEGERNPOUT number of points
REALPXA(N), PYA(N), PZA(N) OUT points in stroke (WC)
Required PHIGS Operating States
(PHOP, WSOP, ∗, ∗)
DESCRIPTION
Purpose
Use REQUEST STROKE 3 to request an operator interaction with a specified stroke device. The device must be in request mode. See SET STROKE MODE and INITIALIZE STROKE 3 for more information. See the Available Devices section of INITIALIZE STROKE 3 for a description of the available stroke devices.
The request suspends PHIGS until the specified device is triggered, or the operator performs a BREAK. A BREAK is performed by typing the CONTROL and D keys simultaneously (^D).
C Input Parameters
wsWorkstation identifier. An integer specifying the workstation with which the requested stroke device is associated.
devThe device number of the requested stroke device. See the Available Devices section of INITIALIZE STROKE 3 for a description of the available stroke devices.
strokeA pointer to a Pqstroke3 data structure containing the status of the request and, if available, the stroke data. Pqstroke3 is defined in phigs.h as follows:
typedef struct {
Pistatusstatus;/∗ status of request ∗/
Pstroke3stroke; /∗ stroke data ∗/
} Pqstroke3;
Pistatus is defined in phigs.h as follows:
typedef enum {
PSTAT_OK,
PSTAT_NONE
} Pistatus;
Pstroke3 is defined in phigs.h as follows:
typedef struct {
Pintview_index;/∗ view index ∗/
Pintn_points;/∗ number of points in stroke ∗/
Ppoint3∗points;/∗ points in stroke ∗/
} Pstroke3;
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 Ppoint3 structures specifying the 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. Ppoint3 is defined in phigs.h as follows:
typedef struct {
Pfloatx;/∗ x coordinate ∗/
Pfloaty;/∗ y coordinate ∗/
Pfloatz;/∗ z coordinate ∗/
} Ppoint3;
FORTRAN Input Parameters
WKIDThe workstation identifier of the workstation associated with the device.
SKDNR
The device number of the STROKE device. See the Available Devices section of INITIALIZE STROKE 3 for a description of the available devices.
NThe maximum number of stroke points to return.
STATThe request status. Valid values as defined in phigs77.h are:
• PNONE(BREAK)
• POK(OK)
VIEWI
The view index used to map the stroke points to world coordinates. This value is defined only if the status returned is OK.
NPThe actual number of stroke points.
PX, PY, PZ
The arrays of world coordinate stroke positions. These are only used if the status returned is OK.
Execution
REQUEST STROKE 3 requests a logical input value from the specified stroke device. The specified device must be in request mode. See SET STROKE MODE for more information.
REQUEST STROKE creates a measure process for the specified device and suspends PHIGS until the device is triggered or the operator issues a BREAK. A BREAK is generated by the operator by depressing the Control and D keys simultaneously (^D).
If a BREAK occurs, a status of NONE is returned and the stroke data is undefined. If a status of OK is returned the stroke data is available. In either case the measure process is then terminated, and PHIGS processing resumes.
A stroke measure consists of a view index and world coordinate positions. The view index specifies the view representation from the workstation’s view table that was used to map the stroke positions from Normalized Projections Coordinates to World Coordinates. The positions are the positions of the stroke in World Coordinates. Note: The 2D and 3D stroke measure processes are the same except that the 2D process discards the z coordinates. The 2D version of this function, REQUEST STROKE, can be used if the z coordinates are not needed.
See INITIALIZE STROKE 3 for a description of the available stroke devices.
ERRORS
003Ignoring function, function requires state (PHOP, WSOP, ∗, ∗)
054Ignoring function, the specified workstation is not open
061Ignoring function, specified workstation is neither of category INPUT nor of category OUTIN
250Ignoring function, the specified device is not available on the specified workstation
251Ignoring function, the function requires the input device to be in REQUEST mode
SEE ALSO
INITIALIZE STROKE 3 (3P)
SET STROKE MODE (3P)
REQUEST STROKE (3P)
Sun Release 4.0 — Last change: 1 August 1989