Show_Selection_Elements

Functions

void Show_Selection_Elements (HC_KEY *key, int *count, int *vertex1, int *vertex2, int *faces)
 Returns the key of the database element that was selected by the user, plus arrays of offsets describing the selected item's sub-elements. More...
 
void Show_Selection_Elements_Coun (HC_KEY *key, int *count)
 Finds the number of elements in a particular item in a selection list. This is useful in determining the object type of the selection object. More...
 

Detailed Description

Function Documentation

◆ Show_Selection_Elements()

void Show_Selection_Elements ( HC_KEY *  key,
int *  count,
int *  vertex1,
int *  vertex2,
int *  faces 
)

Returns the key of the database element that was selected by the user, plus arrays of offsets describing the selected item's sub-elements.

Parameters
key- The key of the shell currently on top of the selection list. Passed by reference always. Returned to user.
count- The number of best matched sub-elements within the current selection element. Passed by reference always. Returned to user.
vertex1- Array of indices into the points array of the geometry specified by key. This must be the size of count. Each one of these indices represents a point in the geometry that meets the current selection criteria. See below for details. Passed by reference always. Returned to user.
vertex2- Array of indices into the points array of the geometry specified by key. This must be the size of count. Each one of these indices represents a point that, when paired with the corresponding point in vertex1 array, represents an edge that meets the current selection criteria. The array is padded with -1 if no corresponding value is necessary for the vertex1 array. Passed by reference. Returned to user.
faces- Array into the faces array of the geometry specified by key. This must be the size of count. Each one of these represents a face in the geometry that meets the current selection criteria. The array is padded with -1 if no corresponding value is necessary for the vertex1 array. Passed by reference. Returned to user.

DETAILS

Show_Selection_Element() can be used to identify one exact sub-element (vertex, edge, and face) within a given selection item. Show_Selection_Elements() can be used to identify all the sub-elements within a given selection item. The information is returned as a key, a count, and three arrays of offsets.
The 'vertices' have meanings similar to those of Show_Selection_Element(). Whereas Show_Selection_Element() returns a single offset into a point cloud, a single edge, and/or a single face, Show_Selection_Elements() returns multiple offsets, multiple edges, and/or multiple faces.
As with Show_Selection_Element(), the number of sub-elements returned by Show_Selection_Elements() depends on the primitive type of the selection item. However, the count returned by Show_Selection_Elements() also depends on the type of selection used. For instance, if a rectangle passed to Compute_Selection_By_Area() encompasses one entire shell, Show_Selection_Elements() will return entire offset arrays for all vertices, edges, and faces in the shell. On the other hand, if the rectangle cuts across the shell, only those vertices, edges, and faces that lie within the rectangle will be returned.
Show_Selection_Elements_Coun() returns the number of sub-elements within a selection item, and can be used to allocate memory for arrays returned by Show_Selection_Elements. To receive the correct number of sub-elements for count, you will need to set HC_Set_Heuristics("No related selection limit, no internal selection limit");

The following example is a list of values which may be returned to you by Show_Selection_Elements:

  • vertex1 ={0, 3,1,0,0,0,1,2,3}
  • vertex2 ={3, 2,2,1,3,-1,-1,-1,-1}
  • faces ={0,-1,-1,-1,-1,-1,-1,-1,-1}
  • This indicates 1 face, 4 edges, 4 vertices.
  • Index 0 of the 3 arrays says that face 0 was selected, and that edge (0,3) is the closest edge (selected) of that face (face 0).
  • Index 1-4 of v1 and v2 indicate the following selected edges {(3,2), (1,2), (0,1), (0,3)}.
  • Index 1-8 of faces is -1, indicating faces does not apply.
  • Index 5-8 of v1 indicates 4 selected vertices {0,1,2,3}.
  • Index 5-8 of v2 is -1, indicating v2 doesn't apply (i.e. no edge is defined).

If the user only wanted to report selected vertices, they should turn off selection for faces and edges using Set_Selectability().

NOTES

Building up the list of faces, edges and vertices is a fairly computationally intensive task. Thus it is best skipped unless the user actively indicates that it is useful in some way (i.e. by calling Set_Heuristics() to set the "internal selection limit").

RESTRICTIONS

See also

Await_Event, Compute_Selection_By_Area, Enable_Selection_Events, Find_Related_Selection, Get_Selection, Renumber_Key, Set_Heuristics, Show_Selection, Show_Selection_Element, Show_Selection_Position, Show_Selection_Pathname, Show_Selection_Keys, Show_Selection_Source, Set_Selectability.

◆ Show_Selection_Elements_Coun()

void Show_Selection_Elements_Coun ( HC_KEY *  key,
int *  count 
)

Finds the number of elements in a particular item in a selection list. This is useful in determining the object type of the selection object.

Parameters
key- The key of the "best match" element of your scene. Passed by reference always. Returned to user.
count- The number of best matched sub-elements within the current selection element. Passed by reference always. Returned to user.

DETAILS

The count indicates the size you need to allocate for array vertex1, vertex2 and faces (if using) when
calling Show_Selection_Elements() next.