Skip to content

create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2create_drawing_object_rectangle2T_create_drawing_object_rectangle2πŸ”—

Short descriptionπŸ”—

create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2create_drawing_object_rectangle2T_create_drawing_object_rectangle2 β€” Create a rectangle of any orientation which can be modified interactively.

SignatureπŸ”—

create_drawing_object_rectangle2( rectangle2.center.y Row, rectangle2.center.x Column, rectangle2.angle.rad Phi, rectangle2.hwidth Length1, rectangle2.hheight Length2, out drawing_object DrawID )void CreateDrawingObjectRectangle2( const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2, HTuple* DrawID )static void HOperatorSet.CreateDrawingObjectRectangle2( HTuple row, HTuple column, HTuple phi, HTuple length1, HTuple length2, out HTuple drawID )def create_drawing_object_rectangle2( row: float, column: float, phi: float, length_1: float, length_2: float ) -> HHandle

Herror T_create_drawing_object_rectangle2( 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 )

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 )

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

DescriptionπŸ”—

create_drawing_object_rectangle2CreateDrawingObjectRectangle2 creates an oriented rectangle which can be modified interactively in a HALCON window by the user. The rectangle is defined by the coordinates Rowrowrow and Columncolumncolumn of its center, its orientation Phiphiphi, and the lengths of its half axis, Length1length1length_1 and Length2length2length_2 respectively. The created rectangle is returned in the handle DrawIDdrawIDdraw_id.

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

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_paramsSetDrawingObjectParams 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_windowAttachDrawingObjectToWindow 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_rectangle2DrawRectangle2, this interaction does not block the calling thread.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

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πŸ”—

Rowrowrow (input_control) rectangle2.center.y β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Row coordinate of the center.

Default: 150150

Columncolumncolumn (input_control) rectangle2.center.x β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Column coordinate of the center.

Default: 150150

Phiphiphi (input_control) rectangle2.angle.rad β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Orientation of the first half axis in radians.

Default: 00

Length1length1length_1 (input_control) rectangle2.hwidth β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

First half axis.

Default: 100100

Length2length2length_2 (input_control) rectangle2.hheight β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Second half axis.

Default: 100100

DrawIDdrawIDdraw_id (output_control) drawing_object β†’ (handle)HTuple (HHandle)HDrawingObject, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the drawing object.

ResultπŸ”—

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

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

open_windowOpenWindow

Possible successors

disp_regionDispRegion, set_coloredSetColored, set_line_widthSetLineWidth, set_drawSetDraw, attach_drawing_object_to_windowAttachDrawingObjectToWindow

Alternatives

draw_rectangle2_modDrawRectangle2Mod, draw_rectangle2DrawRectangle2, draw_regionDrawRegion

See also

gen_rectangle2GenRectangle2, draw_circleDrawCircle, draw_ellipseDrawEllipse

ModuleπŸ”—

Foundation