| MIL 10 Reference
| Customize Help
| Save Settings

MmetDraw



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
Synopsis
Draw specific features or tolerances of a metrology context or of a metrology result.
Syntax
void MmetDraw(
MIL_ID ContextGraId, //in
MIL_ID ContextOrResultMetId, //in
MIL_ID DstImageBufOrListGraId, //in
MIL_INT64 Operation, //in
MIL_INT LabelOrIndex, //in
MIL_INT64 ControlFlag //in
)
Description

This function draws specific features or tolerances of a metrology context or of a metrology result, in the destination image buffer or graphics list.

You can draw results and settings, obtained relative to an offset, at the top-left corner of the destination image, using MgraControl() with M_DRAW_OFFSET_X and M_DRAW_OFFSET_Y and zoom them using MgraControl() with M_DRAW_ZOOM_X and M_DRAW_ZOOM_Y. For more information, see the Drawing graphics with offset and zoom subsection of the Drawing graphics section of Chapter 22: Generating graphics.

When zooming, MmetDraw() will draw into the destination image buffer even if the buffer is not large enough to contain all of the zoomed image. If necessary, the image will be clipped.

If a template reference has been set using MmetControl() with M_TEMPLATE_REFERENCE_ID, MmetDraw() can draw the results of features and tolerances extracted from that template reference. You will need to inquire M_TEMPLATE_REFERENCE_SIZE_X and M_TEMPLATE_REFERENCE_SIZE_Y to allocate an appropriate destination buffer.

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
ContextGraId

Specifies the identifier of the graphics context to use when drawing. This parameter must be set to one of the following values:

function map For specifying the graphics context
CollapseValue Description
Collapse M_DEFAULT

Specifies that the default graphics context of the current MIL application is used.

Note that there is a different default graphics context for each thread.

(summarize)
Collapse MIL graphics context identifier

Specifies a valid graphics context identifier, which you have allocated using MgraAlloc().

ContextOrResultMetId

Specifies the metrology result buffer or context from which to extract the features to draw. The metrology result buffer must have been previously allocated using MmetAllocResult(). The metrology context must have been previously allocated using MmetAlloc().

If you are using MmetDraw() with a metrology context, you can specify that a feature or tolerance in the context should not be drawn, using MmetControl() with M_DRAWABLE set to M_DISABLE. This can be useful if you have many features or tolerances and you want to draw all of them in one call, although there are some that you do not want to see. When features or tolerances are not drawn, you cannot affect them in an interactive display.

DstImageBufOrListGraId

Specifies the identifier of the destination image buffer or graphics list in which to draw. The buffer can be any valid MIL image buffer allocated using MbufAlloc...(). The graphics list must be previously allocated using MgraAllocList(). By drawing into a display's overlay buffer or associating the graphics list with the display, you can also annotate an image non-destructively.

If specifying an image buffer, it must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

When using MmetDraw() to draw features with a source model that is associated with a calibration context and if a calibration context is associated with the destination buffer, the latter must also be calibrated to the same world coordinate system. If no calibration context is associated with the destination buffer, the latter will use the same one as the template reference's. To add a template reference to a metrology context, use MmetControl() with M_TEMPLATE_REFERENCE_ID. MmetDraw() draws all the requested features according to whether the destination image buffer is physically corrected or not.

Operation

Specifies the type of drawing operation to perform. This parameter can be set to the following values:

function map For drawing a context characteristic
CollapseValue Description
Collapse M_DRAW_TEMPLATE_REFERENCE

Draws the template reference. The LabelOrIndex parameter must be set to M_GENERAL.

This operation cannot draw in a graphics list.

(summarize)

For the following constants, the LabelOrIndex parameter can be set to M_FEATURE_LABEL(), M_FEATURE_INDEX(), or M_ALL_FEATURES, unless otherwise specified.

function map For drawing a feature characteristic
CollapseValue Description
Collapse M_DRAW_ACTIVE_EDGELS

Draws only the edgels that satisfied all edgel constraints.

Collapse M_DRAW_ALL_EDGELS

Draws all the edgels that were calculated in the target image. This includes the edgels that were used to measure a feature.

(summarize)
Collapse M_DRAW_FEATURE +

Draws the specified feature(s). In this case, you can also set the LabelOrIndex parameter to M_GLOBAL_FRAME.

(summarize)
Collapse M_DRAW_FITTED_EDGELS

Draws only the edgels that satisfied all edgel constraints and fit constraints. The fitted edgels are those used by the fit operation to define a feature.

(summarize)
Collapse M_DRAW_REGION

Draws the feature's search region.

When drawing in a graphics list, this operation cannot draw ring and ring sector regions when M_REGION_ACCURACY_HIGH is set to M_DISABLE and the graphics context's input units is set to world units (MgraControl() with M_INPUT_UNITS set to M_WORLD).

(summarize)

For the following constants, the LabelOrIndex parameter can be set to M_TOLERANCE_LABEL(), M_TOLERANCE_INDEX(), M_ALL_TOLERANCES, M_ALL_PASS_TOLERANCES, M_ALL_FAIL_TOLERANCES, or M_ALL_WARNING_TOLERANCES.

function map For drawing a tolerance characteristic
CollapseValue Description
Collapse M_DRAW_TOLERANCE +

Draws the geometric tolerance's symbol.

Tolerance symbols are illustrated in MmetAddTolerance().

(summarize)
Collapse M_DRAW_TOLERANCE_FEATURES
Combination constants for M_DRAW_FEATURE; M_DRAW_TOLERANCE.

You can add one of the following values to the above-mentioned values to specify that the label or name of the feature or tolerance will also be drawn .

function map For M_DRAW_FEATURE and M_DRAW_TOLERANCE
CollapseCombination value Description
Collapse M_DRAW_LABEL

Specifies that the label will also be drawn.

Collapse M_DRAW_NAME

Specifies that the name will also be drawn.

LabelOrIndex

Specifies the label or index of the result in the metrology result buffer for which to perform the drawing operation, or specifies that you are performing a general drawing operation for the metrology context. Set this parameter to one of the following values:

function map For specifying the index of the element in the metrology result buffer
CollapseValue Description
Collapse M_DEFAULT

Specifies the default setting.

M_DEFAULT is the same as M_ALL_FEATURES, when setting the Operation parameter to a value in the For drawing a feature characteristic table.

M_DEFAULT is the same as M_ALL_TOLERANCES, when setting the Operation parameter to a value in the For drawing a tolerance characteristic table.

M_DEFAULT is the same as M_GENERAL, when setting the Operation parameter to a value in the For drawing a context characteristic table.

(summarize)
Collapse

Specifies the index value of an existing individual feature to draw, in either the metrology context or result buffer, depending on whether you provide a context or result buffer to the ContextOrResultMetId parameter.

(summarize)
Parameters

This parameter specifies the index of the individual feature to draw. You can set this parameter to the following:

Value >= 0

Specifies the index of the individual feature. Note that the index of the global frame is 0.

Collapse

Specifies the label value of an existing individual feature to draw, in either the metrology context or result buffer, depending on whether you provide a context or result buffer to the ContextOrResultMetId parameter.

(summarize)
Parameters

This parameter specifies the label of the individual feature to draw. You can set this parameter to the following:

Value > 0

Specifies the label of the individual feature.

Collapse

Specifies the index value of an existing individual tolerance to draw, in either the metrology context or result buffer, depending on whether you provide a context or result buffer to the ContextOrResultMetId parameter.

(summarize)
Parameters

This parameter specifies the index of the individual tolerance to draw. You can set this parameter to the following:

Value >= 0

Specifies the index of the individual tolerance.

Collapse

Specifies the label value of an existing individual tolerance to draw, in either the metrology context or result buffer, depending on whether you provide a context or result buffer to the ContextOrResultMetId parameter.

(summarize)
Parameters

This parameter specifies the label of the individual tolerance to draw. You can set this parameter to the following:

Value > 0

Specifies the label of the individual tolerance.

Collapse M_ALL_FAIL_TOLERANCES

Specifies that the drawing operation will be performed on all tolerance results that have the status M_FAIL.

Collapse M_ALL_FEATURES

Specifies to draw all feature results.

Collapse M_ALL_PASS_TOLERANCES

Specifies that the drawing operation will be performed on all tolerance results that have the status M_PASS.

Collapse M_ALL_TOLERANCES

Specifies to draw all tolerance results.

Collapse M_ALL_WARNING_TOLERANCES

Specifies that the drawing operation will be performed on all tolerance results that have the status M_WARNING.

Collapse M_GENERAL

Specifies to draw a setting of the context.

Collapse M_GLOBAL_FRAME

Specifies to draw the global frame of the context.

ControlFlag

Reserved for future expansion and must be set to M_DEFAULT.

Compilation information
Header Include mil.h.
Library Use mil.lib; milmetrol.lib.
DLL Requires mil.dll; milmetrol.dll.
DEFAULT PROC NONE DRAW TEMPLATE REFERENCE DRAW ACTIVE EDGELS DRAW ALL EDGELS DRAW FEATURE DRAW FITTED EDGELS DRAW REGION DRAW TOLERANCE DRAW TOLERANCE FEATURES DRAW LABEL DRAW NAME DEFAULT ALL FAIL TOLERANCES ALL FEATURES ALL PASS TOLERANCES ALL TOLERANCES ALL WARNING TOLERANCES GENERAL GLOBAL FRAME FEATURE LABEL FEATURE INDEX ALL FEATURES DEFAULT GLOBAL FRAME GENERAL DEFAULT FEATURE LABEL FEATURE INDEX ALL FEATURES GENERAL GLOBAL FRAME