Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

inquire_hit(3G)

inq_pick_path(3G)

inq_pick_path_depth(3G)

pick_from_segment(3G)

set_pick_depth(3G)

set_pick_window(3G)

set_pick_mode(3G)

NAME

set_pick_mode − set picking mode used by pick_from_segment(3G)

SYNOPSIS

C Syntax:

void set_pick_mode(fildes, check_hit)
int fildes;
void (*check_hit)();

void check_hit(fildes, result);
int *fildes, *result;

FORTRAN77 Syntax:

subroutine set_pick_mode( fildes, check_hit)
integer*4 fildes, subroutine check_hit

subroutine check_hit(fildes, result);
integer*4 fildes, result

Pascal Syntax:

procedure set_pick_mode( fildes:integer;
procedure check_hit:integer);

procedure check_hit(var fildes, result:integer);

DESCRIPTION

Input Parameters

fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened. 

check_hit Name of a function that determines the pick mode

Discussion

set_pick_mode provides control over the method of hit acceptance used by pick_from_segment(3G).  A hit on a primitive occurs during picking when a visible primitive (not clipped) intersects the pick aperture.  One of the hit primitives will be accepted as the picked primitive.  The value of the check_hit parameter defines the hit acceptance mechanism that will be used. 

Here are the predefined values for the check_hit parameter and their effect on pick_from_segment(3G):

PK_FIRST pick_from_segment stops checking hits when the first hit is detected, but continues traversal through the remainder of the traversal network. 

PK_DEV_CLOSEST
On certain devices, this flag will cause the primitive closest to the center of the pick aperture to be accepted. Otherwise, if the device does not support this mode, PK_FIRST will be substituted by default.

PK_LAST pick_from_segment will traverse the entire network and accept the last primitive hit. 

In addition to these predefined values, the application can define its own check_hit procedure.  The check_hit procedure is invoked from pick_from_segment (3G) each time a hit is detected.  The pick_loop_control value returned by the check_hit procedure determines the hit acceptance mechanism.  The return value is composed by ORing flags from the list below. 

Note that exactly one of the first two flags below must be used. 

PK_STOP Stop the traversal of the segment. 

PK_CONTINUE Continue the traversal of the segment with the next element. 

PK_ACCEPT Accept the hit.  The path to the current primitive will be set for inquiry by inq_pick_path(3G).  If pick traversal is continued, subsequent hits can take precedence dependent on the setting of this flag. 

PK_NEVER_HIT Do not call the check_hit procedure any more, even if subsequent primitives in the segment are hit.  This is normally used to complete the traversal of the segment after a hit has been accepted.  This may be desirable to set the Starbase state (attributes and transform stack) to what it would be after the segment was displayed. 

The following are the only Starbase calls that can be invoked from within the check_hit procedure.  Unpredictable results may occur if any other Starbase calls are invoked. 

inquire_hit
inq_pick_path
inq_pick_path_depth
set_pick_window
inq_pick_window
set_pick_depth
inq_pick_depth

ERRORS

1 Graphics device is not initialized for this operation. 

DEFAULTS

PK_FIRST is the default pick mode. 

SEE ALSO

inquire_hit(3G), inq_pick_path(3G), inq_pick_path_depth(3G),
pick_from_segment(3G), set_pick_depth(3G), set_pick_window(3G).

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

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