psample_stroke(3g) — Subroutines
Name
psample_stroke − Returns the 2D coordinates of the points in a stroke from the stroke-class logical input device specified.
Operating States: PHOP, WSOP, ∗, ∗
PHIGS standard function
Syntax
void psample_stroke (
Pint wsid, /∗ (I) Workstation identifier ∗/
Pint dev_num, /∗ (I) Stroke device number ∗/
Pint ∗view_index, /∗ (O) View index ∗/
Ppoint_list ∗stroke /∗ (O) Points in the stroke ∗/
)
Data Structures
typedef struct {
Pint num_points; /∗ number of Ppoints in the list ∗/
Ppoint ∗points; /∗ list of points ∗/
} Ppoint_list;
typedef struct {
Pfloat x; /∗ x coordinate ∗/
Pfloat y; /∗ y coordinate ∗/
} Ppoint;
Description
psample_stroke takes the current measure of the stroke-class logical input device specified by the device number and the workstation identifier, and returns the world coordinate points and the view index of the view transformation Digital PHIGS uses to translate the normalized projection coordinate points to the world coordinate points. This function ignores the z-coordinate components and returns a two-dimensional result.
Digital PHIGS uses the current workstation transformation to translate the device coordinate points to normalized projection coordinate points. See Getting Started with DEC PHIGS for more information about view indexes.
If you generate a stroke that contains more points than the number of components in the stroke buffer, you can obtain the additional input through repeated calls to psample_stroke. To establish a stroke buffer size, call the pinit_stroke function.
The application allocates the memory for the point list returned by this function. The maximum size of the returned stroke point list is specified by pinit_stroke. To determine the maximum size of a stroke point list supported by Digital PHIGS, call pinq_def_stroke_data.
See Also
pget_stroke
pinit_stroke
pinq_stroke_st
preq_stroke
psample_stroke3
pset_stroke_mode
pset_view_tran_in_pri