Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

GET STROKE(3P)  —  Kubota Pacfic Computer Inc. (29 February 1991)

NAME

GET STROKE − retrieve the 2D components of the STROKE event in the PHIGS current event report

SYNOPSIS

C Syntax

void
pget_stroke ( view_ind, stroke )
Pint∗view_ind;OUT view index
Ppoint_list∗stroke;OUT stroke

Required PHIGS Operating States

(PHOP, WSOP, ∗, ∗)

DESCRIPTION

Purpose

GET STROKE retrieves the current event report from the PHIGS state list when the event report contains a STROKE event.  Only the 2D components of the event are returned. 

A STROKE event 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 those positions to World Coordinates. 

C Output Parameters

view_ind
PHIGS sets the variable pointed to by view_ind to the index of the view representation used to transform the NPC stroke positions to WC points. 

strokePHIGS copies the number and list of stroke points selected by the operator to the variable pointed to by stroke.  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 2D WC points.  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;

Execution

GET STROKE retrieves the 2D components of the STROKE event 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 in 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 triggering 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 3 or GET STROKE is used to retrieve the 2D components of the event from the current event report.  The STROKE positions are computed by mapping the DC workstation positions selected by the operator to  WC points.  The workstation transform is used to transform the DC positions to NPC positions prior to transforming them to WC.  See INITIALIZE LOCATOR and SET VIEW TRANSFORMATION INPUT PRIORITY for a description of how PHIGS determines the view representation to use to map the NPC positions to WC. 

See INITIALIZE STROKE 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)
SET VIEW TRANSFORMATION INPUT PRIORITY (3P)
GET STROKE 3 (3P)

September 02, 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026