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_region1
drag_region2
drag_region3
draw_circle
draw_circle_mod
draw_ellipse
draw_ellipse_mod
draw_line
draw_line_mod
draw_nurbs
draw_nurbs_interp
draw_nurbs_interp_mod
draw_nurbs_mod
draw_point
draw_point_mod
draw_polygon
draw_rectangle1
draw_rectangle1_mod
draw_rectangle2
draw_rectangle2_mod
draw_region
draw_xld
draw_xld_mod