HIT_MODE(3G)
NAME
hit_mode − enable or disable hit detection
SYNOPSIS
C Syntax:
void set_hit_mode(fildes,hit_mode)
int fildes,hit_mode;
void inquire_hit(fildes,hit)
int fildes,*hit;
FORTRAN77 Syntax:
subroutine set_hit_mode(fildes,hit_mode)
integer*4 fildes,hit_mode
subroutine inquire_hit(fildes,hit)
integer*4 fildes,hit
Pascal Syntax:
procedure set_hit_mode(fildes,hit_mode:integer);
procedure inquire_hit(fildes:integer; var hit:integer);
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
hit_mode If TRUE (1), Starbase hit detection mode is enabled.
If FALSE (0), hit detection is disabled.
Output Parameters
hit TRUE (1) if a previous Starbase primitive generated a hit. Otherwise it is FALSE (0).
Discussion
Set_hit_mode and inquire_hit provide a mechanism for detecting hits on primitives. These are useful in application programs that implement their own display list.
Set_hit_mode is used to enable and disable the Starbase hit mode. When in hit mode, primitives are not displayed, but are tested for a hit. The status of this hit testing is saved for return by inquire_hit . If a hit has occured since the last invocation of inquire_hit , hit will be TRUE (1). Calling inquire_hit resets the status of the hit test to FALSE (0).
A hit on a primitive occurs when a visible primitive intersects the pick aperture (see set_pick_aperture(3G)). Here is a list of pickable objects:
append_text
arc
draw2d
draw3d
ellipse
polygon2d
polygon3d
polyline2d
polyline3d
polymarker2d
polymarker3d
rectangle
spline_curve
spline_surface
text2d
text3d
Note that the device coordinate (dc) primitives and clear_view_surface are not pickable, and never generate hits. Partial_polygon, partial_ellipse, and partial_arc primitives are not directly pickable because they do not produce immediate output. However, they can contribute to the pickable output produced by a subsequent polygon, ellipse, or arc call. The same delayed reporting occurs for text primitives with the more flag set.
hit_mode interacts with hidden_surface. If hit mode and hidden surface removal are both enabled, the z-buffer area is restricted to the area determined by set_pick_aperture. This may affect the number of z_buffer_switch calls required (See hidden_surface(3G)). Since a primitive in the background may be drawn before a primitive in the foreground obscures it, a hit may be recorded for a primitive that is not ultimately visible. This can be prevented by drawing the complete image twice, and only calling inquire_hit during the second time through. The first time through sets the z-buffer values so that each primitive is compared with all other primitives on the second time through.
Note that pick_from_segment disables the Starbase hit mode.
ERRORS
1 Graphics device is not initialized for this operation.
DEFAULTS
Hit mode is disabled.
SEE ALSO
pick_from_segment(3G), set_pick_aperture(3G).
Hewlett-Packard Company — May 11, 2021