void Set_Selectability (const char *list)
 Allows you to make part of your picture sensitive or insensitive to being "selected" by the user. More...
void UnSet_One_Selectability (const char *which)
 Removes a given setting established by a previous call to Set_Selectability(), rather than all settings. More...
void UnSet_Selectability (void)
 Removes all settings established by a previous call to Set_Selectability(). More...

Detailed Description

Function Documentation

◆ Set_Selectability()

void Set_Selectability ( const char *  list)

Allows you to make part of your picture sensitive or insensitive to being "selected" by the user.

list- A quoted string or a string variable containing a list of the desired settings (see below).


If the user initiates a "mouse click" or "pen down" operation, the system responds by going through the database and figuring out which segment and, possibly, which drawing primitive resulted, in whatever it is on the screen that's being pointed at. This "select" operation can be simplified for the system, and the result simplified for your program, if you use Set_Selectability() to tell the system not to bother considering some parts of your scene, or to tell the system to consider more than usual.

The list is of the form (specification, specification,...), where each specification can be either "type = value" or "no type". Embedded blanks and uppercase versus lowercase do not matter. You can specify as few or as many items in the list as you want; the types not mentioned remain unaffected.

Normally, a piece of geometry is selectable only if it is visible. To make a type of geometry selectable even when it is invisible, a "!" is added to the specification (see the NOTES section below for interactions between the "!" and the "visual selection" heuristic).

The following choices are recognized for type:

everything   Windows and every kind of geometry will be affected.   
windows      Screen windows.                                        
geometry     Every kind of geometry.                                
edges        Polygon/circle/ellipse/shell/mesh edges.               
faces        Polygon/circle/ellipse/shell/mesh faces.      
isolines     Isolines.         
lights       Area light sources.                                    
images       Images.                                                
lines        Lines and polylines.                                   
polylines    Lines and polylines.                                   
markers      Screen markers.  
vertices     Shell vertex markers.                                      
text         Text string.                                           
polygons     Both edges and faces.                                  
If no type is specified, "windows" is assumed.

The "s" on the end of "markers", "faces", etc., is optional. Using the "everything" or "geometry" choices is exactly equivalent to setting all of the "particular flavor" choices simultaneously.

The value specified for the type will apply to the specified segment and to every sub-segment which does not have its own opinion about that type. It will remain attached to this segment until another value is specified for the type, or until UnSet_One_Selectability() removes the information for that type, or until UnSet_Selectability() discards all of the specifications.

The choices for value include (see the Notes section below for exceptions):

"v"    (letter "v")---indicates that the locater device just went from "no buttons    
       pushed" to "at least one button pushed".                                       
"^"    (up-arrow or caret)---means that the locater just went from "one or more       
       buttons pushed" to "no buttons pushed".                                        
"*"    (asterisk)---means that the location has changed, and one or more buttons      
       are still pushed.                                                              
"o"    (letter O)---means that the location has changed, and there are still no but   
       tons pushed.                                                                   
"on"   is the same as v.                                                              
"off"  is the same as "no type".
"!"    (exclamation mark "!")---indicates that the geometry is selectable even if it is invisi  
If no action is specified, "v" is assumed.

More than one eligible action can be specified—just list them all in a row: "v*^", for example. Lowercase versus uppercase does not matter.

You can mix a general choice with one or more particular choices. "everything=on, markers=off", for example, will result in everything being selectable except markers. The rule is that whatever specification comes last in the list wins.

If "!" is mentioned by itself, then "on!" is assumed.


If a device does not have any selection events enabled, HOOPS does not track the state of the mouse on that device (this is useful in cases where you do not want HOOPS to query the operating system about the mouse). At the moment you Enable_Selection_Events() on the device, the previous state of the mouse buttons is undefined. Since many of the events that HOOPS reports are based on the previous state of the mouse (which is initially undefined), your application might receive spurious and unwanted events.

Normally, this does not present a problem since selection events are often enabled at the start of the application, and are never disabled (so that the mouse is always being tracked and always has a previously known state). This is not a problem even in the event you disable selection events (such as Get_Selection() does) inside a main loop, since HOOPS defers all 'disables' until the next Update_Display() (the next call to Get_Selection() ends up reenabling selection events before the previous disable has a chance to take affect).

If however, you add an additional Update_Display() in your application's event loop, any pending Disable_Selection_Events will take effect before you have a chance to re-enable them on the next loop iteration—thereby causing the previous mouse state to become "undefined". The solution is to add an additional Enable_Selection_Events() outside the event loop such that there are always more Enable's in effect than Disable's.

Visibility "off" takes precedence over Selectability "on" (unless specified as "on!"). If selectability is set as "on!", the "visual selection" heuristic will treat the object as if it were visible. This implies not only that it will obscure items behind it, but that it will be selected even though it is not visible. In other words, in any conflict between the "visual selection" heuristic and the "on!" selectability, the selectability setting takes precedence.

If a window is selectable, and the geometry in the window is also selectable, the geometry will take precedence over the window when it comes time to make a report.

Selecting on geometry is significantly more time-consuming for the system than just selecting a window.

The definition of "v" and "*", and of "^" and "O", overlap slightly. When a locater button is first pressed, if neither "v" nor "*" is enabled, no event will be reported. If "v" events are enabled and "*" events are either enabled or disabled, a "v" event will be reported. If "*" events are enabled and "v" events are disabled, a "*" event will be reported. "^" and "O" work similarly.

It is syntactically legal to specify a Selectability for "Lights," but the exercise isn't meaningful in this release.


See also
Set_Visibility, Get_Selection, Enable_Selection_Events, Compute_Selection,

◆ UnSet_One_Selectability()

void UnSet_One_Selectability ( const char *  which)

Removes a given setting established by a previous call to Set_Selectability(), rather than all settings.

which- A particular selectability to be unset.


No additional details. See Set_Selectability()

◆ UnSet_Selectability()

void UnSet_Selectability ( void  )

Removes all settings established by a previous call to Set_Selectability().


No additional details. See Set_Selectability()