MIL_ID ContextGraId, | //in |
MIL_ID ListGraId, | //in |
MIL_INT64 GraphicType, | //in |
MIL_INT64 InitFlag, | //in |
MIL_INT64 ControlFlag | //in |
This function changes the state of interactivity (M_INTERACTIVE_GRAPHIC_STATE) of graphics in a graphics list. It is primarily used to change the state of interactivity of the graphics such that a user can interactively add a graphic of the specified type to the graphics list (M_STATE_WAITING_FOR_CREATION). In addition, the function can end any interactive manipulations occuring in the display and return to an idle state (M_STATE_IDLE).
When in the waiting for creation state (GraphicType set to an M_GRAPHIC_TYPE_... value), the user is expected to define a graphic interactively in the display. Note, however, that MgraInteractive() is asynchronous and only changes the state of interactivity; it will not wait for the user to define the graphic. You should have your application wait for the user to finish defining the graphic, before calling further functions; to do so, hook a function to the change in state of interactivity using MgraHookFunction() with M_INTERACTIVE_GRAPHIC_STATE_MODIFIED. When the user begins defining the graphic, the state of interactivity of the graphics list (MgraInquireList() or MgraGetHookInfo() with M_INTERACTIVE_GRAPHIC_STATE) changes to M_STATE_BEING_CREATED. After a user has defined the graphic interactively, the state of interactivity returns to M_STATE_IDLE and you can continue your application from that moment.
This function is especially useful if your application uses toolbars for a graphical user interface. For example, you can use another API to create a toolbar, with one of its buttons calling MgraInteractive() with M_GRAPHIC_TYPE_RECT. After clicking on the toolbar button, the user can define a rectangle in the display to specify where to perform processing or analysis in the image.
Unlike most other functions that modify a MIL object, you can call this function concurrently from multiple threads on the same MIL graphics list (ListGraId) without using an M_MUTEX object, as long as all the other parameters of the concurrent calls do not also share data.
Specifies the identifier of the graphics context. This parameter must be set to one of the following values:
For specifying the graphics
context
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies to use the default graphics context of the current MIL application context. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies a graphics context is not necessary; you should use this setting only when GraphicType is set to M_CANCEL or M_STOP. |
||||||||||||||||||||||||||||||||||||||
MIL graphics context identifier |
Specifies a valid graphics context identifier, which you have allocated using MgraAlloc(). |
Specifies the identifier of a valid graphics list whose state of interactivity must be changed. You must have allocated the graphics list using MgraAllocList().
Specifies the type of graphic to allow the user to define interactively before adding it to the list; alternatively, you can specify to cancel or stop any user interaction occuring in the display.
The following values will change MgraInquireList() with M_INTERACTIVE_GRAPHIC_STATE to M_STATE_WAITING_FOR_CREATION and allow the user to add a graphic to the graphics list by defining it interactively in the display.
For specifying the type of
graphic
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_GRAPHIC_TYPE_ARC |
Changes the state of interactivity to M_STATE_WAITING_FOR_CREATION so that the user can interactively add an arc to the graphics list. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GRAPHIC_TYPE_DOT |
Changes the state of interactivity to M_STATE_WAITING_FOR_CREATION so that the user can interactively add a dot to the graphics list. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GRAPHIC_TYPE_LINE |
Changes the state of interactivity to M_STATE_WAITING_FOR_CREATION so that the user can interactively add a line to the graphics list. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GRAPHIC_TYPE_POLYGON |
Changes the state of interactivity to M_STATE_WAITING_FOR_CREATION so that the user can interactively add a polygon to the graphics list. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GRAPHIC_TYPE_POLYLINE |
Changes the state of interactivity to M_STATE_WAITING_FOR_CREATION so that the user can interactively add a polyline to the graphics list. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GRAPHIC_TYPE_RECT |
Changes the state of interactivity to M_STATE_WAITING_FOR_CREATION so that the user can interactively add a rectangle to the graphics list. (more details...) |
The following values change the graphics list's state of interactivity to idle (M_STATE_IDLE) and will cancel or stop any user manipulations in progress.
For ending user interaction
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_CANCEL |
Changes the graphics list's state of interactivity to idle (M_STATE_IDLE) and cancels any user manipulations in progress. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STOP |
Changes the graphics list's state of interactivity to idle (M_STATE_IDLE) and stops any user manipulations in progress. (more details...) |
Specifies optional behavior. If this behavior is not required or supported, set this parameter to M_DEFAULT. This parameter can be set to one or a combination of the following values. If the value is not supported for the graphic being created, an error is generated.
For specifying optional
behavior
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_FILLED |
Specifies that the graphic the user defines in the display will be filled (MgraControlList() with M_FILLED set to M_TRUE). INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_FORCE_ASPECT_RATIO_1 |
Specifies that the graphic the user defines in the display will have an aspect ratio of 1 (MgraControlList() with M_CONSTRAIN_ASPECT_RATIO set to 1.0). INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SECTOR |
Specifies that the arc the user defines in the display will be drawn as a sector instead (MgraControlList() with M_ARC_STYLE set to M_SECTOR). INQ (more details...) |
Header | Include mil.h. |
Library | Use mil.lib. |
DLL | Requires mil.dll. |