ClassesClasses | | Operators

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_regionDrawRegionDrawRegionDrawRegion, draw_xlddraw_xldDrawXldDrawXldDrawXld, draw_xld_moddraw_xld_modDrawXldModDrawXldModDrawXldMod, draw_nurbsdraw_nurbsDrawNurbsDrawNurbsDrawNurbs, draw_nurbs_moddraw_nurbs_modDrawNurbsModDrawNurbsModDrawNurbsMod, draw_nurbs_interpdraw_nurbs_interpDrawNurbsInterpDrawNurbsInterpDrawNurbsInterp, draw_nurbs_interp_moddraw_nurbs_interp_modDrawNurbsInterpModDrawNurbsInterpModDrawNurbsInterpMod, as well as drag_region1drag_region1DragRegion1DragRegion1DragRegion1, drag_region2drag_region2DragRegion2DragRegion2DragRegion2 and drag_region3drag_region3DragRegion3DragRegion3DragRegion3 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_windowOpenWindowOpenWindowOpenWindow), 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_eventSendMouseDoubleClickEventSendMouseDoubleClickEventSendMouseDoubleClickEvent, send_mouse_down_eventsend_mouse_down_eventSendMouseDownEventSendMouseDownEventSendMouseDownEvent, send_mouse_drag_eventsend_mouse_drag_eventSendMouseDragEventSendMouseDragEventSendMouseDragEvent and send_mouse_up_eventsend_mouse_up_eventSendMouseUpEventSendMouseUpEventSendMouseUpEvent as well as the state of the modifier keys (also by using send_mouse_drag_eventsend_mouse_drag_eventSendMouseDragEventSendMouseDragEventSendMouseDragEvent), 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_pointDrawPointDrawPointDrawPoint RowRowRowRowrow, ColumnColumnColumnColumncolumn gen_cross_contour_xldgen_cross_contour_xldGenCrossContourXldGenCrossContourXldGenCrossContourXld yes
draw_linedraw_lineDrawLineDrawLineDrawLine Row1Row1Row1Row1row1, Column1Column1Column1Column1column1, Row2Row2Row2Row2row2, Column2Column2Column2Column2column2 gen_contour_polygon_xldgen_contour_polygon_xldGenContourPolygonXldGenContourPolygonXldGenContourPolygonXld yes
draw_rectangle1draw_rectangle1DrawRectangle1DrawRectangle1DrawRectangle1 Row1Row1Row1Row1row1, Column1Column1Column1Column1column1, Row2Row2Row2Row2row2, Column2Column2Column2Column2column2 gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1 yes
draw_rectangle2draw_rectangle2DrawRectangle2DrawRectangle2DrawRectangle2 RowRowRowRowrow, ColumnColumnColumnColumncolumn, PhiPhiPhiPhiphi, Length1Length1Length1Length1length1, Length2Length2Length2Length2length2 gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2GenRectangle2, gen_rectangle2_contour_xldgen_rectangle2_contour_xldGenRectangle2ContourXldGenRectangle2ContourXldGenRectangle2ContourXld yes
draw_circledraw_circleDrawCircleDrawCircleDrawCircle RowRowRowRowrow, ColumnColumnColumnColumncolumn, RadiusRadiusRadiusRadiusradius gen_circlegen_circleGenCircleGenCircleGenCircle, gen_circle_contour_xldgen_circle_contour_xldGenCircleContourXldGenCircleContourXldGenCircleContourXld yes
draw_ellipsedraw_ellipseDrawEllipseDrawEllipseDrawEllipse RowRowRowRowrow, ColumnColumnColumnColumncolumn, PhiPhiPhiPhiphi, Radius1Radius1Radius1Radius1radius1, Radius2Radius2Radius2Radius2radius2 gen_ellipsegen_ellipseGenEllipseGenEllipseGenEllipse, gen_ellipse_contour_xldgen_ellipse_contour_xldGenEllipseContourXldGenEllipseContourXldGenEllipseContourXld yes
draw_xlddraw_xldDrawXldDrawXldDrawXld ContourContourContourContourcontour - yes
draw_regiondraw_regionDrawRegionDrawRegionDrawRegion RegionRegionRegionRegionregion - yes
draw_polygondraw_polygonDrawPolygonDrawPolygonDrawPolygon RegionRegionRegionRegionregion - yes
draw_nurbsdraw_nurbsDrawNurbsDrawNurbsDrawNurbs ContourContourContourContourcontour, RowsRowsRowsRowsrows, ColumnsColumnsColumnsColumnscolumns, WeightsWeightsWeightsWeightsweights - no
draw_nurbs_interpdraw_nurbs_interpDrawNurbsInterpDrawNurbsInterpDrawNurbsInterp ContourContourContourContourcontour, RowsRowsRowsRowsrows, ColumnsColumnsColumnsColumnscolumns, KnotsKnotsKnotsKnotsknots, TangentsTangentsTangentsTangentstangents - no
drag_region1drag_region1DragRegion1DragRegion1DragRegion1 RegionRegionRegionRegionregion - no
drag_region2drag_region2DragRegion2DragRegion2DragRegion2 RegionRegionRegionRegionregion - no
drag_region3drag_region3DragRegion3DragRegion3DragRegion3 RegionRegionRegionRegionregion - no


List of Operators

drag_region1DragRegion1DragRegion1drag_region1
Interactive moving of a region.
drag_region2DragRegion2DragRegion2drag_region2
Interactive movement of a region with fixpoint specification.
drag_region3DragRegion3DragRegion3drag_region3
Interactive movement of a region with restriction of positions.
draw_circleDrawCircleDrawCircledraw_circle
Interactive drawing of a circle.
draw_circle_modDrawCircleModDrawCircleModdraw_circle_mod
Interactive drawing of a circle.
draw_ellipseDrawEllipseDrawEllipsedraw_ellipse
Interactive drawing of an ellipse.
draw_ellipse_modDrawEllipseModDrawEllipseModdraw_ellipse_mod
Interactive drawing of an ellipse.
draw_lineDrawLineDrawLinedraw_line
Draw a line.
draw_line_modDrawLineModDrawLineModdraw_line_mod
Draw a line.
draw_nurbsDrawNurbsDrawNurbsdraw_nurbs
Interactive drawing of a NURBS curve.
draw_nurbs_interpDrawNurbsInterpDrawNurbsInterpdraw_nurbs_interp
Interactive drawing of a NURBS curve using interpolation.
draw_nurbs_interp_modDrawNurbsInterpModDrawNurbsInterpModdraw_nurbs_interp_mod
Interactive modification of a NURBS curve using interpolation.
draw_nurbs_modDrawNurbsModDrawNurbsModdraw_nurbs_mod
Interactive modification of a NURBS curve.
draw_pointDrawPointDrawPointdraw_point
Draw a point.
draw_point_modDrawPointModDrawPointModdraw_point_mod
Draw a point.
draw_polygonDrawPolygonDrawPolygondraw_polygon
Interactive drawing of a polygon row.
draw_rectangle1DrawRectangle1DrawRectangle1draw_rectangle1
Draw a rectangle parallel to the coordinate axis.
draw_rectangle1_modDrawRectangle1ModDrawRectangle1Moddraw_rectangle1_mod
Draw a rectangle parallel to the coordinate axis.
draw_rectangle2DrawRectangle2DrawRectangle2draw_rectangle2
Interactive drawing of any orientated rectangle.
draw_rectangle2_modDrawRectangle2ModDrawRectangle2Moddraw_rectangle2_mod
Interactive drawing of any orientated rectangle.
draw_regionDrawRegionDrawRegiondraw_region
Interactive drawing of a closed region.
draw_xldDrawXldDrawXlddraw_xld
Interactive drawing of a contour.
draw_xld_modDrawXldModDrawXldModdraw_xld_mod
Interactive modification of a contour.

ClassesClasses | | Operators