IDLitWindow::DoHitTest

Syntax | Return Value | Arguments | Keywords | Version History

The IDLitWindow::DoHitTest function method performs a hit test to determine which visualizations within the destination are displayed at a given pixel location.

Note
The objects returned in Result are the "top-level" objects (usually IDLgrModel or IDLitVisualization objects). Objects contained by the returned objects can be returned using the SUB_HIT keyword.

Syntax

Result = Obj->[IDLitWindow::]DoHitTest(X, Y [, DIMENSIONS=[width, height]] [, /ORDER] [, SUB_HIT=variable] [, UNITS={0 | 1 | 2 | 3}])

Return Value

Returns a vector of references to the objects (usually IDLgrModel or IDLitVisualization objects) that appear at the given location. If no visualizations are displayed at that location, a null reference is returned.

Arguments

X

A floating-point value representing the x-location at which the hit test is to be performed

Y

A floating-point value representing the y-location at which the hit test is to be performed.

Keywords

DIMENSIONS

Set this keyword to a two-element integer vector, [w, h], to specify the dimensions (width and height) of the hit test box. The hit test box is centered at the location specified by the X and Y arguments. Any object that falls within this hit test box will be included in the return vector. By default, the hit test box is 3 pixels by 3 pixels.

ORDER

Set this keyword to control the ordering of objects in the returned hit test list when the objects are at the same distance from the viewer. Set ORDER=0 (the default) to return the objects in the order in which they were drawn. Set ORDER=1 to return objects in the reversed order from which they were drawn.

Note
If the visualization objects use DEPTH_TEST_FUNCTION=4 (less than or equal), then it is recommended that the ORDER keyword be set to 1 to ensure that objects at the same depth are returned in the same order in which they appear visually.

SUB_HIT

Set this keyword to a named variable that will contain references to all contained visualization objects that satisfy all of the following conditions:

The results of SUB_HIT are returned in the order in which the sub-hit visualizations appear in the graphics hierarchy. Sub-hits are only returned for the first visualization.

UNITS

Set this keyword to a scalar value to indicate the units of measure for the X, Y arguments and the DIMENSIONS keyword. Valid values include:

Version History

6.0

Introduced

6.1

Added ORDER keyword