| MIL 10 Reference
| Customize Help
| Save Settings

MbeadGetNeighbors



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
None.
Synopsis
Get the template and/or vertex closest to a source point.
Syntax
void MbeadGetNeighbors(
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
)
Description

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.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
ContextBeadId

Specifies the identifier of the bead context. The bead context must have been previously allocated on the required system using MbeadAlloc().

LabelOrIndex

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:

function map For specifying a bead template
CollapseValue Description
Collapse M_NULL

Specifies no label or index value.

When using M_CLOSEST_TEMPLATE, LabelOrIndex must be set to M_NULL.

(summarize)
Collapse

Specifies the index of the template.

(summarize)
Parameters

Specifies the index. The index must be greater than or equal to 0.

Collapse

Specifies the label of the template.

(summarize)
Parameters

Specifies the label. The label must be greater than 0.

PositionX

Specifies the source point's X-position.

PositionY

Specifies the source point's Y-position.

TemplateLabelPtr

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.

PointIndexPtr

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.

ControlFlag

Specifies whether to retrieve the closest template and/or the closest vertex.

function map For specifying whether to receive the closest template or the closest vertex
CollapseValue Description
Collapse M_DEFAULT

Same as M_CLOSEST_TEMPLATE.

Collapse M_CLOSEST_POINT

Specifies to return the vertex, within the specified template, that is closest to the specified source point.

Collapse M_CLOSEST_TEMPLATE

Specifies to return the template, and the vertex within that template, that are closest to the specified source point.

Compilation information
Header Include mil.h.
Library Use mil.lib; milbead.lib.
DLL Requires mil.dll; milbead.dll.
NULL INVALID DEFAULT CLOSEST POINT CLOSEST TEMPLATE