MIL_ID ContextGraId, | //in |
MIL_ID ContextOrResultModId, | //in |
MIL_ID DstImageBufOrListGraId, | //in |
MIL_INT64 Operation, | //in |
MIL_INT Index, | //in |
MIL_INT64 ControlFlag | //in |
This function draws specific features of models or result occurrences 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, MmodDraw() will draw into the destination image buffer even if the buffer is not large enough to contain all of the zoomed image. The image will be truncated.
For M_GEOMETRIC or M_GEOMETRIC_CONTROLLED type of Model Finder contexts, or for Model Finder result buffers not allocated with M_SHAPE_CIRCLE, you can use MmodInquire() with the M_CHAIN_INDEX, M_CHAIN_X, and M_CHAIN_Y controls to inquire the active edges of the model.
Note that if you try to draw a model's edges and its Model Finder context has not been preprocessed, a preliminary edge extraction operation will be performed for the model.
Specifies the identifier of the graphics context to use when drawing. This parameter must be set to one of the following values:
For specifying the graphics
context
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies that the default graphics context of the current MIL application is used. (more details...) |
||||||||||||||||||||||||||||||||||||||
MIL graphics context identifier |
Specifies a valid graphics context identifier, which you have allocated using MgraAlloc(). |
Specifies the Model Finder context or result buffer from which to extract the features to draw. The Model Finder context or result buffer must have been previously allocated using MmodAlloc() or MmodAllocResult(), respectively.
The Model Finder context or result buffer must be allocated on the same system as the graphics context (ContextGraId). If it is not, an error will occur.
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 MmodDraw() to draw features extracted from models or targets that are associated with a calibration context, the destination drawing buffer must also be calibrated to the same world coordinate system. MmodDraw() draws all the requested features according to whether the destination image buffer is physically corrected or not.
When drawing a model, the destination image must be at least the size of the model. Use MmodInquire() with the M_ALLOC_SIZE... inquire types to get the correct size.
When drawing a synthetic model, the destination image must have a size that matches the size of the model box scaled by M_PIXEL_SCALE.
Specifies the type of operation to perform. Operations can be added together to draw multiple features at a time. For example, to draw both the result occurrence's position and active edges, you would set the Operation parameter to M_DRAW_POSITION + M_DRAW_EDGES. The Operation parameter can be set to a combination of the following values:
The following operations can extract the features to draw from a model context only and cannot draw in a graphics list.
For specifying an operation that can
extract features from a model context only
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DRAW_DONT_CARE + |
Draws the model's "don't care" pixels. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_FLAT_REGIONS + |
Draws the model's "flat regions". (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_IMAGE + |
Draws the model image. |
||||||||||||||||||||||||||||||||||||||
M_DRAW_WEIGHT_REGIONS + |
Draws the model's weighted region mask. (more details...) |
The following operation can extract the features to draw from a result buffer.
For specifying an operation that can
extract features from a result buffer
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DRAW_ACTIVE_EDGELS + |
Draws the active edgels of the target. (more details...) |
You can use one or more of the following values in combination with each other or with the above-mentioned values, to specify an operation that can extract features to draw from both a model context and a result buffer.
For specifying an operation that can
extract features to draw from both a model context and a result
buffer
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DRAW_BOX |
Draws the model box, or a bounding box around the occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_EDGES + |
Draws the edges related to the model or result. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_POSITION |
Draws a cross-like symbol at the model's reference axis origin or occurrence position. (more details...) |
You can add one of the following values to the above-mentioned value to specify whether to draw the active edges of the model transformed at the occurrence position or to draw the edges of the target in the region of the occurrence.
For M_DRAW_EDGES when working with result
occurrences
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_MODEL |
Draws the active edges of the model transformed at the occurrence position. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_TARGET |
Draws the edges of the target in the region of the occurrence. (more details...) |
Specifies the index of the model in the specified Model Finder context, or of the result occurrence. User labels cannot be used as indices; to retrieve the index of a model from its user label, use MmodInquire() with M_INDEX_FROM_LABEL.
This parameter should be set to one of the following values:
For specifying the indes of the model or
of the result occurrence
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Refers to index 0 for models and M_ALL for results. |
||||||||||||||||||||||||||||||||||||||
M_ALL |
Draws the specified feature of all models or all occurrences. |
||||||||||||||||||||||||||||||||||||||
M_GENERAL |
Draws the specified feature of the entire target. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value >= 0 |
Specifies the model index or the result occurrence. |
Specifies where in the destination image buffer to draw.
For specifying where to draw
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Draws at the center of the top-left pixel of the destination image buffer; or, if drawing in a graphics list, from the center of the top-left pixel of the image used at the time of annotation. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ORIGINAL |
Draws at the offsets used to define the model region in the model source. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milmod.lib. |
DLL | Requires mil.dll; milmod.dll. |