draw_nurbsT_draw_nurbsDrawNurbsDrawNurbs (Operator)
Name
draw_nurbsT_draw_nurbsDrawNurbsDrawNurbs
— Interactive drawing of a NURBS curve.
Warning
This operator does not work in an HDevelop graphics window opened with
dev_open_window
.
Signature
void DrawNurbs(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)
void HXLDCont::DrawNurbs(const HWindow& WindowHandle, const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights)
void HXLDCont::DrawNurbs(const HWindow& WindowHandle, const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights)
void HXLDCont::DrawNurbs(const HWindow& WindowHandle, const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights)
(Windows only)
HXLDCont HWindow::DrawNurbs(const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights) const
HXLDCont HWindow::DrawNurbs(const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights) const
HXLDCont HWindow::DrawNurbs(const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights) const
(Windows only)
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_nurbsDrawNurbsDrawNurbsDrawNurbs
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_xldGenContourNurbsXldGenContourNurbsXldGenContourNurbsXld
. To use the control information
RowsRowsRowsRowsrows
, ColsColsColsColscols
, and WeightsWeightsWeightsWeightsweights
in a subsequent call to
the operator gen_contour_nurbs_xldgen_contour_nurbs_xldGenContourNurbsXldGenContourNurbsXldGenContourNurbsXld
, 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_interpDrawNurbsInterpDrawNurbsInterpDrawNurbsInterp
, it is
possible to create a NURBS curve that interpolates points specified by the
user.
Directly after calling draw_nurbsdraw_nurbsDrawNurbsDrawNurbsDrawNurbs
, 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
-
move the curve by clicking the left mouse button on the cross in
the center and then dragging it to the new position,
-
rotate it by clicking with the left mouse button on the arrow and
then dragging it, till the curve has the right direction, and
-
scale it by dragging the double arrow. To keep the ratio the
parameter KeepRatioKeepRatioKeepRatioKeepRatiokeepRatio
has to be set to 'true'"true""true""true""true".
By pressing the Shift key again you can switch back to the edit mode.
Pressing the right mouse button terminates the procedure. On macOS
draw_nurbsdraw_nurbsDrawNurbsDrawNurbsDrawNurbs
can also be terminated by pressing the escape key.
The appearance of the curve while drawing is determined by the line width,
size, and color set via the operators set_colorset_colorSetColorSetColorSetColor
, set_coloredset_coloredSetColoredSetColoredSetColored
,
set_line_widthset_line_widthSetLineWidthSetLineWidthSetLineWidth
, and set_line_styleset_line_styleSetLineStyleSetLineStyleSetLineStyle
. The control polygon and
all handles are displayed in the second color set by set_colorset_colorSetColorSetColorSetColor
or
set_coloredset_coloredSetColoredSetColoredSetColored
. Their line width is fixed to 1 and their line style is
fixed to a drawn-through line.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
ContOutContOutContOutContOutcontOut
(output_object) xld_cont →
objectHXLDContHXLDContHobject *
Contour approximating the NURBS curve.
WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle
(input_control) window →
HWindow, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Window handle.
RotateRotateRotateRotaterotate
(input_control) string →
HTupleHTupleHtuple (string) (string) (HString) (char*)
Enable rotation?
Default value:
'true'
"true"
"true"
"true"
"true"
List of values: 'false'"false""false""false""false", 'true'"true""true""true""true"
MoveMoveMoveMovemove
(input_control) string →
HTupleHTupleHtuple (string) (string) (HString) (char*)
Enable moving?
Default value:
'true'
"true"
"true"
"true"
"true"
List of values: 'false'"false""false""false""false", 'true'"true""true""true""true"
ScaleScaleScaleScalescale
(input_control) string →
HTupleHTupleHtuple (string) (string) (HString) (char*)
Enable scaling?
Default value:
'true'
"true"
"true"
"true"
"true"
List of values: 'false'"false""false""false""false", 'true'"true""true""true""true"
KeepRatioKeepRatioKeepRatioKeepRatiokeepRatio
(input_control) string →
HTupleHTupleHtuple (string) (string) (HString) (char*)
Keep ratio while scaling?
Default value:
'true'
"true"
"true"
"true"
"true"
List of values: 'false'"false""false""false""false", 'true'"true""true""true""true"
DegreeDegreeDegreeDegreedegree
(input_control) integer →
HTupleHTupleHtuple (integer) (int / long) (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 →
HTupleHTupleHtuple (real) (double) (double) (double)
Row coordinates of the control polygon.
ColsColsColsColscols
(output_control) coordinates.x-array →
HTupleHTupleHtuple (real) (double) (double) (double)
Columns coordinates of the control polygon.
WeightsWeightsWeightsWeightsweights
(output_control) real-array →
HTupleHTupleHtuple (real) (double) (double) (double)
Weight vector.
Result
draw_nurbsdraw_nurbsDrawNurbsDrawNurbsDrawNurbs
returns 2 (H_MSG_TRUE), if the window is valid.
If necessary, an exception is raised.
Possible Predecessors
open_windowopen_windowOpenWindowOpenWindowOpenWindow
Possible Successors
set_coloredset_coloredSetColoredSetColoredSetColored
,
set_line_widthset_line_widthSetLineWidthSetLineWidthSetLineWidth
,
set_drawset_drawSetDrawSetDrawSetDraw
,
set_insertset_insertSetInsertSetInsertSetInsert
Alternatives
draw_xlddraw_xldDrawXldDrawXldDrawXld
,
draw_nurbs_interpdraw_nurbs_interpDrawNurbsInterpDrawNurbsInterpDrawNurbsInterp
See also
draw_nurbs_moddraw_nurbs_modDrawNurbsModDrawNurbsModDrawNurbsMod
,
draw_nurbs_interpdraw_nurbs_interpDrawNurbsInterpDrawNurbsInterpDrawNurbsInterp
,
gen_contour_nurbs_xldgen_contour_nurbs_xldGenContourNurbsXldGenContourNurbsXldGenContourNurbsXld
Module
Foundation