create_drawing_object_rectangle2T_create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2create_drawing_object_rectangle2 (算子)

名称

create_drawing_object_rectangle2T_create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2create_drawing_object_rectangle2 — 创建一个可以交互修改的任意方向的矩形。

签名

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

描述

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.

执行信息

此算子返回一个句柄。请注意,即使该句柄被用作特定算子的输入参数,这些算子仍可能改变此句柄类型的实例状态。

参数

RowRowRowRowrowrow (输入控制)  rectangle2.center.y HTuplefloatHTupleHtuple (real) (double) (double) (double)

Row coordinate of the center.

默认值: 150

ColumnColumnColumnColumncolumncolumn (输入控制)  rectangle2.center.x HTuplefloatHTupleHtuple (real) (double) (double) (double)

Column coordinate of the center.

默认值: 150

PhiPhiPhiPhiphiphi (输入控制)  rectangle2.angle.rad HTuplefloatHTupleHtuple (real) (double) (double) (double)

Orientation of the first half axis in radians.

默认值: 0

Length1Length1Length1Length1length1length_1 (输入控制)  rectangle2.hwidth HTuplefloatHTupleHtuple (real) (double) (double) (double)

First half axis.

默认值: 100

Length2Length2Length2Length2length2length_2 (输入控制)  rectangle2.hheight HTuplefloatHTupleHtuple (real) (double) (double) (double)

Second half axis.

默认值: 100

DrawIDDrawIDDrawIDDrawIDdrawIDdraw_id (输出控制)  drawing_object HDrawingObject, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

绘图对象的句柄。

结果

如果参数值正确,算子 create_drawing_object_rectangle2create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2create_drawing_object_rectangle2 返回值 2 ( H_MSG_TRUE )。否则将抛出异常。

可能的前趋

open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window

可能的后继

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

替代

draw_rectangle2_moddraw_rectangle2_modDrawRectangle2ModDrawRectangle2ModDrawRectangle2Moddraw_rectangle2_mod, draw_rectangle2draw_rectangle2DrawRectangle2DrawRectangle2DrawRectangle2draw_rectangle2, draw_regiondraw_regionDrawRegionDrawRegionDrawRegiondraw_region

另见

gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2GenRectangle2gen_rectangle2, draw_circledraw_circleDrawCircleDrawCircleDrawCircledraw_circle, draw_ellipsedraw_ellipseDrawEllipseDrawEllipseDrawEllipsedraw_ellipse, set_insertset_insertSetInsertSetInsertSetInsertset_insert

模块

基础