HALCON Reference Manual 10.0.2
Table of Contents / Graphics / Drawing ClassesClassesClasses | | | Operators

draw_nurbsT_draw_nurbsdraw_nurbsDrawNurbsDrawNurbs (Operator)

Name

draw_nurbsT_draw_nurbsdraw_nurbsDrawNurbsDrawNurbs — Interactive drawing of a NURBS curve.

Signature

draw_nurbs( : ContOut : WindowHandle, Rotate, Move, Scale, KeepRatio, Degree : Rows, Cols, Weights)

Herror T_draw_nurbs(Hobject* ContOut, const Htuple WindowHandle, const Htuple Rotate, const Htuple Move, const Htuple Scale, const Htuple KeepRatio, const Htuple Degree, Htuple* Rows, Htuple* Cols, Htuple* Weights)

Herror draw_nurbs(Hobject* ContOut, const HTuple& WindowHandle, const HTuple& Rotate, const HTuple& Move, const HTuple& Scale, const HTuple& KeepRatio, const HTuple& Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights)

HXLDCont HXLDCont::DrawNurbs(const HTuple& WindowHandle, const HTuple& Rotate, const HTuple& Move, const HTuple& Scale, const HTuple& KeepRatio, const HTuple& Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights)

void HOperatorSetX.DrawNurbs(
[out] IHUntypedObjectX*ContOut, [in] VARIANT WindowHandle, [in] VARIANT Rotate, [in] VARIANT Move, [in] VARIANT Scale, [in] VARIANT KeepRatio, [in] VARIANT Degree, [out] VARIANT* Rows, [out] VARIANT* Cols, [out] VARIANT* Weights)

VARIANT HXLDContX.DrawNurbs(
[in] IHWindowX* WindowHandle, [in] BSTR Rotate, [in] BSTR Move, [in] BSTR Scale, [in] BSTR KeepRatio, [in] Hlong Degree, [out] VARIANT* Cols, [out] VARIANT* Weights)

IHXLDContX* HWindowX.DrawNurbs(
[in] BSTR Rotate, [in] BSTR Move, [in] BSTR Scale, [in] BSTR KeepRatio, [in] Hlong Degree, [out] VARIANT* Rows, [out] VARIANT* Cols, [out] VARIANT* Weights)

static void HOperatorSet.DrawNurbs(out HObject contOut, HTuple windowHandle, HTuple rotate, HTuple move, HTuple scale, HTuple keepRatio, HTuple degree, out HTuple rows, out HTuple cols, out HTuple weights)

void HXLDCont.DrawNurbs(HWindow windowHandle, string rotate, string move, string scale, string keepRatio, int degree, out HTuple rows, out HTuple cols, out HTuple weights)

HXLDCont HWindow.DrawNurbs(string rotate, string move, string scale, string keepRatio, int degree, out HTuple rows, out HTuple cols, out HTuple weights)

Description

draw_nurbsdraw_nurbsdraw_nurbsDrawNurbsDrawNurbs returns the contour ContOutContOutContOutContOutcontOut and control information (RowsRowsRowsRowsrows, ColsColsColsColscols, and WeightsWeightsWeightsWeightsweights) of a NURBS curve of degree DegreeDegreeDegreeDegreedegree, which has been created interactively by the user in the window WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle. For additional information concerning NURBS curves, see the documentation of gen_contour_nurbs_xldgen_contour_nurbs_xldgen_contour_nurbs_xldGenContourNurbsXldGenContourNurbsXld. To use the control information RowsRowsRowsRowsrows, ColsColsColsColscols, and WeightsWeightsWeightsWeightsweights in a subsequent call to the operator gen_contour_nurbs_xldgen_contour_nurbs_xldgen_contour_nurbs_xldGenContourNurbsXldGenContourNurbsXld, the knot vector KnotsKnotsKnotsKnotsknots should be set to 'auto'"auto""auto""auto""auto".

The NURBS curve is created and manipulated by the means of its control polygon. By contrast, using the operator draw_nurbs_interpdraw_nurbs_interpdraw_nurbs_interpDrawNurbsInterpDrawNurbsInterp, it is possible to create a NURBS curve that interpolates points specified by the user. Directly after calling draw_nurbsdraw_nurbsdraw_nurbsDrawNurbsDrawNurbs, you can add control points by clicking with the left mouse button in the window at the desired positions.

When there are three control points or more, the first and the last point will be marked with an additional square. By clicking on them you can close the curve or open it again. You delete the point appended last by pressing the Ctrl key.

As soon as the number of control points exceeds DegreeDegreeDegreeDegreedegree, the NURBS curve given by the specified control polygon and weight vector is displayed in addition to the control polygon.

The control point which was handled last is surrounded by a circle representing its weight. By simply dragging the circle you can increase or decrease the weight of this control point.

Existing control points can be moved by dragging them with the mouse. Further new points on the control polygon (to refine the control polygon) can be inserted by a left click on the desired position on the control polygon.

By pressing the Shift key, you can switch into the transformation mode. In this mode you can rotate, move, and scale the contour as a whole, but only if you set the parameters RotateRotateRotateRotaterotate, MoveMoveMoveMovemove, and ScaleScaleScaleScalescale, respectively, to 'true'"true""true""true""true". Instead of the pick points and the control polygon, 3 symbols are displayed with the contour: a cross in the middle and an arrow to the right if RotateRotateRotateRotaterotate is set to 'true'"true""true""true""true", and a double-headed arrow to the upper right if ScaleScaleScaleScalescale is set to 'true'"true""true""true""true".

You can

By pressing the Shift key again you can switch back to the edit mode. Pressing the right mouse button terminates the procedure.

The appearance of the curve while drawing is determined by the line width, size, and color set via the operators set_colorset_colorset_colorSetColorSetColor, set_coloredset_coloredset_coloredSetColoredSetColored, set_line_widthset_line_widthset_line_widthSetLineWidthSetLineWidth, and set_line_styleset_line_styleset_line_styleSetLineStyleSetLineStyle. The control polygon and all handles are displayed in the second color set by set_colorset_colorset_colorSetColorSetColor or set_coloredset_coloredset_coloredSetColoredSetColored. Their line width is fixed to 1 and their line style is fixed to a drawn-through line.

Parallelization

Parameters

ContOutContOutContOutContOutcontOut (output_object)  xld_cont objectHXLDContHXLDContHXLDContXHobject *

Contour approximating the NURBS curve.

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHWindowX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Window identifier.

RotateRotateRotateRotaterotate (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Enable rotation?

Default value: 'true' "true" "true" "true" "true"

List of values: 'true'"true""true""true""true", 'false'"false""false""false""false"

MoveMoveMoveMovemove (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Enable moving?

Default value: 'true' "true" "true" "true" "true"

List of values: 'true'"true""true""true""true", 'false'"false""false""false""false"

ScaleScaleScaleScalescale (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Enable scaling?

Default value: 'true' "true" "true" "true" "true"

List of values: 'true'"true""true""true""true", 'false'"false""false""false""false"

KeepRatioKeepRatioKeepRatioKeepRatiokeepRatio (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Keep ratio while scaling?

Default value: 'true' "true" "true" "true" "true"

List of values: 'true'"true""true""true""true", 'false'"false""false""false""false"

DegreeDegreeDegreeDegreedegree (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

The degree p of the NURBS curve. Reasonable values are 3 to 25.

Default value: 3

Suggested values: 2, 3, 4, 5

Restriction: Degree >= 2

RowsRowsRowsRowsrows (output_control)  coordinates.y-array HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Row coordinates of the control polygon.

ColsColsColsColscols (output_control)  coordinates.x-array HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Columns coordinates of the control polygon.

WeightsWeightsWeightsWeightsweights (output_control)  real-array HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Weight vector.

Result

draw_nurbsdraw_nurbsdraw_nurbsDrawNurbsDrawNurbs returns 2 (H_MSG_TRUE), if the window is valid. If necessary, an exception is raised.

Possible Predecessors

open_windowopen_windowopen_windowOpenWindowOpenWindow

Possible Successors

set_coloredset_coloredset_coloredSetColoredSetColored, set_line_widthset_line_widthset_line_widthSetLineWidthSetLineWidth, set_drawset_drawset_drawSetDrawSetDraw, set_insertset_insertset_insertSetInsertSetInsert

Alternatives

draw_xlddraw_xlddraw_xldDrawXldDrawXld, draw_nurbs_interpdraw_nurbs_interpdraw_nurbs_interpDrawNurbsInterpDrawNurbsInterp

See also

draw_nurbs_moddraw_nurbs_moddraw_nurbs_modDrawNurbsModDrawNurbsMod, draw_nurbs_interpdraw_nurbs_interpdraw_nurbs_interpDrawNurbsInterpDrawNurbsInterp, gen_contour_nurbs_xldgen_contour_nurbs_xldgen_contour_nurbs_xldGenContourNurbsXldGenContourNurbsXld

Module

Foundation


Table of Contents / Graphics / Drawing ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH