<< Back      Brief Index      Full Index      Forward >>

Compute_Selection_By_Shell


Functions

int Compute_Selection_By_Shell (const char *action, const char *start_seg, const int pcount, const HC_POINT *points, const int flist_length, const int *face_list)
double Compute_Selection_Distance_By_Shell (const char *action, const char *start_segment, int pcount, const HC_POINT *points, int flist_length, const int *faces, const char *options)

Function Documentation

int Compute_Selection_By_Shell ( const char *  action,
const char *  start_seg,
const int  pcount,
const HC_POINT *  points,
const int  flist_length,
const int *  face_list 
)

Forces a selection event between the supplied Shell 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.
start_seg - A segment somewhere in the tree belonging to a display driver, at which point it would be good to start selection testing. If blank or null, then testing begins at display.
pcount - Number of points in the shell that may enclose the points defined in points.
points - Vector of x-y-z triplets for the coordinates of the vertices to be used to build the shell. (A simple N x 3 array may also be used). Passed by reference always.
flist_length - Size of the array of integers that defines the faces in face_list.
face_list - Encoded description of how to connect the points to build the faces of the shell (see Insert_Shell() ).
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 defined by the specified geometry and is often used to implement collision detection operators. The process of performing the selection event and then querying the results is similar to the more standard selection events provided by Compute_Selection().

NOTES

To allow for fast computation of Compute_Selection_By_Shell(), 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().

This function is identical to Compute_Selection_By_Key, except that is does not require a shell to already exist.

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_Key, Compute_Selection, Begin_Shell_Selection, End_Shell_Selection

double Compute_Selection_Distance_By_Shell ( const char *  action,
const char *  start_segment,
int  pcount,
const HC_POINT *  points,
int  flist_length,
const int *  faces,
const char *  options 
)

Computes the closest distance between the specified shell and another geometric primitive within a HOOPS 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.
start_seg - A segment somewhere in the segment hierachy at which point it would be good to start selection testing. If blank or null, then testing begins at root of the driver segment.
pcount - Number of points contained in the points list.
points - Set of points that comprise the polyline or polygon used to compute the selection.
flist_length - The length of the face_list.
face_list - As described in the documentation of Insert_Shell() , An encoded description of how triangles should be combined to form faces, and the assignment of face identifiers.
options - A string containing a set of options to be applied to this distance calculation.
Returns:
value - The distance from the object in the specified segment hierarchy to the provided shell. If nothing is found within the defined distance, -1 will be returned.

DETAILS

Developers often have the need to calculate the distance between a polygonal mesh and the rest of the 3D scene. Compute_Selection_Distance_By_Shell allows developers to do this by allowing them to set criteria for their distance calculation and then providing the results back via the standard Show_Selection routines.

The options string consists of a comma separated list of options. Legal values for options include:

  • vector = (x, y, z)

    If vector is supplied, then the return value is the exact distance that the shell would need to be moved along this vector before it hits a piece of geometry in the specified segment tree.

  • maximum distance = xxx oru

    Objects that are further than this distance from every point in the selection shell are ignored. This option allows users to improve the performance of the computation by excluding certain objects from the calculation. The default setting is "no maximum distance".

Unlike the other selection routines, Compute_Selection_Distance_By_Shell returns at most one object. To query this object, use the various Show_Selection routines.

RESTRICTIONS

Currently only Shells within the specified segment hierarchy are considered for closest distanct calculations.

See also:
Compute_Selection_By_Key, Compute_Selection_By_Shell, Show_Selection_Source_Element, Show_Selection_Element, Compute_Selection, Show_Selection_Keys

Main Index
<< Back      Brief Index      Full Index      Forward >>