GET LOCATOR(3P) — SUNPHIGS LIBRARY
NAME
GET LOCATOR− retrieve the 2D LOCATOR measure from the PHIGS current event report
SYNOPSIS
C Syntax
void
pgetloc ( locator )
Ploc∗locator;OUT locator data
FORTRAN Syntax
SUBROUTINE pgtlc ( VIEWI, LPX, LPY )
INTEGERVIEWI OUT view index
REALLPX, LPY OUT locator position in world coordinates
Required PHIGS Operating States
(PHOP, WSOP, ∗, ∗)
DESCRIPTION
Purpose
Use GET LOCATOR to retrieve the 2D components of the measure (logical input value) of the LOCATOR device from the current event report in the PHIGS state list.
A LOCATOR device measure consists of a position and a view index. Position is the World Coordinate (WC) point corresponding to the position on the workstation selected by the operator. The view index is the index of the view representation used to transform position from Normalized Projection Coordinates (NPC) to World Coordinates. See INITIALIZE LOCATOR 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.
C Output Parameters
locatorA pointer to a Ploc structure in which to store the LOCATOR measure. Ploc is defined in phigs.h as follows:
typedef struct {
Pintview_index;
Ppointposition;
} Ploc;
view index is the index of the view representation used to transform the NPC position to a WC position.
position is a Ppoint structure specifying the 2D locator position in World Coordinates. Ppoint is defined in phigs.h as follows:
typedef struct {
Pfloatx;/∗ x coordinate ∗/
Pfloaty;/∗ y coordinate ∗/
} Ppoint;
FORTRAN Output Parameters
VIEWI
The index of the view representation used to transform the NPC position to a WC position.
LPX, LPY
The 2D locator position in World Coordinates.
Execution
GET LOCATOR retrieves the 2D components of the LOCATOR 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 LOCATOR event, GET LOCATOR is used to retrieve the measure from the current event report.
See INITIALIZE LOCATOR 3 for a description of the available LOCATOR 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 LOCATOR (3P)
AWAIT EVENT (3P)
GET LOCATOR 3 (3P)
Sun Release 4.0 — Last change: 12 July 1989