Data Picking

To get the data value that corresponds to a particular window location, use the PickData method of an IDLgrWindow object. Note that you must draw the view to the window before calling the PickData method.

myLoc = [myMouseEvent.x, myMouseEvent.y]      
result = myWindow->PickData(myView, myModel, myLoc, returnedXYZ) 

The PickData method returns one of the following values:

The data value at the pick is returned in the returnedXYZ argument. This value represents the mapping of the window location to the data space of the model.

The PickData method relies on the contents of the depth buffer at the time it is called to compute and return its results. Be sure that the depth buffer contents are appropriate for getting the expected results from PickData.

Note
If you set the DEPTH_WRITE_DISABLE or DEPTH_TEST_DISABLE property of an object to prevent an object from modifying the depth buffer as it is drawn, this also prevents the object from being located by the PickData method (the return value will be 0).