MIL_ID ContextBeadId, | //in |
MIL_INT LabelOrIndex, | //in |
MIL_DOUBLE PositionX, | //in |
MIL_DOUBLE PositionY, | //in |
MIL_INT *TemplateLabelPtr, | //out |
MIL_INT *PointIndexPtr, | //out |
MIL_INT64 ControlFlag | //in |
This function retrieves the label of the template, and the vertex within that template, that is closest to the specified position. This function can also retrieve the vertex within the specified template that is closest to the specified position. You can only use this function with templates whose path follows a polyline (MbeadControl() with M_TRAINING_PATH set to either M_POLYLINE_SEED or M_POLYLINE).
To set a maximum distance for which MIL considers a template or vertex to be the closest, use MbeadControl() with M_CLOSEST_POINT_MAX_DISTANCE. By default, there is no maximum distance.
Specifies the identifier of the bead context. The bead context must have been previously allocated on the required system using MbeadAlloc().
Specifies the bead template in which the closest vertex is expected to be located.
This parameter must be set to one of the following values:
For specifying a bead
template
|
|||||||||||||||||||||||||||||||||||||||
Value |
Description
|
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies no label or index value. (more details...) |
||||||||||||||||||||||||||||||||||||||
Specifies the index of the template. (more details...) |
|||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Specifies the index. The index must be greater than or equal to 0. |
|||||||||||||||||||||||||||||||||||||||
Specifies the label of the template. (more details...) |
|||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Specifies the label. The label must be greater than 0. |
Specifies the address of the variable in which to write the label of the closest template.
When using M_CLOSEST_POINT, TemplateLabelPtr must be set to M_NULL.
If there is no template (in the case of M_CLOSEST_TEMPLATE) sufficiently close to the source point, M_INVALID will be returned.
Specifies the address of the variable in which to write the index of the closest vertex.
If there is no template (in the case of M_CLOSEST_TEMPLATE) or vertex (in the case of M_CLOSEST_POINT) sufficiently close to the source point, M_INVALID will be returned.
Specifies whether to retrieve the closest template and/or the closest vertex.
For specifying whether to receive the
closest template or the closest vertex
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_CLOSEST_TEMPLATE. |
||||||||||||||||||||||||||||||||||||||
M_CLOSEST_POINT |
Specifies to return the vertex, within the specified template, that is closest to the specified source point. |
||||||||||||||||||||||||||||||||||||||
M_CLOSEST_TEMPLATE |
Specifies to return the template, and the vertex within that template, that are closest to the specified source point. |
Header | Include mil.h. |
Library | Use mil.lib; milbead.lib. |
DLL | Requires mil.dll; milbead.dll. |