File: qvector4d.html

package info (click to toggle)
qt4-x11 4%3A4.8.2%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 701,696 kB
  • sloc: cpp: 2,686,179; ansic: 375,485; python: 25,859; sh: 19,349; xml: 17,091; perl: 14,765; yacc: 5,383; asm: 5,038; makefile: 1,259; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (363 lines) | stat: -rw-r--r-- 35,717 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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qvector4d.cpp -->
  <title>Qt 4.8: QVector4D Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QVector4D</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QVector4D Class Reference</h1>
<!-- $$$QVector4D-brief -->
<p>The QVector4D class represents a vector or vertex in 4D space. <a href="#details">More...</a></p>
<!-- @@@QVector4D -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QVector4D&gt;</span></pre><p>This class was introduced in Qt 4.6.</p>
<ul>
<li><a href="qvector4d-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#QVector4D">QVector4D</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#QVector4D-2">QVector4D</a></b> ( qreal <i>xpos</i>, qreal <i>ypos</i>, qreal <i>zpos</i>, qreal <i>wpos</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#QVector4D-3">QVector4D</a></b> ( const QPoint &amp; <i>point</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#QVector4D-4">QVector4D</a></b> ( const QPointF &amp; <i>point</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#QVector4D-5">QVector4D</a></b> ( const QVector2D &amp; <i>vector</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#QVector4D-6">QVector4D</a></b> ( const QVector2D &amp; <i>vector</i>, qreal <i>zpos</i>, qreal <i>wpos</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#QVector4D-7">QVector4D</a></b> ( const QVector3D &amp; <i>vector</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#QVector4D-8">QVector4D</a></b> ( const QVector3D &amp; <i>vector</i>, qreal <i>wpos</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#isNull">isNull</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#length">length</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#lengthSquared">lengthSquared</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#normalize">normalize</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector4D </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#normalized">normalized</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#setW">setW</a></b> ( qreal <i>w</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#setX">setX</a></b> ( qreal <i>x</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#setY">setY</a></b> ( qreal <i>y</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#setZ">setZ</a></b> ( qreal <i>z</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPoint </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#toPoint">toPoint</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#toPointF">toPointF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector2D </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#toVector2D">toVector2D</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector2D </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#toVector2DAffine">toVector2DAffine</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector3D </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#toVector3D">toVector3D</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector3D </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#toVector3DAffine">toVector3DAffine</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#w">w</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#x">x</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#y">y</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#z">z</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator-QVariant">operator QVariant</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector4D &amp; </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator-2a-eq">operator*=</a></b> ( qreal <i>factor</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector4D &amp; </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator-2a-eq-2">operator*=</a></b> ( const QVector4D &amp; <i>vector</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector4D &amp; </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator-2b-eq">operator+=</a></b> ( const QVector4D &amp; <i>vector</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector4D &amp; </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator--eq">operator-=</a></b> ( const QVector4D &amp; <i>vector</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector4D &amp; </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator-2f-eq">operator/=</a></b> ( qreal <i>divisor</i> )</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#dotProduct">dotProduct</a></b> ( const QVector4D &amp; <i>v1</i>, const QVector4D &amp; <i>v2</i> )</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#qFuzzyCompare-8">qFuzzyCompare</a></b> ( const QVector4D &amp; <i>v1</i>, const QVector4D &amp; <i>v2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator-not-eq-28">operator!=</a></b> ( const QVector4D &amp; <i>v1</i>, const QVector4D &amp; <i>v2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QVector4D </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator-2a-47">operator*</a></b> ( qreal <i>factor</i>, const QVector4D &amp; <i>vector</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QVector4D </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator-2a-48">operator*</a></b> ( const QVector4D &amp; <i>vector</i>, qreal <i>factor</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QVector4D </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator-2a-49">operator*</a></b> ( const QVector4D &amp; <i>v1</i>, const QVector4D &amp; <i>v2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QVector4D </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator-2b-16">operator+</a></b> ( const QVector4D &amp; <i>v1</i>, const QVector4D &amp; <i>v2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QVector4D </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator--14">operator-</a></b> ( const QVector4D &amp; <i>v1</i>, const QVector4D &amp; <i>v2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QVector4D </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator--19">operator-</a></b> ( const QVector4D &amp; <i>vector</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QVector4D </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator-2f-9">operator/</a></b> ( const QVector4D &amp; <i>vector</i>, qreal <i>divisor</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator-lt-lt-121">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>stream</i>, const QVector4D &amp; <i>vector</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator-eq-eq-44">operator==</a></b> ( const QVector4D &amp; <i>v1</i>, const QVector4D &amp; <i>v2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qvector4d.html#operator-gt-gt-63">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>stream</i>, QVector4D &amp; <i>vector</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QVector4D-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QVector4D class represents a vector or vertex in 4D space.</p>
<p>The QVector4D class can also be used to represent vertices in 4D space. We therefore do not need to provide a separate vertex class.</p>
<p><b>Note:</b> By design values in the QVector4D instance are stored as <tt>float</tt>. This means that on platforms where the <tt>qreal</tt> arguments to QVector4D functions are represented by <tt>double</tt> values, it is possible to lose precision.</p>
</div>
<p><b>See also </b><a href="qquaternion.html">QQuaternion</a>, <a href="qvector2d.html">QVector2D</a>, and <a href="qvector3d.html">QVector3D</a>.</p>
<!-- @@@QVector4D -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QVector4D[overload1]$$$QVector4D -->
<h3 class="fn"><a name="QVector4D"></a>QVector4D::<span class="name">QVector4D</span> ()</h3>
<p>Constructs a null vector, i.e&#x2e; with coordinates (0, 0, 0, 0).</p>
<!-- @@@QVector4D -->
<!-- $$$QVector4D$$$QVector4Dqrealqrealqrealqreal -->
<h3 class="fn"><a name="QVector4D-2"></a>QVector4D::<span class="name">QVector4D</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>xpos</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>ypos</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>zpos</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>wpos</i> )</h3>
<p>Constructs a vector with coordinates (<i>xpos</i>, <i>ypos</i>, <i>zpos</i>, <i>wpos</i>).</p>
<!-- @@@QVector4D -->
<!-- $$$QVector4D$$$QVector4DconstQPoint& -->
<h3 class="fn"><a name="QVector4D-3"></a>QVector4D::<span class="name">QVector4D</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>point</i> )</h3>
<p>Constructs a vector with x and y coordinates from a 2D <i>point</i>, and z and w coordinates of 0.</p>
<!-- @@@QVector4D -->
<!-- $$$QVector4D$$$QVector4DconstQPointF& -->
<h3 class="fn"><a name="QVector4D-4"></a>QVector4D::<span class="name">QVector4D</span> ( const <span class="type"><a href="qpointf.html">QPointF</a></span> &amp; <i>point</i> )</h3>
<p>Constructs a vector with x and y coordinates from a 2D <i>point</i>, and z and w coordinates of 0.</p>
<!-- @@@QVector4D -->
<!-- $$$QVector4D$$$QVector4DconstQVector2D& -->
<h3 class="fn"><a name="QVector4D-5"></a>QVector4D::<span class="name">QVector4D</span> ( const <span class="type"><a href="qvector2d.html">QVector2D</a></span> &amp; <i>vector</i> )</h3>
<p>Constructs a 4D vector from the specified 2D <i>vector</i>. The z and w coordinates are set to zero.</p>
<p><b>See also </b><a href="qvector4d.html#toVector2D">toVector2D</a>().</p>
<!-- @@@QVector4D -->
<!-- $$$QVector4D$$$QVector4DconstQVector2D&qrealqreal -->
<h3 class="fn"><a name="QVector4D-6"></a>QVector4D::<span class="name">QVector4D</span> ( const <span class="type"><a href="qvector2d.html">QVector2D</a></span> &amp; <i>vector</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>zpos</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>wpos</i> )</h3>
<p>Constructs a 4D vector from the specified 2D <i>vector</i>. The z and w coordinates are set to <i>zpos</i> and <i>wpos</i> respectively.</p>
<p><b>See also </b><a href="qvector4d.html#toVector2D">toVector2D</a>().</p>
<!-- @@@QVector4D -->
<!-- $$$QVector4D$$$QVector4DconstQVector3D& -->
<h3 class="fn"><a name="QVector4D-7"></a>QVector4D::<span class="name">QVector4D</span> ( const <span class="type"><a href="qvector3d.html">QVector3D</a></span> &amp; <i>vector</i> )</h3>
<p>Constructs a 4D vector from the specified 3D <i>vector</i>. The w coordinate is set to zero.</p>
<p><b>See also </b><a href="qvector4d.html#toVector3D">toVector3D</a>().</p>
<!-- @@@QVector4D -->
<!-- $$$QVector4D$$$QVector4DconstQVector3D&qreal -->
<h3 class="fn"><a name="QVector4D-8"></a>QVector4D::<span class="name">QVector4D</span> ( const <span class="type"><a href="qvector3d.html">QVector3D</a></span> &amp; <i>vector</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>wpos</i> )</h3>
<p>Constructs a 4D vector from the specified 3D <i>vector</i>. The w coordinate is set to <i>wpos</i>.</p>
<p><b>See also </b><a href="qvector4d.html#toVector3D">toVector3D</a>().</p>
<!-- @@@QVector4D -->
<!-- $$$dotProduct[overload1]$$$dotProductconstQVector4D&constQVector4D& -->
<h3 class="fn"><a name="dotProduct"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QVector4D::<span class="name">dotProduct</span> ( const <span class="type">QVector4D</span> &amp; <i>v1</i>, const <span class="type">QVector4D</span> &amp; <i>v2</i> )<tt> [static]</tt></h3>
<p>Returns the dot product of <i>v1</i> and <i>v2</i>.</p>
<!-- @@@dotProduct -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QVector4D::<span class="name">isNull</span> () const</h3>
<p>Returns true if the x, y, z, and w coordinates are set to 0.0, otherwise returns false.</p>
<!-- @@@isNull -->
<!-- $$$length[overload1]$$$length -->
<h3 class="fn"><a name="length"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QVector4D::<span class="name">length</span> () const</h3>
<p>Returns the length of the vector from the origin.</p>
<p><b>See also </b><a href="qvector4d.html#lengthSquared">lengthSquared</a>() and <a href="qvector4d.html#normalized">normalized</a>().</p>
<!-- @@@length -->
<!-- $$$lengthSquared[overload1]$$$lengthSquared -->
<h3 class="fn"><a name="lengthSquared"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QVector4D::<span class="name">lengthSquared</span> () const</h3>
<p>Returns the squared length of the vector from the origin. This is equivalent to the dot product of the vector with itself.</p>
<p><b>See also </b><a href="qvector4d.html#length">length</a>() and <a href="qvector4d.html#dotProduct">dotProduct</a>().</p>
<!-- @@@lengthSquared -->
<!-- $$$normalize[overload1]$$$normalize -->
<h3 class="fn"><a name="normalize"></a><span class="type">void</span> QVector4D::<span class="name">normalize</span> ()</h3>
<p>Normalizes the currect vector in place. Nothing happens if this vector is a null vector or the length of the vector is very close to 1.</p>
<p><b>See also </b><a href="qvector4d.html#length">length</a>() and <a href="qvector4d.html#normalized">normalized</a>().</p>
<!-- @@@normalize -->
<!-- $$$normalized[overload1]$$$normalized -->
<h3 class="fn"><a name="normalized"></a><span class="type">QVector4D</span> QVector4D::<span class="name">normalized</span> () const</h3>
<p>Returns the normalized unit vector form of this vector.</p>
<p>If this vector is null, then a null vector is returned. If the length of the vector is very close to 1, then the vector will be returned as-is. Otherwise the normalized form of the vector of length 1 will be returned.</p>
<p><b>See also </b><a href="qvector4d.html#length">length</a>() and <a href="qvector4d.html#normalize">normalize</a>().</p>
<!-- @@@normalized -->
<!-- $$$setW[overload1]$$$setWqreal -->
<h3 class="fn"><a name="setW"></a><span class="type">void</span> QVector4D::<span class="name">setW</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i> )</h3>
<p>Sets the w coordinate of this point to the given <i>w</i> coordinate.</p>
<p><b>See also </b><a href="qvector4d.html#w">w</a>(), <a href="qvector4d.html#setX">setX</a>(), <a href="qvector4d.html#setY">setY</a>(), and <a href="qvector4d.html#setZ">setZ</a>().</p>
<!-- @@@setW -->
<!-- $$$setX[overload1]$$$setXqreal -->
<h3 class="fn"><a name="setX"></a><span class="type">void</span> QVector4D::<span class="name">setX</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i> )</h3>
<p>Sets the x coordinate of this point to the given <i>x</i> coordinate.</p>
<p><b>See also </b><a href="qvector4d.html#x">x</a>(), <a href="qvector4d.html#setY">setY</a>(), <a href="qvector4d.html#setZ">setZ</a>(), and <a href="qvector4d.html#setW">setW</a>().</p>
<!-- @@@setX -->
<!-- $$$setY[overload1]$$$setYqreal -->
<h3 class="fn"><a name="setY"></a><span class="type">void</span> QVector4D::<span class="name">setY</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i> )</h3>
<p>Sets the y coordinate of this point to the given <i>y</i> coordinate.</p>
<p><b>See also </b><a href="qvector4d.html#y">y</a>(), <a href="qvector4d.html#setX">setX</a>(), <a href="qvector4d.html#setZ">setZ</a>(), and <a href="qvector4d.html#setW">setW</a>().</p>
<!-- @@@setY -->
<!-- $$$setZ[overload1]$$$setZqreal -->
<h3 class="fn"><a name="setZ"></a><span class="type">void</span> QVector4D::<span class="name">setZ</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>z</i> )</h3>
<p>Sets the z coordinate of this point to the given <i>z</i> coordinate.</p>
<p><b>See also </b><a href="qvector4d.html#z">z</a>(), <a href="qvector4d.html#setX">setX</a>(), <a href="qvector4d.html#setY">setY</a>(), and <a href="qvector4d.html#setW">setW</a>().</p>
<!-- @@@setZ -->
<!-- $$$toPoint[overload1]$$$toPoint -->
<h3 class="fn"><a name="toPoint"></a><span class="type"><a href="qpoint.html">QPoint</a></span> QVector4D::<span class="name">toPoint</span> () const</h3>
<p>Returns the <a href="qpoint.html">QPoint</a> form of this 4D vector. The z and w coordinates are dropped.</p>
<p><b>See also </b><a href="qvector4d.html#toPointF">toPointF</a>() and <a href="qvector4d.html#toVector2D">toVector2D</a>().</p>
<!-- @@@toPoint -->
<!-- $$$toPointF[overload1]$$$toPointF -->
<h3 class="fn"><a name="toPointF"></a><span class="type"><a href="qpointf.html">QPointF</a></span> QVector4D::<span class="name">toPointF</span> () const</h3>
<p>Returns the <a href="qpointf.html">QPointF</a> form of this 4D vector. The z and w coordinates are dropped.</p>
<p><b>See also </b><a href="qvector4d.html#toPoint">toPoint</a>() and <a href="qvector4d.html#toVector2D">toVector2D</a>().</p>
<!-- @@@toPointF -->
<!-- $$$toVector2D[overload1]$$$toVector2D -->
<h3 class="fn"><a name="toVector2D"></a><span class="type"><a href="qvector2d.html">QVector2D</a></span> QVector4D::<span class="name">toVector2D</span> () const</h3>
<p>Returns the 2D vector form of this 4D vector, dropping the z and w coordinates.</p>
<p><b>See also </b><a href="qvector4d.html#toVector2DAffine">toVector2DAffine</a>(), <a href="qvector4d.html#toVector3D">toVector3D</a>(), and <a href="qvector4d.html#toPoint">toPoint</a>().</p>
<!-- @@@toVector2D -->
<!-- $$$toVector2DAffine[overload1]$$$toVector2DAffine -->
<h3 class="fn"><a name="toVector2DAffine"></a><span class="type"><a href="qvector2d.html">QVector2D</a></span> QVector4D::<span class="name">toVector2DAffine</span> () const</h3>
<p>Returns the 2D vector form of this 4D vector, dividing the x and y coordinates by the w coordinate and dropping the z coordinate. Returns a null vector if w is zero.</p>
<p><b>See also </b><a href="qvector4d.html#toVector2D">toVector2D</a>(), <a href="qvector4d.html#toVector3DAffine">toVector3DAffine</a>(), and <a href="qvector4d.html#toPoint">toPoint</a>().</p>
<!-- @@@toVector2DAffine -->
<!-- $$$toVector3D[overload1]$$$toVector3D -->
<h3 class="fn"><a name="toVector3D"></a><span class="type"><a href="qvector3d.html">QVector3D</a></span> QVector4D::<span class="name">toVector3D</span> () const</h3>
<p>Returns the 3D vector form of this 4D vector, dropping the w coordinate.</p>
<p><b>See also </b><a href="qvector4d.html#toVector3DAffine">toVector3DAffine</a>(), <a href="qvector4d.html#toVector2D">toVector2D</a>(), and <a href="qvector4d.html#toPoint">toPoint</a>().</p>
<!-- @@@toVector3D -->
<!-- $$$toVector3DAffine[overload1]$$$toVector3DAffine -->
<h3 class="fn"><a name="toVector3DAffine"></a><span class="type"><a href="qvector3d.html">QVector3D</a></span> QVector4D::<span class="name">toVector3DAffine</span> () const</h3>
<p>Returns the 3D vector form of this 4D vector, dividing the x, y, and z coordinates by the w coordinate. Returns a null vector if w is zero.</p>
<p><b>See also </b><a href="qvector4d.html#toVector3D">toVector3D</a>(), <a href="qvector4d.html#toVector2DAffine">toVector2DAffine</a>(), and <a href="qvector4d.html#toPoint">toPoint</a>().</p>
<!-- @@@toVector3DAffine -->
<!-- $$$w[overload1]$$$w -->
<h3 class="fn"><a name="w"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QVector4D::<span class="name">w</span> () const</h3>
<p>Returns the w coordinate of this point.</p>
<p><b>See also </b><a href="qvector4d.html#setW">setW</a>(), <a href="qvector4d.html#x">x</a>(), <a href="qvector4d.html#y">y</a>(), and <a href="qvector4d.html#z">z</a>().</p>
<!-- @@@w -->
<!-- $$$x[overload1]$$$x -->
<h3 class="fn"><a name="x"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QVector4D::<span class="name">x</span> () const</h3>
<p>Returns the x coordinate of this point.</p>
<p><b>See also </b><a href="qvector4d.html#setX">setX</a>(), <a href="qvector4d.html#y">y</a>(), <a href="qvector4d.html#z">z</a>(), and <a href="qvector4d.html#w">w</a>().</p>
<!-- @@@x -->
<!-- $$$y[overload1]$$$y -->
<h3 class="fn"><a name="y"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QVector4D::<span class="name">y</span> () const</h3>
<p>Returns the y coordinate of this point.</p>
<p><b>See also </b><a href="qvector4d.html#setY">setY</a>(), <a href="qvector4d.html#x">x</a>(), <a href="qvector4d.html#z">z</a>(), and <a href="qvector4d.html#w">w</a>().</p>
<!-- @@@y -->
<!-- $$$z[overload1]$$$z -->
<h3 class="fn"><a name="z"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QVector4D::<span class="name">z</span> () const</h3>
<p>Returns the z coordinate of this point.</p>
<p><b>See also </b><a href="qvector4d.html#setZ">setZ</a>(), <a href="qvector4d.html#x">x</a>(), <a href="qvector4d.html#y">y</a>(), and <a href="qvector4d.html#w">w</a>().</p>
<!-- @@@z -->
<!-- $$$operator QVariant[overload1]$$$operator QVariant -->
<h3 class="fn"><a name="operator-QVariant"></a>QVector4D::<span class="name">operator QVariant</span> () const</h3>
<p>Returns the 4D vector as a <a href="qvariant.html">QVariant</a>.</p>
<!-- @@@operator QVariant -->
<!-- $$$operator*=[overload1]$$$operator*=qreal -->
<h3 class="fn"><a name="operator-2a-eq"></a><span class="type">QVector4D</span> &amp; QVector4D::<span class="name">operator*=</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>factor</i> )</h3>
<p>Multiplies this vector's coordinates by the given <i>factor</i>, and returns a reference to this vector.</p>
<p><b>See also </b><a href="qvector4d.html#operator-2f-eq">operator/=</a>().</p>
<!-- @@@operator*= -->
<!-- $$$operator*=$$$operator*=constQVector4D& -->
<h3 class="fn"><a name="operator-2a-eq-2"></a><span class="type">QVector4D</span> &amp; QVector4D::<span class="name">operator*=</span> ( const <span class="type">QVector4D</span> &amp; <i>vector</i> )</h3>
<p>Multiplies the components of this vector by the corresponding components in <i>vector</i>.</p>
<!-- @@@operator*= -->
<!-- $$$operator+=[overload1]$$$operator+=constQVector4D& -->
<h3 class="fn"><a name="operator-2b-eq"></a><span class="type">QVector4D</span> &amp; QVector4D::<span class="name">operator+=</span> ( const <span class="type">QVector4D</span> &amp; <i>vector</i> )</h3>
<p>Adds the given <i>vector</i> to this vector and returns a reference to this vector.</p>
<p><b>See also </b><a href="qvector4d.html#operator--eq">operator-=</a>().</p>
<!-- @@@operator+= -->
<!-- $$$operator-=[overload1]$$$operator-=constQVector4D& -->
<h3 class="fn"><a name="operator--eq"></a><span class="type">QVector4D</span> &amp; QVector4D::<span class="name">operator-=</span> ( const <span class="type">QVector4D</span> &amp; <i>vector</i> )</h3>
<p>Subtracts the given <i>vector</i> from this vector and returns a reference to this vector.</p>
<p><b>See also </b><a href="qvector4d.html#operator-2b-eq">operator+=</a>().</p>
<!-- @@@operator-= -->
<!-- $$$operator/=[overload1]$$$operator/=qreal -->
<h3 class="fn"><a name="operator-2f-eq"></a><span class="type">QVector4D</span> &amp; QVector4D::<span class="name">operator/=</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>divisor</i> )</h3>
<p>Divides this vector's coordinates by the given <i>divisor</i>, and returns a reference to this vector.</p>
<p><b>See also </b><a href="qvector4d.html#operator-2a-eq">operator*=</a>().</p>
<!-- @@@operator/= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$qFuzzyCompare$$$qFuzzyCompareconstQVector4D&constQVector4D& -->
<h3 class="fn"><a name="qFuzzyCompare-8"></a><span class="type">bool</span> <span class="name">qFuzzyCompare</span> ( const <span class="type">QVector4D</span> &amp; <i>v1</i>, const <span class="type">QVector4D</span> &amp; <i>v2</i> )</h3>
<p>Returns true if <i>v1</i> and <i>v2</i> are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise.</p>
<!-- @@@qFuzzyCompare -->
<!-- $$$operator!=$$$operator!=constQVector4D&constQVector4D& -->
<h3 class="fn"><a name="operator-not-eq-28"></a><span class="type">bool</span> <span class="name">operator!=</span> ( const <span class="type">QVector4D</span> &amp; <i>v1</i>, const <span class="type">QVector4D</span> &amp; <i>v2</i> )</h3>
<p>Returns true if <i>v1</i> is not equal to <i>v2</i>; otherwise returns false. This operator uses an exact floating-point comparison.</p>
<!-- @@@operator!= -->
<!-- $$$operator*$$$operator*qrealconstQVector4D& -->
<h3 class="fn"><a name="operator-2a-47"></a>const <span class="type">QVector4D</span> <span class="name">operator*</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>factor</i>, const <span class="type">QVector4D</span> &amp; <i>vector</i> )</h3>
<p>Returns a copy of the given <i>vector</i>, multiplied by the given <i>factor</i>.</p>
<p><b>See also </b><a href="qvector4d.html#operator-2a-eq">QVector4D::operator*=</a>().</p>
<!-- @@@operator* -->
<!-- $$$operator*$$$operator*constQVector4D&qreal -->
<h3 class="fn"><a name="operator-2a-48"></a>const <span class="type">QVector4D</span> <span class="name">operator*</span> ( const <span class="type">QVector4D</span> &amp; <i>vector</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>factor</i> )</h3>
<p>Returns a copy of the given <i>vector</i>, multiplied by the given <i>factor</i>.</p>
<p><b>See also </b><a href="qvector4d.html#operator-2a-eq">QVector4D::operator*=</a>().</p>
<!-- @@@operator* -->
<!-- $$$operator*$$$operator*constQVector4D&constQVector4D& -->
<h3 class="fn"><a name="operator-2a-49"></a>const <span class="type">QVector4D</span> <span class="name">operator*</span> ( const <span class="type">QVector4D</span> &amp; <i>v1</i>, const <span class="type">QVector4D</span> &amp; <i>v2</i> )</h3>
<p>Returns the vector consisting of the multiplication of the components from <i>v1</i> and <i>v2</i>.</p>
<p><b>See also </b><a href="qvector4d.html#operator-2a-eq">QVector4D::operator*=</a>().</p>
<!-- @@@operator* -->
<!-- $$$operator+$$$operator+constQVector4D&constQVector4D& -->
<h3 class="fn"><a name="operator-2b-16"></a>const <span class="type">QVector4D</span> <span class="name">operator+</span> ( const <span class="type">QVector4D</span> &amp; <i>v1</i>, const <span class="type">QVector4D</span> &amp; <i>v2</i> )</h3>
<p>Returns a <a href="qvector4d.html">QVector4D</a> object that is the sum of the given vectors, <i>v1</i> and <i>v2</i>; each component is added separately.</p>
<p><b>See also </b><a href="qvector4d.html#operator-2b-eq">QVector4D::operator+=</a>().</p>
<!-- @@@operator+ -->
<!-- $$$operator-$$$operator-constQVector4D&constQVector4D& -->
<h3 class="fn"><a name="operator--14"></a>const <span class="type">QVector4D</span> <span class="name">operator-</span> ( const <span class="type">QVector4D</span> &amp; <i>v1</i>, const <span class="type">QVector4D</span> &amp; <i>v2</i> )</h3>
<p>Returns a <a href="qvector4d.html">QVector4D</a> object that is formed by subtracting <i>v2</i> from <i>v1</i>; each component is subtracted separately.</p>
<p><b>See also </b><a href="qvector4d.html#operator--eq">QVector4D::operator-=</a>().</p>
<!-- @@@operator- -->
<!-- $$$operator-$$$operator-constQVector4D& -->
<h3 class="fn"><a name="operator--19"></a>const <span class="type">QVector4D</span> <span class="name">operator-</span> ( const <span class="type">QVector4D</span> &amp; <i>vector</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns a <a href="qvector4d.html">QVector4D</a> object that is formed by changing the sign of all three components of the given <i>vector</i>.</p>
<p>Equivalent to <tt>QVector4D(0,0,0,0) - vector</tt>.</p>
<!-- @@@operator- -->
<!-- $$$operator/$$$operator/constQVector4D&qreal -->
<h3 class="fn"><a name="operator-2f-9"></a>const <span class="type">QVector4D</span> <span class="name">operator/</span> ( const <span class="type">QVector4D</span> &amp; <i>vector</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>divisor</i> )</h3>
<p>Returns the <a href="qvector4d.html">QVector4D</a> object formed by dividing all four components of the given <i>vector</i> by the given <i>divisor</i>.</p>
<p><b>See also </b><a href="qvector4d.html#operator-2f-eq">QVector4D::operator/=</a>().</p>
<!-- @@@operator/ -->
<!-- $$$operator<<$$$operator<<QDataStream&constQVector4D& -->
<h3 class="fn"><a name="operator-lt-lt-121"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&lt;&lt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>stream</i>, const <span class="type">QVector4D</span> &amp; <i>vector</i> )</h3>
<p>Writes the given <i>vector</i> to the given <i>stream</i> and returns a reference to the stream.</p>
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator==$$$operator==constQVector4D&constQVector4D& -->
<h3 class="fn"><a name="operator-eq-eq-44"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type">QVector4D</span> &amp; <i>v1</i>, const <span class="type">QVector4D</span> &amp; <i>v2</i> )</h3>
<p>Returns true if <i>v1</i> is equal to <i>v2</i>; otherwise returns false. This operator uses an exact floating-point comparison.</p>
<!-- @@@operator== -->
<!-- $$$operator>>$$$operator>>QDataStream&QVector4D& -->
<h3 class="fn"><a name="operator-gt-gt-63"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>stream</i>, <span class="type">QVector4D</span> &amp; <i>vector</i> )</h3>
<p>Reads a 4D vector from the given <i>stream</i> into the given <i>vector</i> and returns a reference to the stream.</p>
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator>> -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2012 Nokia Corporation and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>