Brief Index      Full Index      Events Index      I.M. Reference

Show_Selection_Source


Functions

void Show_Selection_Source (char *locater, char *picture, char *action, int *status)
void Show_Selection_Source_Element (int *vertex, int *edge, int *face, HC_POINT *hit_location)

Function Documentation

void Show_Selection_Source ( char *  locater,
char *  picture,
char *  action,
int *  status 
)

Returns the locater-device segment, the picture segment, and the user action that gave rise to the current selection event.

Parameters:
locater - The segment associated with the physical locaterdevice that initiated the current event. Passed by reference always. Returned to user.
picture - The segment that the system tested for selections in. Passed by reference always. Returned to user.
action - A special string indicating the user action that gave rise to the current event. Currently either "v", "^", "*", or "O". Passed by reference always. Returned to user.
status - Bit-encoded value representing the state (or the new state, if the state just changed) of the keyboard and (on some systems) of the mouse buttons. Passed by reference always. Returned to user.

DETAILS

Show_Selection_Source() is one of a family of routines that extracts information from the current event (presumably a selection event) and returns it to you. In particular, Show_Selection_Source() returns the locater and picture segment combination that was originally enabled for selection events, which then gave rise to the selection event now at hand. This information might be of interest if your program is handling several different displays or input devices simultaneously.

It also returns the particular user action, out of all the various enabled actions. See Enable_Selection_Events() for details about the possible values for this. The action type might be of interest if you need to differentiate, for example, between a button being pushed and released in a pop-up menu.

Status is a device-dependent bit-encoded value representing the state of the mouse buttons and (if the information is available) of the keyboard shift keys at the time of the event. You can use this information to differentiate between one button and another on a multibutton mouse, or to implement "control-mouse-click" and "shift-mouse-click" functionality.

If the first modifier key was currently pressed (usually the leftmost mouse button), then bit zero of status will be on. If the second modifier key was currently pressed, then bit one will be on independently of the state of bit zero, etc.

NOTE

If you're using the status value it should mean that you're sure of the kind of keyboard and operating system interface you're going to have---none of the bits of status are guaranteed to exist. (If a bit has no definition, it will always be set to zero.)

If your programming language doesn't allow for explicitly testing bit N of integer status, an equivalent test you might use is

btnsrc.gif

NOTES

RESTRICTIONS

See also:
Enable_Selection_Events, Show_Selection, Show_Selection_Element, Show_Selection_Position, Show_Selection_Pathname, Show_Selection_Keys.

void Show_Selection_Source_Element ( int *  vertex,
int *  edge,
int *  face,
HC_POINT *  hit_location 
)

Returns the location on a shell where a hit would occur if that shell was moved along the vector to the nearest piece of geometry.

Parameters:
vertex - Index into the pointlist that defines the nearest vertex. Passed by reference. Returned to user.
edge - Index into the pointlist that together with point i defines the nearest edge of the hit point. Passed by reference. Returned to user.
face - Index into the facelist that defines the face where the hit occurs. Passed by reference. Returned to user.
hit_location - The exact (x, y, z) location of the hit. This coordinate is in the object space of the specified shell. Passed by reference. Returned to user.

DETAILS

This function can be used in conjunction with the point returned from Show_Selection_Position() to establish the vector to the object that is closest to a given shell. This vector can then be used as input in a call to Compute_Selection_Distance_By_Shell(), to find the exact distance the shell would have to be moved before hitting another piece of geometry.

See also:
Compute_Selection_Distance_By_Shell, Show_Selection, Show_Selection_Element, Show_Selection_Position, Show_Selection_Pathname, Show_Selection_Keys.

Brief Index      Full Index      Events Index      I.M. Reference