SAMPLE STROKE(3P) — SUNPHIGS LIBRARY
NAME
SAMPLE STROKE − sample the current measure of a stroke device
SYNOPSIS
C Syntax
void
psamplestroke ( ws, dev, stroke )
Pintws;workstation identifier
Pintdev;stroke device number
Pstroke∗stroke;OUT stroke data
FORTRAN Syntax
SUBROUTINE psmsk ( WKID, SKDNR, N, VIEWI, NP, PXA, PYA )
INTEGERWKIDworkstation identifier
INTEGERSKDNRstroke device number
INTEGERNmaximum number of points
INTEGERVIEWIOUT view index
INTEGERNPOUT number of points
REALPXA(N), PYA(N)OUT points in stroke (WC)
Required PHIGS Operating States
(PHOP, WSOP, ∗, ∗)
DESCRIPTION
Purpose
Use SAMPLE STROKE to sample the current measure of the specified stroke device without waiting for the device trigger to fire. The device must be in SAMPLE mode. See SET STROKE MODE and INITIALIZE STROKE for more information.
C Parameters
wsWorkstation identifier. An integer specifying the workstation with which the specified stroke device is associated.
devThe device number of the stroke device to be sampled. See the Available Devices section of INITIALIZE STROKE for a description of the available devices.
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 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. 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 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 for a description of the available devices.
NThe maximum number of points to store in PXA and PYA.
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
SAMPLE STROKE samples the specified stroke device. The device must be in SAMPLE mode. See SET STROKE MODE and INITIALIZE STROKE for more information.
When a device is set to SAMPLE mode, a measure process is created for the device and the device is activated. When SAMPLE STROKE is called, the current value of the measure process for the specified device is retrieved without waiting for the device’s trigger to fire.
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. See INITIALIZE STROKE and SET VIEW TRANSFORMATION INPUT PRIORITY for a description of how this view representation is determined. The workstation transform is used to transform the Device Coordinate (DC) position to a NPC position.
Note: The 2D and 3D stroke measure processes are the same except that the 2D process discards the z coordinate. The 3D version of this function, SAMPLE STROKE 3, can be used if the value of the z coordinate is needed.
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
252Ignoring function, the function requires the input device to be in SAMPLE Mode
SEE ALSO
INITIALIZE STROKE (3P)
SET STROKE MODE (3P)
REQUEST STROKE 3 (3P)
GET STROKE (3P)
INQUIRE STROKE DEVICE STATE (3P)
SAMPLE STROKE 3 (3P)
Sun Release 4.0 — Last change: 1 August 1989