PICK_FROM_SEGMENT(3G)
NAME
pick_from_segment − initiate a pick from a segment
SYNOPSIS
C Syntax:
void pick_from_segment(fildes,segno,found)
int fildes,segno;
int *found;
FORTRAN77 Syntax:
subroutine pick_from_segment(fildes,segno,found)
integer*4 fildes,segno,found
Pascal Syntax:
procedure pick_from_segment(fildes,segno:integer; var found:integer );
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
segno Name of segment from which to start the pick
Output Parameters
found Set to TRUE (1) if a primitive is found, otherwise is set to FALSE (0).
Discussion
Pick_from_segment traverses the specified segment network of the specified graphics device searching for hits on primitives.
A hit on a primitive occurs when a visible primitive intersects the pick aperture (see set_pick_window(3G) and set_pick_depth(3G)). If a hit occurs on one or more primitives, found is set to TRUE (1). Otherwise, found is set to FALSE (0). A path to the picked primitive can be inquired using inq_pick_path(3G).
The number of primitives that can potentially be "hit" is equal to the number of primitives falling within the pick aperture. The pick mode, as defined by set_pick_mode(3G), determines which hit primitive will be accepted. Default behavior is to accept the first primitive intersecting the pick aperture.
Device coordinate (dc) primitives cannot generate a hit.
If the specified segno does not exist, an error is generated.
Set_traversal_depth(3G) can be used to limit the traversal depth. The default maximum traversal depth limits traversal processing to 42 call_segment elements. If a call_segment element would exceed the maximum traversal depth, a warning is generated and the call_segment element is not traversed.
Segment network traversal can also be limited by pick traversal control elements (see set_pick_traversal_control(3G)).
Like the display traversal process, the pick traversal process executes elements that may alter the state of Starbase and the graphics display device. The current position (CP) is undefined after calling pick_from_segment.
ERRORS
1 Graphics device is not initialized for this operation.
39 Specified segment does not exist.
1042 Warning: Traversal attempted beyond specified maximum traversal depth.
HARDWARE DEPENDENCES
For bit-mapped displays, pick traversal performance can be improved by using traversal_lock(3G). This call gains exclusive access to the display during pick traversal, postponing all other display updates (such as printing in terminal emulator windows) while pick traversal is in progress.
SEE ALSO
inq_pick_path(3G), inq_pick_path_depth(3G), set_disp_traversal_control(3G),
set_pick_depth(3G), set_pick_mode(3G), set_pick_window(3G),
set_pick_traversal_control(3G), set_traversal_depth(3G),
traversal_lock(3G).
Hewlett-Packard Company — December 25, 1986