REQUEST STROKE(3P) — Kubota Pacfic Computer Inc. (29 February 1991)
NAME
REQUEST STROKE − request an operator interaction with a stroke device
SYNOPSIS
C Syntax
void
preq_stroke ( ws, dev, in_status, view_ind, stroke )
Pintws;workstation identifier
Pintdev;stroke device number
Pin_status∗in_status;OUT input status
Pint∗view_ind;OUT view index
Ppoint_list∗stroke;OUT stroke
Required PHIGS Operating States
(PHOP, WSOP, ∗, ∗)
DESCRIPTION
Purpose
Use REQUEST STROKE to request an operator interaction with a specified stroke device. The device must be in request mode. See SET STROKE MODE and INITIALIZE STROKE for more information. See the Available Devices section of INITIALIZE STROKE 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 for a description of the available stroke devices.
C Output Parameter
in_status
A pointer to the location to store the status of the request. Pin_status is defined in phigs.h as follows:
typedef enum {
PIN_STATUS_NONE,
PIN_STATUS_OK,
PIN_STATUS_NO_IN
} Pin_status;
view_ind
A pointer to the location to store the view index used to transform the Device Coordinate (DC) positions to World Coordinate (WC) points.
strokeA pointer to the location to store the stroke points. Ppoint_list is defined in phigs.h as follows:
typedef struct {
Pintnum_points;/∗ number of points in the list ∗/
Ppoint∗points;/∗ list of points ∗/
} Ppoint_list;
num_points is the number of points in points.
points is the array of Ppoint structures specifying the points in WC. 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. 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;
Execution
REQUEST STROKE 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 PIN_STATUS_NO_IN is returned and the stroke data is undefined. If a status of PIN_STATUS_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 WC 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 (NPC) to WC. The positions are the positions of the stroke in WC. Note: The 2D and 3D stroke measure processes are the same except that the 2D process discards the z coordinates. The 3D version of this function, REQUEST STROKE 3, can be used if the z coordinates are needed.
See INITIALIZE STROKE for a description of the available stroke devices.
ERRORS
003Ignoring function, function requires state (PHOP, WSOP, ∗, ∗)
054Ignoring function, the specified workstation is not open
060Ignoring function, the specified workstation is not 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 (3P)
SET STROKE MODE (3P)
SET VIEW TRANSFORMATION INPUT PRIORITY (3P)
REQUEST STROKE 3 (3P)
September 02, 1992