ClassesClasses | | Operators

create_drawing_object_rectangle2T_create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2 (Operator)

Name

create_drawing_object_rectangle2T_create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2 — 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)

Description

create_drawing_object_rectangle2create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2 creates an oriented rectangle which can be modified interactively in a HALCON window by the user. The rectangle is defined by the coordinates RowRowRowRowrow and ColumnColumnColumnColumncolumn of its center, its orientation PhiPhiPhiPhiphi, and the lengths of its half axis, Length1Length1Length1Length1length1 and Length2Length2Length2Length2length2 respectively. The created rectangle is returned in the handle DrawIDDrawIDDrawIDDrawIDdrawID.

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

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_paramsSetDrawingObjectParamsSetDrawingObjectParamsSetDrawingObjectParams 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_windowAttachDrawingObjectToWindowAttachDrawingObjectToWindowAttachDrawingObjectToWindow 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_rectangle2DrawRectangle2DrawRectangle2DrawRectangle2, 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

RowRowRowRowrow (input_control)  rectangle2.center.y HTupleHTupleHtuple (real) (double) (double) (double)

Row coordinate of the center.

Default value: 150

ColumnColumnColumnColumncolumn (input_control)  rectangle2.center.x HTupleHTupleHtuple (real) (double) (double) (double)

Column coordinate of the center.

Default value: 150

PhiPhiPhiPhiphi (input_control)  rectangle2.angle.rad HTupleHTupleHtuple (real) (double) (double) (double)

Orientation of the first half axis in radians.

Default value: 0

Length1Length1Length1Length1length1 (input_control)  rectangle2.hwidth HTupleHTupleHtuple (real) (double) (double) (double)

First half axis.

Default value: 100

Length2Length2Length2Length2length2 (input_control)  rectangle2.hheight HTupleHTupleHtuple (real) (double) (double) (double)

Second half axis.

Default value: 100

DrawIDDrawIDDrawIDDrawIDdrawID (output_control)  drawing_object HDrawingObject, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the drawing object.

Result

If the parameter values are correct the operator create_drawing_object_rectangle2create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2 returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.

Possible Predecessors

open_windowopen_windowOpenWindowOpenWindowOpenWindow

Possible Successors

disp_regiondisp_regionDispRegionDispRegionDispRegion, set_coloredset_coloredSetColoredSetColoredSetColored, set_line_widthset_line_widthSetLineWidthSetLineWidthSetLineWidth, set_drawset_drawSetDrawSetDrawSetDraw, set_insertset_insertSetInsertSetInsertSetInsert, attach_drawing_object_to_windowattach_drawing_object_to_windowAttachDrawingObjectToWindowAttachDrawingObjectToWindowAttachDrawingObjectToWindow

Alternatives

draw_rectangle2_moddraw_rectangle2_modDrawRectangle2ModDrawRectangle2ModDrawRectangle2Mod, draw_rectangle2draw_rectangle2DrawRectangle2DrawRectangle2DrawRectangle2, draw_regiondraw_regionDrawRegionDrawRegionDrawRegion

See also

gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2GenRectangle2, draw_circledraw_circleDrawCircleDrawCircleDrawCircle, draw_ellipsedraw_ellipseDrawEllipseDrawEllipseDrawEllipse, set_insertset_insertSetInsertSetInsertSetInsert

Module

Foundation


ClassesClasses | | Operators