Introduction

Getting Started

Programming Guides

API Reference

Additional Resources

Compute_Selection_By_Key

Functions

int Compute_Selection_By_Key (const char *action, const char *start_seg, HC_KEY key, const float *matrix)
 Forces a selection event between a supplied shell, as referenced by a key, and a specified portion of a segment tree. More...
 
int DCompute_Selection_By_Key (const char *action, const char *start_seg, HC_KEY key, const double *matrix)
 

Detailed Description

Function Documentation

int Compute_Selection_By_Key ( const char *  action,
const char *  start_seg,
HC_KEY  key,
const float *  matrix 
)

Forces a selection event between a supplied shell, as referenced by a key, and a specified portion of a segment tree.

Parameters
action- One of "v", "^", "*", or "O". Action is compared against the selectability attribute settings as testing proceeds. See Set_Selectability() for a detailed explanation of actions. Additionally, Compute_Selection() explains selection options that can be used with this parameter which will affect the behavior of the selection process, such as selection level, selection limits, and sorting.
start_seg- A segment somewhere in the tree belonging to a display driver, at which point it would be good to start selection testing.
key- Key to the Shell that should be used for testing.
matrix- A transformation matrix that should be applied to the shell before performing the selection.
Returns
count - The number of objects that are touched by any part of the specified geometry.

DETAILS

This routine forces a selection event that is of a special form where the selection object is provided in object space. The routine operates with a volume that is defined by the shell and is often used to implement collision detection operators. The process of first performing the selection event, and then querying the results is similar to the more standard selection process provided by Compute_Selection().

Please note that there are a number of selection options that can be used in the action parameter which will affect the outcome of the selection process. Those options are detailed in the Compute_Selection() documentation.

NOTES

To allow for fast computation of Compute_Selection_By_Key(), shells from start_seg can be cross-referenced with spatial data structures (oct trees and/or bsp trees) that are retained between successive computations. To use this functionality, the selection event must be surrounded by calls to Begin_Shell_Selection() and End_Shell_Selection().

RESTRICTIONS

  1. Use of Begin_Shell_Selection() constitutes a promise not to perform certain operations on anything contained in the segment tree until after the matching call to End_Shell_Selection(). See Begin_Shell_Selection() for details on the restrictions imposed.
  2. Only facet-based geometries such as Shells, Meshes, NURBS Surfaces, Polygons, Polycylinders, etc. are selectable.

    See also
    Compute_Selection_By_Shell, Compute_Selection, Begin_Shell_Selection, End_Shell_Selection
int DCompute_Selection_By_Key ( const char *  action,
const char *  start_seg,
HC_KEY  key,
const double *  matrix 
)
Parameters
action- One of "v", "^", "*", or "O". Action is compared against the selectability attribute settings as testing proceeds. See Set_Selectability() for a detailed explanation of actions.
start_seg- A segment somewhere in the tree belonging to a display driver, at which point it would be good to start selection testing.
key- Key to the Shell that should be used for testing.
matrix- A transformation matrix that should be applied to the shell before performing the selection.
Returns
count - The number of objects that are touched by any part of the specified geometry.