This chapter describes operators that allow the user to manually draw geometric shapes. They require mouse interaction and in general block the application until the mouse interaction is finished. For non-blocking interactive creation of geometric shapes, HALCON also provides drawing objects with the operators listed in Graphics / Object.
The draw operators , draw_region, draw_xld,
draw_xld_mod, draw_nurbs, draw_nurbs_mod,
draw_nurbs_interp, as well as draw_nurbs_interp_mod,
drag_region1 and drag_region2 return iconic objects.
All other draw operators return the geometric parameters that are needed to
create regions or contours in the respective shape (see table).
Most draw operators have a modifying variant that allows the user to
specify the initial parameters of the shown shape.
drag_region3
Because the draw operators rely on mouse interaction, they generally do
not work when used with buffer windows (see ), so you
should use drawing objects instead. Nevertheless some operators (see table)
can be used in buffer windows.
These operators are controlled through a mouse state.
In order to use these operators (and to not cause a deadlock) the
application has to provide the mouse state with the operators
open_window, send_mouse_double_click_event,
send_mouse_down_event and send_mouse_drag_event as well as the
state of the modifier keys (also by using send_mouse_up_event),
whereas the draw operators themselves must be run in another thread.
While using the draw operator, the image section must not be changed.
send_mouse_drag_event
| Drawing Operators | Output | Generate Object | Works in Buffer Windows |
|---|---|---|---|
|
, |
|
yes |
|
, , , |
|
yes |
|
, , , |
|
yes |
|
, , , , |
, |
yes |
|
, , |
, |
yes |
|
, , , , |
, |
yes |
|
|
- | yes |
|
|
- | yes |
|
|
- | yes |
|
, , , |
- | no |
|
, , , , |
- | no |
|
|
- | no |
|
|
- | no |
|
|
- | no |
drag_region1drag_region2drag_region3draw_circledraw_circle_moddraw_ellipsedraw_ellipse_moddraw_linedraw_line_moddraw_nurbsdraw_nurbs_interpdraw_nurbs_interp_moddraw_nurbs_moddraw_pointdraw_point_moddraw_polygondraw_rectangle1draw_rectangle1_moddraw_rectangle2draw_rectangle2_moddraw_regiondraw_xlddraw_xld_mod