1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/canvas/qcanvas.cpp:4227 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QCanvasSpline Class</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { background: #ffffff; color: black; }
|
---|
12 | --></style>
|
---|
13 | </head>
|
---|
14 | <body>
|
---|
15 |
|
---|
16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
17 | <tr bgcolor="#E5E5E5">
|
---|
18 | <td valign=center>
|
---|
19 | <a href="index.html">
|
---|
20 | <font color="#004faf">Home</font></a>
|
---|
21 | | <a href="classes.html">
|
---|
22 | <font color="#004faf">All Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main Classes</font></a>
|
---|
25 | | <a href="annotated.html">
|
---|
26 | <font color="#004faf">Annotated</font></a>
|
---|
27 | | <a href="groups.html">
|
---|
28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
29 | | <a href="functions.html">
|
---|
30 | <font color="#004faf">Functions</font></a>
|
---|
31 | </td>
|
---|
32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QCanvasSpline Class Reference<br><small>[<a href="canvas.html">canvas module</a>]</small></h1>
|
---|
33 |
|
---|
34 | <p>The QCanvasSpline class provides multi-bezier splines on a QCanvas.
|
---|
35 | <a href="#details">More...</a>
|
---|
36 | <p><tt>#include <<a href="qcanvas-h.html">qcanvas.h</a>></tt>
|
---|
37 | <p>Inherits <a href="qcanvaspolygon.html">QCanvasPolygon</a>.
|
---|
38 | <p><a href="qcanvasspline-members.html">List of all member functions.</a>
|
---|
39 | <h2>Public Members</h2>
|
---|
40 | <ul>
|
---|
41 | <li class=fn><a href="#QCanvasSpline"><b>QCanvasSpline</b></a> ( QCanvas * canvas )</li>
|
---|
42 | <li class=fn><a href="#~QCanvasSpline"><b>~QCanvasSpline</b></a> ()</li>
|
---|
43 | <li class=fn>void <a href="#setControlPoints"><b>setControlPoints</b></a> ( QPointArray ctrl, bool close = TRUE )</li>
|
---|
44 | <li class=fn>QPointArray <a href="#controlPoints"><b>controlPoints</b></a> () const</li>
|
---|
45 | <li class=fn>bool <a href="#closed"><b>closed</b></a> () const</li>
|
---|
46 | <li class=fn>virtual int <a href="#rtti"><b>rtti</b></a> () const</li>
|
---|
47 | </ul>
|
---|
48 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
49 |
|
---|
50 |
|
---|
51 | The QCanvasSpline class provides multi-bezier splines on a <a href="qcanvas.html">QCanvas</a>.
|
---|
52 |
|
---|
53 | <p>
|
---|
54 |
|
---|
55 |
|
---|
56 | <p> A QCanvasSpline is a sequence of 4-point bezier curves joined
|
---|
57 | together to make a curved shape.
|
---|
58 | <p> You set the control points of the spline with <a href="#setControlPoints">setControlPoints</a>().
|
---|
59 | <p> If the bezier is <a href="#closed">closed</a>(), then the first control point will be
|
---|
60 | re-used as the last control point. Therefore, a closed bezier must
|
---|
61 | have a multiple of 3 control points and an open bezier must have
|
---|
62 | one extra point.
|
---|
63 | <p> The beziers are not necessarily joined "smoothly". To ensure this,
|
---|
64 | set control points appropriately (general reference texts about
|
---|
65 | beziers will explain this in detail).
|
---|
66 | <p> Like any other canvas item splines can be moved with
|
---|
67 | <a href="qcanvasitem.html#move">QCanvasItem::move</a>() and <a href="qcanvasitem.html#moveBy">QCanvasItem::moveBy</a>(), or by setting
|
---|
68 | coordinates with <a href="qcanvasitem.html#setX">QCanvasItem::setX</a>(), <a href="qcanvasitem.html#setY">QCanvasItem::setY</a>() and
|
---|
69 | <a href="qcanvasitem.html#setZ">QCanvasItem::setZ</a>().
|
---|
70 | <p> <p>See also <a href="graphics.html">Graphics Classes</a> and <a href="images.html">Image Processing Classes</a>.
|
---|
71 |
|
---|
72 | <hr><h2>Member Function Documentation</h2>
|
---|
73 | <h3 class=fn><a name="QCanvasSpline"></a>QCanvasSpline::QCanvasSpline ( <a href="qcanvas.html">QCanvas</a> * canvas )
|
---|
74 | </h3>
|
---|
75 | Create a spline with no control points on the canvas <em>canvas</em>.
|
---|
76 | <p> <p>See also <a href="#setControlPoints">setControlPoints</a>().
|
---|
77 |
|
---|
78 | <h3 class=fn><a name="~QCanvasSpline"></a>QCanvasSpline::~QCanvasSpline ()
|
---|
79 | </h3>
|
---|
80 | Destroy the spline.
|
---|
81 |
|
---|
82 | <h3 class=fn>bool <a name="closed"></a>QCanvasSpline::closed () const
|
---|
83 | </h3>
|
---|
84 | Returns TRUE if the control points are a closed set; otherwise
|
---|
85 | returns FALSE.
|
---|
86 |
|
---|
87 | <h3 class=fn><a href="qpointarray.html">QPointArray</a> <a name="controlPoints"></a>QCanvasSpline::controlPoints () const
|
---|
88 | </h3>
|
---|
89 | Returns the current set of control points.
|
---|
90 | <p> <p>See also <a href="#setControlPoints">setControlPoints</a>() and <a href="#closed">closed</a>().
|
---|
91 |
|
---|
92 | <h3 class=fn>int <a name="rtti"></a>QCanvasSpline::rtti () const<tt> [virtual]</tt>
|
---|
93 | </h3>
|
---|
94 | Returns 8 (QCanvasItem::Rtti_Spline).
|
---|
95 | <p> <p>See also <a href="qcanvasitem.html#rtti">QCanvasItem::rtti</a>().
|
---|
96 |
|
---|
97 | <p>Reimplemented from <a href="qcanvaspolygon.html#rtti">QCanvasPolygon</a>.
|
---|
98 | <h3 class=fn>void <a name="setControlPoints"></a>QCanvasSpline::setControlPoints ( <a href="qpointarray.html">QPointArray</a> ctrl, bool close = TRUE )
|
---|
99 | </h3>
|
---|
100 | Set the spline control points to <em>ctrl</em>.
|
---|
101 | <p> If <em>close</em> is TRUE, then the first point in <em>ctrl</em> will be
|
---|
102 | re-used as the last point, and the number of control points must
|
---|
103 | be a multiple of 3. If <em>close</em> is FALSE, one additional control
|
---|
104 | point is required, and the number of control points must be one of
|
---|
105 | (4, 7, 10, 13, ...).
|
---|
106 | <p> If the number of control points doesn't meet the above conditions,
|
---|
107 | the number of points will be truncated to the largest number of
|
---|
108 | points that do meet the requirement.
|
---|
109 |
|
---|
110 | <p>Example: <a href="canvas-example.html#x2926">canvas/canvas.cpp</a>.
|
---|
111 | <!-- eof -->
|
---|
112 | <hr><p>
|
---|
113 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
114 | Copyright © 1995-2007
|
---|
115 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
116 | <table width=100% cellspacing=0 border=0><tr>
|
---|
117 | <td>Copyright © 2007
|
---|
118 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
119 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
120 | </table></div></address></body>
|
---|
121 | </html>
|
---|