Operator Reference

Drawing

List of 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.

General Objectives

The draw operators draw_regiondraw_regionDrawRegionDrawRegiondraw_region, draw_xlddraw_xldDrawXldDrawXlddraw_xld, draw_xld_moddraw_xld_modDrawXldModDrawXldModdraw_xld_mod, draw_nurbsdraw_nurbsDrawNurbsDrawNurbsdraw_nurbs, draw_nurbs_moddraw_nurbs_modDrawNurbsModDrawNurbsModdraw_nurbs_mod, draw_nurbs_interpdraw_nurbs_interpDrawNurbsInterpDrawNurbsInterpdraw_nurbs_interp, draw_nurbs_interp_moddraw_nurbs_interp_modDrawNurbsInterpModDrawNurbsInterpModdraw_nurbs_interp_mod, as well as drag_region1drag_region1DragRegion1DragRegion1drag_region1, drag_region2drag_region2DragRegion2DragRegion2drag_region2 and drag_region3drag_region3DragRegion3DragRegion3drag_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.

Drawing in Buffer Windows

Because the draw operators rely on mouse interaction, they generally do not work when used with buffer windows (see open_windowopen_windowOpenWindowOpenWindowopen_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_eventsend_mouse_double_click_eventSendMouseDoubleClickEventSendMouseDoubleClickEventsend_mouse_double_click_event, send_mouse_down_eventsend_mouse_down_eventSendMouseDownEventSendMouseDownEventsend_mouse_down_event, send_mouse_drag_eventsend_mouse_drag_eventSendMouseDragEventSendMouseDragEventsend_mouse_drag_event and send_mouse_up_eventsend_mouse_up_eventSendMouseUpEventSendMouseUpEventsend_mouse_up_event as well as the state of the modifier keys (also by using send_mouse_drag_eventsend_mouse_drag_eventSendMouseDragEventSendMouseDragEventsend_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_pointdraw_pointDrawPointDrawPointdraw_point RowRowRowrowrow, ColumnColumnColumncolumncolumn gen_cross_contour_xldgen_cross_contour_xldGenCrossContourXldGenCrossContourXldgen_cross_contour_xld yes
draw_linedraw_lineDrawLineDrawLinedraw_line Row1Row1Row1row1row_1, Column1Column1Column1column1column_1, Row2Row2Row2row2row_2, Column2Column2Column2column2column_2 gen_contour_polygon_xldgen_contour_polygon_xldGenContourPolygonXldGenContourPolygonXldgen_contour_polygon_xld yes
draw_rectangle1draw_rectangle1DrawRectangle1DrawRectangle1draw_rectangle1 Row1Row1Row1row1row_1, Column1Column1Column1column1column_1, Row2Row2Row2row2row_2, Column2Column2Column2column2column_2 gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1gen_rectangle1 yes
draw_rectangle2draw_rectangle2DrawRectangle2DrawRectangle2draw_rectangle2 RowRowRowrowrow, ColumnColumnColumncolumncolumn, PhiPhiPhiphiphi, Length1Length1Length1length1length_1, Length2Length2Length2length2length_2 gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2gen_rectangle2, gen_rectangle2_contour_xldgen_rectangle2_contour_xldGenRectangle2ContourXldGenRectangle2ContourXldgen_rectangle2_contour_xld yes
draw_circledraw_circleDrawCircleDrawCircledraw_circle RowRowRowrowrow, ColumnColumnColumncolumncolumn, RadiusRadiusRadiusradiusradius gen_circlegen_circleGenCircleGenCirclegen_circle, gen_circle_contour_xldgen_circle_contour_xldGenCircleContourXldGenCircleContourXldgen_circle_contour_xld yes
draw_ellipsedraw_ellipseDrawEllipseDrawEllipsedraw_ellipse RowRowRowrowrow, ColumnColumnColumncolumncolumn, PhiPhiPhiphiphi, Radius1Radius1Radius1radius1radius_1, Radius2Radius2Radius2radius2radius_2 gen_ellipsegen_ellipseGenEllipseGenEllipsegen_ellipse, gen_ellipse_contour_xldgen_ellipse_contour_xldGenEllipseContourXldGenEllipseContourXldgen_ellipse_contour_xld yes
draw_xlddraw_xldDrawXldDrawXlddraw_xld ContourContourContourcontourcontour - yes
draw_regiondraw_regionDrawRegionDrawRegiondraw_region RegionRegionRegionregionregion - yes
draw_polygondraw_polygonDrawPolygonDrawPolygondraw_polygon RegionRegionRegionregionregion - yes
draw_nurbsdraw_nurbsDrawNurbsDrawNurbsdraw_nurbs ContourContourContourcontourcontour, RowsRowsRowsrowsrows, ColumnsColumnsColumnscolumnscolumns, WeightsWeightsWeightsweightsweights - no
draw_nurbs_interpdraw_nurbs_interpDrawNurbsInterpDrawNurbsInterpdraw_nurbs_interp ContourContourContourcontourcontour, RowsRowsRowsrowsrows, ColumnsColumnsColumnscolumnscolumns, KnotsKnotsKnotsknotsknots, TangentsTangentsTangentstangentstangents - no
drag_region1drag_region1DragRegion1DragRegion1drag_region1 RegionRegionRegionregionregion - no
drag_region2drag_region2DragRegion2DragRegion2drag_region2 RegionRegionRegionregionregion - no
drag_region3drag_region3DragRegion3DragRegion3drag_region3 RegionRegionRegionregionregion - no

List of Operators

drag_region1DragRegion1drag_region1DragRegion1drag_region1
Interactive moving of a region.
drag_region2DragRegion2drag_region2DragRegion2drag_region2
Interactive movement of a region with fixpoint specification.
drag_region3DragRegion3drag_region3DragRegion3drag_region3
Interactive movement of a region with restriction of positions.
draw_circleDrawCircledraw_circleDrawCircledraw_circle
Interactive drawing of a circle.
draw_circle_modDrawCircleModdraw_circle_modDrawCircleModdraw_circle_mod
Interactive drawing of a circle.
draw_ellipseDrawEllipsedraw_ellipseDrawEllipsedraw_ellipse
Interactive drawing of an ellipse.
draw_ellipse_modDrawEllipseModdraw_ellipse_modDrawEllipseModdraw_ellipse_mod
Interactive drawing of an ellipse.
draw_lineDrawLinedraw_lineDrawLinedraw_line
Draw a line.
draw_line_modDrawLineModdraw_line_modDrawLineModdraw_line_mod
Draw a line.
draw_nurbsDrawNurbsdraw_nurbsDrawNurbsdraw_nurbs
Interactive drawing of a NURBS curve.
draw_nurbs_interpDrawNurbsInterpdraw_nurbs_interpDrawNurbsInterpdraw_nurbs_interp
Interactive drawing of a NURBS curve using interpolation.
draw_nurbs_interp_modDrawNurbsInterpModdraw_nurbs_interp_modDrawNurbsInterpModdraw_nurbs_interp_mod
Interactive modification of a NURBS curve using interpolation.
draw_nurbs_modDrawNurbsModdraw_nurbs_modDrawNurbsModdraw_nurbs_mod
Interactive modification of a NURBS curve.
draw_pointDrawPointdraw_pointDrawPointdraw_point
Draw a point.
draw_point_modDrawPointModdraw_point_modDrawPointModdraw_point_mod
Draw a point.
draw_polygonDrawPolygondraw_polygonDrawPolygondraw_polygon
Interactive drawing of a polygon row.
draw_rectangle1DrawRectangle1draw_rectangle1DrawRectangle1draw_rectangle1
Draw a rectangle parallel to the coordinate axis.
draw_rectangle1_modDrawRectangle1Moddraw_rectangle1_modDrawRectangle1Moddraw_rectangle1_mod
Draw a rectangle parallel to the coordinate axis.
draw_rectangle2DrawRectangle2draw_rectangle2DrawRectangle2draw_rectangle2
Interactive drawing of any orientated rectangle.
draw_rectangle2_modDrawRectangle2Moddraw_rectangle2_modDrawRectangle2Moddraw_rectangle2_mod
Interactive drawing of any orientated rectangle.
draw_regionDrawRegiondraw_regionDrawRegiondraw_region
Interactive drawing of a closed region.
draw_xldDrawXlddraw_xldDrawXlddraw_xld
Interactive drawing of a contour.
draw_xld_modDrawXldModdraw_xld_modDrawXldModdraw_xld_mod
Interactive modification of a contour.