create_drawing_object_rectangle2T_create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2create_drawing_object_rectangle2 (Operator)

Name

create_drawing_object_rectangle2T_create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2create_drawing_object_rectangle2 — Create a rectangle of any orientation which can be modified interactively.

Signature

create_drawing_object_rectangle2( : : Row, Column, Phi, Length1, Length2 : DrawID)

Herror T_create_drawing_object_rectangle2(const Htuple Row, const Htuple Column, const Htuple Phi, const Htuple Length1, const Htuple Length2, Htuple* DrawID)

void CreateDrawingObjectRectangle2(const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2, HTuple* DrawID)

void HDrawingObject::HDrawingObject(double Row, double Column, double Phi, double Length1, double Length2)

void HDrawingObject::CreateDrawingObjectRectangle2(double Row, double Column, double Phi, double Length1, double Length2)

static void HOperatorSet.CreateDrawingObjectRectangle2(HTuple row, HTuple column, HTuple phi, HTuple length1, HTuple length2, out HTuple drawID)

public HDrawingObject(double row, double column, double phi, double length1, double length2)

void HDrawingObject.CreateDrawingObjectRectangle2(double row, double column, double phi, double length1, double length2)

def create_drawing_object_rectangle2(row: float, column: float, phi: float, length_1: float, length_2: float) -> HHandle

Description

create_drawing_object_rectangle2create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2create_drawing_object_rectangle2 creates an oriented rectangle which can be modified interactively in a HALCON window by the user. The rectangle is defined by the coordinates RowRowRowRowrowrow and ColumnColumnColumnColumncolumncolumn of its center, its orientation PhiPhiPhiPhiphiphi, and the lengths of its half axis, Length1Length1Length1Length1length1length_1 and Length2Length2Length2Length2length2length_2 respectively. The created rectangle is returned in the handle DrawIDDrawIDDrawIDDrawIDdrawIDdraw_id.

These parameters can be queried any time with get_drawing_object_paramsget_drawing_object_paramsGetDrawingObjectParamsGetDrawingObjectParamsGetDrawingObjectParamsget_drawing_object_params, as well as its corresponding HALCON object with get_drawing_object_iconicget_drawing_object_iconicGetDrawingObjectIconicGetDrawingObjectIconicGetDrawingObjectIconicget_drawing_object_iconic.

In addition to those parameters, every drawing object has a number of parameters which determine the appearance of the object in the HALCON window. See set_drawing_object_paramsset_drawing_object_paramsSetDrawingObjectParamsSetDrawingObjectParamsSetDrawingObjectParamsset_drawing_object_params for details on the number and meaning of those parameters.

In order to enable the interactive modification with the drawing object, the object must be attached to an existing window. See attach_drawing_object_to_windowattach_drawing_object_to_windowAttachDrawingObjectToWindowAttachDrawingObjectToWindowAttachDrawingObjectToWindowattach_drawing_object_to_window for further details. Once attached, the rectangle is editable by the user through interaction with the window. There are three possible transformations for a rectangle2 object: resizing, displacement and rotation. The rectangle can be moved by dragging its center. By dragging the side handles, the size of the rectangle can be modified. The rectangle's orientation can only be changed by gripping a side perpendicular to the first half axis.

In contrast to the operator draw_rectangle2draw_rectangle2DrawRectangle2DrawRectangle2DrawRectangle2draw_rectangle2, this interaction does not block the calling thread.

Execution Information

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters

RowRowRowRowrowrow (input_control)  rectangle2.center.y HTuplefloatHTupleHtuple (real) (double) (double) (double)

Row coordinate of the center.

Default value: 150

ColumnColumnColumnColumncolumncolumn (input_control)  rectangle2.center.x HTuplefloatHTupleHtuple (real) (double) (double) (double)

Column coordinate of the center.

Default value: 150

PhiPhiPhiPhiphiphi (input_control)  rectangle2.angle.rad HTuplefloatHTupleHtuple (real) (double) (double) (double)

Orientation of the first half axis in radians.

Default value: 0

Length1Length1Length1Length1length1length_1 (input_control)  rectangle2.hwidth HTuplefloatHTupleHtuple (real) (double) (double) (double)

First half axis.

Default value: 100

Length2Length2Length2Length2length2length_2 (input_control)  rectangle2.hheight HTuplefloatHTupleHtuple (real) (double) (double) (double)

Second half axis.

Default value: 100

DrawIDDrawIDDrawIDDrawIDdrawIDdraw_id (output_control)  drawing_object HDrawingObject, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the drawing object.

Result

If the parameter values are correct the operator create_drawing_object_rectangle2create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2create_drawing_object_rectangle2 returns the value TRUE. Otherwise an exception is raised.

Possible Predecessors

open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window

Possible Successors

disp_regiondisp_regionDispRegionDispRegionDispRegiondisp_region, set_coloredset_coloredSetColoredSetColoredSetColoredset_colored, set_line_widthset_line_widthSetLineWidthSetLineWidthSetLineWidthset_line_width, set_drawset_drawSetDrawSetDrawSetDrawset_draw, set_insertset_insertSetInsertSetInsertSetInsertset_insert, attach_drawing_object_to_windowattach_drawing_object_to_windowAttachDrawingObjectToWindowAttachDrawingObjectToWindowAttachDrawingObjectToWindowattach_drawing_object_to_window

Alternatives

draw_rectangle2_moddraw_rectangle2_modDrawRectangle2ModDrawRectangle2ModDrawRectangle2Moddraw_rectangle2_mod, draw_rectangle2draw_rectangle2DrawRectangle2DrawRectangle2DrawRectangle2draw_rectangle2, draw_regiondraw_regionDrawRegionDrawRegionDrawRegiondraw_region

See also

gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2GenRectangle2gen_rectangle2, draw_circledraw_circleDrawCircleDrawCircleDrawCircledraw_circle, draw_ellipsedraw_ellipseDrawEllipseDrawEllipseDrawEllipsedraw_ellipse, set_insertset_insertSetInsertSetInsertSetInsertset_insert

Module

Foundation