File: qpointarray.html

package info (click to toggle)
qt-embedded 2.3.2-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 68,608 kB
  • ctags: 45,998
  • sloc: cpp: 276,654; ansic: 71,987; makefile: 29,074; sh: 12,305; yacc: 2,465; python: 1,863; perl: 481; lex: 480; xml: 68; lisp: 15
file content (235 lines) | stat: -rw-r--r-- 15,270 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QPointArray Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">

<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>

<h1 align=center>QPointArray Class Reference</h1><br clear="all">
<p>
The QPointArray class provides an array of points.
<a href="#details">More...</a>
<p>
<code>#include &lt;<a href="qpointarray-h.html">qpointarray.h</a>&gt;</code>
<p>
Inherits <a href="qarray.html">QArray</a>.
<p><a href="qpointarray-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#3d59ff"><b>QPointArray</b></a>()</div>
<li><div class="fn"><a href="#43a8c0"><b>~QPointArray</b></a>()</div>
<li><div class="fn"><a href="#809938"><b>QPointArray</b></a>(intsize)</div>
<li><div class="fn"><a href="#77aa2b"><b>QPointArray</b></a>(constQPointArray&amp;a)</div>
<li><div class="fn"><a href="#38f647"><b>QPointArray</b></a>(constQRect&amp;r, boolclosed=FALSE)</div>
<li><div class="fn"><a href="#85c0f2"><b>QPointArray</b></a>(intnPoints, constQCOORD*points)</div>
<li><div class="fn">QPointArray&amp;<a href="#fded81"><b>operator=</b></a>(constQPointArray&amp;a)</div>
<li><div class="fn">QPointArray<a href="#651c2a"><b>copy</b></a>()const</div>
<li><div class="fn">void<a href="#66e2e4"><b>translate</b></a>(intdx, intdy)</div>
<li><div class="fn">QRect<a href="#eeb5a4"><b>boundingRect</b></a>()const</div>
<li><div class="fn">void<a href="#ea3787"><b>point</b></a>(uinti, int*x, int*y)const</div>
<li><div class="fn">QPoint<a href="#7f3b06"><b>point</b></a>(uinti)const</div>
<li><div class="fn">void<a href="#fdb081"><b>setPoint</b></a>(uinti, intx, inty)</div>
<li><div class="fn">void<a href="#c65eff"><b>setPoint</b></a>(uinti, constQPoint&amp;p)</div>
<li><div class="fn">bool<a href="#a7ee88"><b>setPoints</b></a>(intnPoints, constQCOORD*points)</div>
<li><div class="fn">bool<a href="#76de1d"><b>setPoints</b></a>(intnPoints, intfirstx, intfirsty, ...)</div>
<li><div class="fn">bool<a href="#ff311a"><b>putPoints</b></a>(intindex, intnPoints, constQCOORD*points)</div>
<li><div class="fn">bool<a href="#fb573f"><b>putPoints</b></a>(intindex, intnPoints, intfirstx, intfirsty, ...)</div>
<li><div class="fn">void<a href="#b04eac"><b>makeArc</b></a>(intx, inty, intw, inth, inta1, inta2)</div>
<li><div class="fn">void<a href="#b2584f"><b>makeEllipse</b></a>(intx, inty, intw, inth)</div>
<li><div class="fn">void<a href="#c07739"><b>makeArc</b></a>(intx, inty, intw, inth, inta1, inta2, constQWMatrix&amp;)</div>
<li><div class="fn">QPointArray<a href="#591d23"><b>quadBezier</b></a>()const</div>
<li><div class="fn">void*<b>shortPoints</b>(intindex=0, intnPoints=-1)const(internal)</div>
</ul>
<h2>Static Public Members</h2>
<ul>
<li><div class="fn">void<b>cleanBuffers</b>()(internal)</div>
</ul>
<h2>Related Functions</h2>
(Note that these are not member functions.)
<ul>
<li>QDataStream &amp; <a href="qpointarray.html#da9d39"><b>operator&lt;&lt;</b></a> (QDataStream &amp; s, const QPointArray &amp; a)
<li>QDataStream &amp; <a href="qpointarray.html#e2e438"><b>operator&gt;&gt;</b></a> (QDataStream &amp; s, QPointArray &amp; a)
</ul>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QPointArray class provides an array of points.
<p>
The QPointArray is an array of <a href="qpoint.html">QPoint</a> objects. In addition to the
functions provided by <a href="qarray.html">QArray</a>, QPointArray provides some
point-specific functions.
<p>For convenient reading and writing of the point data: <a href="#76de1d">setPoints</a>(),
<a href="#fb573f">putPoints</a>(), <a href="#7f3b06">point</a>(), and <a href="#c65eff">setPoint</a>().
<p>For geometry operations: <a href="#eeb5a4">boundingRect</a>() and <a href="#66e2e4">translate</a>(). There is
also a <a href="qwmatrix.html#83c725">QWMatrix::map</a>() function for more general transformation of
QPointArrays.
<p>QPointArray is used by <a href="qpainter.html#f0bc44">QPainter::drawLineSegments</a>(),
<a href="qpainter.html#134ad2">QPainter::drawPolyline</a>(), <a href="qpainter.html#2efe17">QPainter::drawPolygon</a>() and
<a href="qpainter.html#3d49cd">QPainter::drawQuadBezier</a>(), among other things.
<p>Note that since this class is a QArray, it is explicitly shared and
works with shallow copies by default.
<p>See also  <a href="qpainter.html">QPainter</a>, <a href="qwmatrix.html">QWMatrix</a> and <a href="qarray.html">QArray</a>.
<p>Examples:
 <a href="desktop-desktop-cpp.html#QPointArray">desktop/desktop.cpp</a>
 <a href="picture-picture-cpp.html#QPointArray">picture/picture.cpp</a>

<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="3d59ff"></a>QPointArray::QPointArray()</h3>
<p>Constructs a null point array.
<p>See also  <a href="qarray.html#d68b01">isNull</a>().
<h3 class="fn"><a name="38f647"></a>QPointArray::QPointArray(const<a href="qrect.html">QRect</a>&amp;r, boolclosed=FALSE)</h3>
<p>Constructs a point array from the rectangle <em>r.</em>
<p>If <em>closed</em> is FALSE, then the point array just contains the
following four points in the listed order: r.topLeft(),
r.topRight(), r.bottomRight() and r.bottomLeft().
<p>If <em>closed</em> is TRUE, then a fifth point is set to r.topLeft().
<h3 class="fn"><a name="77aa2b"></a>QPointArray::QPointArray(constQPointArray&amp;a)</h3>
<p>Constructs a shallow copy of the point array <em>a.</em>
<p>See also  <a href="#651c2a">copy</a>().
<h3 class="fn"><a name="85c0f2"></a>QPointArray::QPointArray(intnPoints, constQCOORD*points)</h3>
<p>Constructs a point array with <em>nPoints</em> points, taken from the
<em>points</em> array.
<p>Equivalent to <a href="#76de1d">setPoints</a>(nPoints,points).
<h3 class="fn"><a name="809938"></a>QPointArray::QPointArray(intsize)</h3>
<p>Constructs a point array with room for <em>size</em> points. Makes a null
array if <em>size</em> == 0.
<p>See also  <a href="qarray.html#bb1f76">resize</a>() and <a href="qarray.html#d68b01">isNull</a>().
<h3 class="fn"><a name="43a8c0"></a>QPointArray::~QPointArray()</h3>
<p>Destructs the point array.
<h3 class="fn"><a href="qrect.html">QRect</a><a name="eeb5a4"></a>QPointArray::boundingRect()const</h3>
<p>Returns the bounding rectangle of the points in the array, or
<a href="qrect.html">QRect</a>(0,0,0,0) if the array is empty.
<h3 class="fn">QPointArray<a name="651c2a"></a>QPointArray::copy()const</h3>
<p>Creates a deep copy of the array.
<h3 class="fn">void<a name="b04eac"></a>QPointArray::makeArc(intx, inty, intw, inth, inta1, inta2)</h3>
<p>Sets the points of the array to those describing an arc of an
ellipse with size <em>w</em> by <em>h</em> and position (<em>x, y</em> ), starting
from angle <em>a1,</em> spanning <em>a2.</em>  The resulting array has sufficient
resolution for pixel accuracy (see the overloaded function which
takes an additional <a href="qwmatrix.html">QWMatrix</a> parameter).
<p>Angles are specified in 16ths of a degree, i.e. a full circle equals
5760 (16*360).  Positive values mean counter-clockwise while
negative values mean clockwise direction.  Zero degrees is at the 3
o'clock position.
<h3 class="fn">void<a name="c07739"></a>QPointArray::makeArc(intx, inty, intw, inth, inta1, inta2, const<a href="qwmatrix.html">QWMatrix</a>&amp;xf)</h3>
<p>Sets the points of the array to those describing an arc of an
ellipse with size <em>w</em> by <em>h</em> and position (<em>x, y</em> ), starting
from angle <em>a1,</em> spanning <em>a2,</em> transformed by the matrix <em>xf.</em>
The resulting array has sufficient resolution for pixel accuracy.
<p>Angles are specified in 16ths of a degree, i.e. a full circle equals
5760 (16*360). Positive values mean counter-clockwise while negative
values mean clockwise direction.  Zero degrees is at the 3 o'clock
position.
<h3 class="fn">void<a name="b2584f"></a>QPointArray::makeEllipse(intxx, intyy, intw, inth)</h3>
<p>Sets the points of the array to those describing an ellipse with
size <em>w</em> by <em>h</em> and position (<em>x, y</em> ).
<p>The returned array has sufficient resolution for use as pixels.
<h3 class="fn">QPointArray&amp;<a name="fded81"></a>QPointArray::operator=(constQPointArray&amp;a)</h3>
<p>Assigns a shallow copy of <em>a</em> to this point array and returns a
reference to this point array.
<p>Equivalent to <a href="qarray.html#2bb3f0">assign</a>( a ).
<p>See also  <a href="#651c2a">copy</a>().
<h3 class="fn"><a href="qpoint.html">QPoint</a><a name="7f3b06"></a>QPointArray::point(uintindex)const</h3>
<p>Returns the point at position <em>index</em> in the array.
<h3 class="fn">void<a name="ea3787"></a>QPointArray::point(uintindex, int*x, int*y)const</h3>
<p>Returns the point at position <em>index</em> in the array in <em>*x</em> and <em>*y.</em>
<h3 class="fn">bool<a name="ff311a"></a>QPointArray::putPoints(intindex, intnPoints, constQCOORD*points)</h3>
<p>Copies <em>nPoints</em> points from the <em>points</em> array into this point array.
Will resize this point array if <code>index+nPoints</code> exceeds
the size of the array.
<p>Returns TRUE if successful, or FALSE if the array could not be
resized (typcailly due to lack of memory).
<p>The example code creates an array with three points: (1,2), (3,4)
and (5,6):
<pre>    <a href="qpointarray.html">QPointArray</a> a( 1 );
    a[0] = QPoint( 1, 2 );
    static QCOORD points[] = { 3,4, 5,6 };
    a.<a href="#fb573f">putPoints</a>( 1, 2, points );
</pre>
<p>This function differs from <a href="#76de1d">setPoints</a>() in that it does not resize the
array unless the array size is exceeded.
<p>See also  <a href="qarray.html#bb1f76">resize</a>() and <a href="#76de1d">setPoints</a>().
<h3 class="fn">bool<a name="fb573f"></a>QPointArray::putPoints(intindex, intnPoints, intfirstx, intfirsty, ...)</h3>
<p>Copies <em>nPoints</em> points from the variable argument list into this point
array. Will resize this point array if <code>index+nPoints</code> exceeds
the size of the array.
<p>Returns TRUE if successful, or FALSE if the array could not be
resized (typically due to lack of memory).
<p>The example code creates an array with two points (1,2), (3,4) and (5,6):
<pre>    <a href="qpointarray.html">QPointArray</a> a( 1 );
    a[0] = QPoint( 1, 2 );
    a.<a href="#fb573f">putPoints</a>( 1, 2, 3,4, 5,6 );
</pre>
<p>This function differs from <a href="#76de1d">setPoints</a>() in that it does not resize the
array unless the array size is exceeded.
<p>See also  <a href="qarray.html#bb1f76">resize</a>() and <a href="#76de1d">setPoints</a>().
<h3 class="fn">QPointArray<a name="591d23"></a>QPointArray::quadBezier()const</h3>
<p>Returns the Bezier points for the four control points in this array.
<h3 class="fn">void<a name="c65eff"></a>QPointArray::setPoint(uinti, const<a href="qpoint.html">QPoint</a>&amp;p)</h3>
<p>Equivalent to setPoint( i, p.x(), p.y() ).
<h3 class="fn">void<a name="fdb081"></a>QPointArray::setPoint(uintindex, intx, inty)</h3>
<p>Sets the point at position <em>index</em> in the array to <em>(x,y).</em>
<h3 class="fn">bool<a name="a7ee88"></a>QPointArray::setPoints(intnPoints, constQCOORD*points)</h3>
<p>Resizes the array to <em>nPoints</em> and sets the points in the array to
the values taken from <em>points.</em>
<p>Returns TRUE if successful, or FALSE if the array could not be
resized (normally due to lack of memory).
<p>The example code creates an array with two points (1,2) and (3,4):
<pre>    static QCOORD points[] = { 1,2, 3,4 };
    <a href="qpointarray.html">QPointArray</a> a;
    a.<a href="#76de1d">setPoints</a>( 2, points );
</pre>
<p>See also  <a href="qarray.html#bb1f76">resize</a>() and <a href="#fb573f">putPoints</a>().
<h3 class="fn">bool<a name="76de1d"></a>QPointArray::setPoints(intnPoints, intfirstx, intfirsty, ...)</h3>
<p>Resizes the array to <em>nPoints</em> and sets the points in the array to
the values taken from the variable argument list.
<p>Returns TRUE if successful, or FALSE if the array could not be
resized (typically due to lack of memory).
<p>The example code creates an array with two points (1,2) and (3,4):
<p><pre>    <a href="qpointarray.html">QPointArray</a> a;
    a.<a href="#76de1d">setPoints</a>( 2, 1,2, 3,4 );
</pre>
<p>See also  <a href="qarray.html#bb1f76">resize</a>() and <a href="#fb573f">putPoints</a>().
<h3 class="fn">void<a name="66e2e4"></a>QPointArray::translate(intdx, intdy)</h3>
<p>Translates all points in the array <em>(dx,dy).</em>
<h3 class="fn">void<a name="b09af4"></a>QPointArray::cleanBuffers() <code>[static]</code></h3>
<p>For internal use only.
<h3 class="fn">void*<a name="0dbaa7"></a>QPointArray::shortPoints(intindex=0, intnPoints=-1)const</h3>
<p>For internal use only.
<hr><h2>Related Functions</h2>
<h3><a href="qdatastream.html">QDataStream</a> &amp; <a name="da9d39"></a>operator&lt;&lt; (<a href="qdatastream.html">QDataStream</a> &amp; s, const QPointArray &amp; a)</h3>
<p>Writes a point array to the stream and returns a reference to the stream.
<p>See also  <a href="datastreamformat.html">Format of the QDataStream operators</a>

<h3><a href="qdatastream.html">QDataStream</a> &amp; <a name="e2e438"></a>operator&gt;&gt; (<a href="qdatastream.html">QDataStream</a> &amp; s, QPointArray &amp; a)</h3>
<p>Reads a point array from the stream and returns a reference to the stream.
<p>See also  <a href="datastreamformat.html">Format of the QDataStream operators</a>

<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright &copy; 1995-2001
<a href="http://www.trolltech.com">Trolltech</a>, all rights reserved.<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright  2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>