HC_Compute_Selection_Dist_By_Sh
-
float
HC_Compute_Selection_Dist_By_Sh(char const *action, char const *start_segment, int pcount, Point const points[], int flist_length, int const faces[], char const *options) - float HC_Compute_Selection_Dist_By_Sh(char const action, char const start_segment, int pcount, Point const points, int flist_length, int const faces, char const options)
Computes the closest distance between the specified shell and another geometric primitive within a HOOPS segment tree.
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.
HC_Compute_Selection_By_Key, HC_Compute_Selection_By_Shell, HC_Show_Selection_Source_Elem, HC_Show_Selection_Element, HC_Compute_Selection, HC_Show_Selection_KeysParameters
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 in the tree at which to start selection testing.
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.