About drawing operators🔗
This page describes operators that allow you 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.
General properties🔗
The following draw operators return iconic objects:
draw_region, draw_xld, draw_xld_mod, draw_nurbs, draw_nurbs_mod, draw_nurbs_interp, draw_nurbs_interp_mod, drag_region1, drag_region2, drag_region3
All other draw operators return the geometric parameters that are needed to create regions or contours in the respective shape (see Table 1). Most draw operators have a modifying variant that allow you to specify the initial parameters of the shown shape.
Drawing in buffer windows🔗
Because the draw operators rely on mouse interaction, they generally do not work when used with buffer windows (see open_window).
Instead, use drawing objects.
However, some operators can be used in buffer windows; see Table 1.
These operators are controlled through a mouse state.
To use these operators and to avoid deadlocks, the application has to provide the mouse state with the operators send_mouse_double_click_event, send_mouse_down_event, send_mouse_drag_event, and send_mouse_up_event, as well as the state of the modifier keys (also by using send_mouse_drag_event), whereas the draw operators themselves must be run in another thread.
While using the draw operator, the image section must not be changed.
| Drawing operator | Output | Generated object | Works in buffer windows |
|---|---|---|---|
draw_point |
Row, Column |
gen_cross_contour_xld |
yes |
draw_line |
Row1, Column1, Row2, Column2 |
gen_contour_polygon_xld |
yes |
draw_rectangle1 |
Row1, Column1, Row2, Column2 |
gen_rectangle1 |
yes |
draw_rectangle2 |
Row, Column, Phi, Length1, Length2 |
gen_rectangle2, gen_rectangle2_contour_xld |
yes |
draw_circle |
Row, Column, Radius |
gen_circle, gen_circle_contour_xld |
yes |
draw_ellipse |
Row, Column, Phi, Radius1, Radius2 |
gen_ellipse, gen_ellipse_contour_xld |
yes |
draw_xld |
Contour |
— | yes |
draw_region |
Region |
— | yes |
draw_polygon |
Region |
— | yes |
draw_nurbs |
Contour, Rows, Columns, Weights |
— | no |
draw_nurbs_interp |
Contour, Rows, Columns, Knots, Tangents |
— | no |
drag_region1 |
Region |
— | no |
drag_region2 |
Region |
— | no |
drag_region3 |
Region |
— | no |