| Customize Help
| Save Settings

MmetDraw



Function Map
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 2D 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 24: 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 which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
ContextGraId

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

function map For specifying the 2D graphics context
Click to summarizeValue Description
Click to summarize M_DEFAULT

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

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

(summarize)
Click to summarize MIL 2D graphics context identifier

Specifies a valid 2D 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 2D graphics list in which to draw. The buffer can be any valid MIL image buffer allocated using MbufAlloc...(). The 2D graphics list must be previously allocated using MgraAllocList(). By drawing into a display's overlay buffer or associating the 2D 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
Click to summarizeValue Description
Click to summarize M_DRAW_TEMPLATE_REFERENCE

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

This operation cannot draw in a 2D 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
Click to summarizeValue Description
Click to summarize M_DRAW_ACTIVE_EDGELS

Draws only the edgels that satisfied all edgel constraints.

Click to summarize 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)
Click to summarize M_DRAW_FEATURE +

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

(summarize)
Click to summarize 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)
Click to summarize M_DRAW_NOISY_EDGELS

Draws the edgels before they were denoised. Edgels are denoised using MmetControl() with M_EDGEL_DENOISING_MODE.

(summarize)
Click to summarize M_DRAW_REGION

Draws the feature's search region.

When drawing in a 2D graphics list, this operation cannot draw ring and ring sector regions when M_REGION_ACCURACY_HIGH is set to M_DISABLE and the 2D 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
Click to summarizeValue Description
Click to summarize M_DRAW_TOLERANCE +

Draws the geometric tolerance's icon. To view the icons, see MmetAddTolerance().

(summarize)
Click to summarize M_DRAW_TOLERANCE_AREA

Draws the area used to define the area-based geometric tolerance. These tolerances are set using MmetAddTolerance() with M_AREA_....

(summarize)
Click to summarize M_DRAW_TOLERANCE_FEATURES

Draws the features used to define a tolerance. 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.

(summarize)
Combination values 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
Click to summarize
Combination value
Description
Click to summarize M_DRAW_LABEL

Specifies that the label will also be drawn.

Click to summarize 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
Click to summarizeValue Description
Click to summarize 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)
Click to summarize

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.

Click to summarize

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.

Click to summarize

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.

Click to summarize

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.

Click to summarize M_ALL_FAIL_TOLERANCES

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

Click to summarize M_ALL_FEATURES

Specifies to draw all feature results.

Click to summarize M_ALL_PASS_TOLERANCES

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

Click to summarize M_ALL_TOLERANCES

Specifies to draw all tolerance results.

Click to summarize M_ALL_WARNING_TOLERANCES

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

Click to summarize M_GENERAL

Specifies to draw a setting of the context.

Click to summarize 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 NOISY EDGELS DRAW REGION DRAW TOLERANCE DRAW TOLERANCE AREA DRAW TOLERANCE FEATURES DRAW LABEL DRAW NAME DEFAULT ALL FAIL TOLERANCES ALL FEATURES ALL PASS TOLERANCES ALL TOLERANCES ALL WARNING TOLERANCES GENERAL GLOBAL FRAME ALL FEATURES DEFAULT GLOBAL FRAME GENERAL DEFAULT ALL FEATURES GENERAL GLOBAL FRAME