Functions | |
int | Begin_Buffered_Selection (const char *start_name, double left, double right, double bottom, double top, const char *options) |
int Begin_Buffered_Selection | ( | const char * | start_name, |
double | left, | ||
double | right, | ||
double | bottom, | ||
double | top, | ||
const char * | options | ||
) |
Prepares HOOPS for the buffered selection process and allows the valid selection area (typically, the entire window) to be specified.
start_name | - The fully-qualified name of a window segment. |
left | - The left bound of the valid selection area, in window coordinates. |
right | - The left bound of the valid selection area, in window coordinates. |
bottom | - The left bound of the valid selection area, in window coordinates. |
top | - The left bound of the valid selection area, in window coordinates. |
options | - A quoted string or a string variable containing a list of desired options. Passed by reference always. |
HOOPS supports a selection process called 'buffered selection' which instructs HOOPS to redraw the area of the scene specified by the left/right/bottom/top into an offscreen selection buffer, and is subsequently queried using Collect_Area_Samples. That buffer is left intact for query until End_Buffered_Selection is called. This selection approach allows the user to only select on what is current visible in the scene, and leverages the hardware-accelerated capabilities of specific 3D HOOPS drivers.
In addition to providing a way of only selecting on what's visible, buffered selection can provide a performance boost for situations where you need to perform multiple selections in a row. For example, perhaps you need to query or highlight/dehighlight multiple times on a scene which is not getting edited/redrawn between each selection.
A typical flow of buffered selection is as follows:
During the process of redrawing the scene into the selection buffer:
A call to Begin_Buffered_Selection must always be matched with a call to End_Buffered_Selection, and calls to Collect_Area_Samples and Find_Next_Sample should only be called in between. If Begin_Buffered_Selection is called and the scene is then edited in some way (the camera is moved, objects are deleted/edited, attributes are changed, etc...), and Collect_Area_Samples is then called to perform a selection query into the buffer, the buffer is 'out of date' and results would be unexpected/invalid.
Buffered selections is only supported when using the OpenGL2 and DX11 drivers.