Operators |
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, draw_nurbs_interp_mod, as well as drag_region1, drag_region2 and drag_region3 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.
Because the draw operators rely on mouse interaction, they generally do not work when used with buffer windows (see open_window), 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 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 Operators | Output | Generate 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 |
Operators |