class HT_Selector
Selection renderers are special Heidi renderers for selecting
geometry in 2D or 3D. They can be used for hit testing; for example,
when a user is selecting geometry, closest to the cursor on the screen,
to be translated or moved to a new location.
Like any Heidi renderer,
a selection renderer first needs to be dynamically loaded using the HD_Load_Dynamic_Routine
with a proper DLL name and the string "HD_Selector"
as the first and second parameters respectively. Then, the application
typically sets the desired selection region or volume via corresponding
renderer options.
For a further description of the selection process , see
chapter 7, "The Selection Renderer,"
and the Sprite sample
application code.
See Also
HT_Selector_Item,
HT_Renderer
Access Methods
include_crossing, set_include_crossing
Tells the selector to pick
any items that are partially or completely inside the selection region.
one_per_key, set_one_per_key
Tells the selector to return
no more than one selected item with the same key.
set_selection_key
Sets a unique ID that the
user will apply to the object.
thin_line_limit, set_thin_line_limit
Controls when to tessellate wide lines.
show_next_selection_item
Shows the next selector
item in the HT_Selector_Item
list.
show_selection_count
Returns the number
of primitives that have been selected.
Constructor / Destructor
HT_Selector
Constructs an HT_Selector
object.
HT_Selector::HT_Selector
Purpose
Constructs an HT_Selector
object.
Synopsis
HT_Selector ()
HT_Selector (HT_Selector_Data const * in)
HT_Selector::include_crossing,
set_include_crossing
Purpose
Tells the selector to pick
any items that are partially or completely inside the selection region.
Synopsis
HT_Boolean include_crossing (void) const
void set_include_crossing (HT_Boolean in)
Details
This option, when enabled, tells the selector to pick
any items that are completely or partially inside the selection region.
When disabled, the option, tells the selector to pick
only items that are completely inside the selection region. The default
value is HT_True ¾
enabled.
The first form returns the current setting.
The second form takes a boolean value as an input parameter
and sets the option.
HT_Selector::one_per_key,
set_one_per_key
Purpose
Tells the selector to return
no more than one selected item with the same key.
Synopsis
HT_Boolean one_per_key (void) cons
void set_one_per_key (HT_Boolean in)
Details
This option, when enabled, tells the selector to return
no more than one selected item with the same key. It is typically used
when there is more than one geometry carrying an identical key and the
application is only interested in knowing if any one of the geometry is
selected. The selector will examine every single geometry and pick
only the best item of those within the selection region.
When disabled, this option will return all items that
are selected even though they may have the same key.
The default value is HK_False
¾ disabled.
The second form takes a boolean value as an input parameter
and sets the option.
HT_Selector::set_selection_key
Purpose
Sets a unique ID that the
user will apply to the object..
Synopsis
void set_selection_key (long key)t
HT_Selector::show_next_selection_item
Purpose
Shows the next selector
item in the HT_Selector_Item
list.
Synopsis
HT_Boolean show_next_selection_item (HT_Selector_Item alter * item)
Details
Once the selection
information is retrieved from show_selection_count,
if the count comes back >
0, then the application
iterates through the HT_Selector_Item
list via show_next_selection_item.
HT_Selector::show_selection_count
Purpose
Returns the number
of primitives that have been selected..
Synopsis
int show_selection_count (void)
Details
The selection information
is retrieved by calling show_selection_count
which returns the number of primitives that have been selected.
HT_Selector::thin_line_limit,
set_thin_line_limit
Purpose
Controls when to tessellate wide lines.
Synopsis
int thin_line_limit (void) const
void set_thin_line_limit (int in)
Details
The default is one, in which case any line weight larger
than one will be broken down into triangles and go through a slower yet
more accurate selection path.
These methods are implemented as a speed enhancement for
applications that do a lot of picking, wherein the pick window is known.
For example, if the pick window is known to be 5 pixels
out on each side and a lot of picking is tested against weighted lines,
it would save time to avoid tessellating these lines. Thus, if the lines
are not very thick they can be treated as 0 weight lines to enhance
picking speed.