Qt 4.8
Classes | Functions
qvector3d.h File Reference
#include <QtCore/qpoint.h>
#include <QtCore/qmetatype.h>

Go to the source code of this file.

Classes

class  QVector3D
 The QVector3D class represents a vector or vertex in 3D space. More...
 

Functions

bool operator!= (const QVector3D &v1, const QVector3D &v2)
 
const QVector3D operator* (qreal factor, const QVector3D &vector)
 
const QVector3D operator* (const QVector3D &vector, qreal factor)
 
const QVector3D operator* (const QVector3D &v1, const QVector3D &v2)
 
const QVector3D operator+ (const QVector3D &v1, const QVector3D &v2)
 
const QVector3D operator- (const QVector3D &v1, const QVector3D &v2)
 
const QVector3D operator- (const QVector3D &vector)
 
const QVector3D operator/ (const QVector3D &vector, qreal divisor)
 
Q_GUI_EXPORT QDebug operator<< (QDebug dbg, const QVector3D &vector)
 
Q_GUI_EXPORT QDataStreamoperator<< (QDataStream &, const QVector3D &)
 
bool operator== (const QVector3D &v1, const QVector3D &v2)
 
Q_GUI_EXPORT QDataStreamoperator>> (QDataStream &, QVector3D &)
 
 Q_DECLARE_TYPEINFO (QVector3D, Q_MOVABLE_TYPE)
 
bool qFuzzyCompare (const QVector3D &v1, const QVector3D &v2)
 

Function Documentation

◆ operator!=()

bool operator!= ( const QVector3D v1,
const QVector3D v2 
)
inline

Definition at line 214 of file qvector3d.h.

215 {
216  return v1.xp != v2.xp || v1.yp != v2.yp || v1.zp != v2.zp;
217 }
float zp
Definition: qvector3d.h:132
float yp
Definition: qvector3d.h:132
float xp
Definition: qvector3d.h:132

◆ operator*() [1/3]

const QVector3D operator* ( qreal  factor,
const QVector3D vector 
)
inline

Definition at line 229 of file qvector3d.h.

230 {
231  return QVector3D(vector.xp * factor, vector.yp * factor, vector.zp * factor, 1);
232 }
The QVector3D class represents a vector or vertex in 3D space.
Definition: qvector3d.h:60
float zp
Definition: qvector3d.h:132
float yp
Definition: qvector3d.h:132
float xp
Definition: qvector3d.h:132

◆ operator*() [2/3]

const QVector3D operator* ( const QVector3D vector,
qreal  factor 
)
inline

Definition at line 234 of file qvector3d.h.

235 {
236  return QVector3D(vector.xp * factor, vector.yp * factor, vector.zp * factor, 1);
237 }
The QVector3D class represents a vector or vertex in 3D space.
Definition: qvector3d.h:60
float zp
Definition: qvector3d.h:132
float yp
Definition: qvector3d.h:132
float xp
Definition: qvector3d.h:132

◆ operator*() [3/3]

const QVector3D operator* ( const QVector3D v1,
const QVector3D v2 
)
inline

Definition at line 239 of file qvector3d.h.

240 {
241  return QVector3D(v1.xp * v2.xp, v1.yp * v2.yp, v1.zp * v2.zp, 1);
242 }
The QVector3D class represents a vector or vertex in 3D space.
Definition: qvector3d.h:60
float zp
Definition: qvector3d.h:132
float yp
Definition: qvector3d.h:132
float xp
Definition: qvector3d.h:132

◆ operator+()

const QVector3D operator+ ( const QVector3D v1,
const QVector3D v2 
)
inline

Definition at line 219 of file qvector3d.h.

220 {
221  return QVector3D(v1.xp + v2.xp, v1.yp + v2.yp, v1.zp + v2.zp, 1);
222 }
The QVector3D class represents a vector or vertex in 3D space.
Definition: qvector3d.h:60
float zp
Definition: qvector3d.h:132
float yp
Definition: qvector3d.h:132
float xp
Definition: qvector3d.h:132

◆ operator-() [1/2]

const QVector3D operator- ( const QVector3D v1,
const QVector3D v2 
)
inline

Definition at line 224 of file qvector3d.h.

225 {
226  return QVector3D(v1.xp - v2.xp, v1.yp - v2.yp, v1.zp - v2.zp, 1);
227 }
The QVector3D class represents a vector or vertex in 3D space.
Definition: qvector3d.h:60
float zp
Definition: qvector3d.h:132
float yp
Definition: qvector3d.h:132
float xp
Definition: qvector3d.h:132

◆ operator-() [2/2]

const QVector3D operator- ( const QVector3D vector)
inline

Definition at line 244 of file qvector3d.h.

245 {
246  return QVector3D(-vector.xp, -vector.yp, -vector.zp, 1);
247 }
The QVector3D class represents a vector or vertex in 3D space.
Definition: qvector3d.h:60
float zp
Definition: qvector3d.h:132
float yp
Definition: qvector3d.h:132
float xp
Definition: qvector3d.h:132

◆ operator/()

const QVector3D operator/ ( const QVector3D vector,
qreal  divisor 
)
inline

Definition at line 249 of file qvector3d.h.

250 {
251  return QVector3D(vector.xp / divisor, vector.yp / divisor, vector.zp / divisor, 1);
252 }
The QVector3D class represents a vector or vertex in 3D space.
Definition: qvector3d.h:60
float zp
Definition: qvector3d.h:132
float yp
Definition: qvector3d.h:132
float xp
Definition: qvector3d.h:132

◆ operator<<() [1/2]

Q_GUI_EXPORT QDebug operator<< ( QDebug  dbg,
const QVector3D vector 
)

Definition at line 650 of file qvector3d.cpp.

651 {
652  dbg.nospace() << "QVector3D("
653  << vector.x() << ", " << vector.y() << ", " << vector.z() << ')';
654  return dbg.space();
655 }
QDebug & nospace()
Clears the stream&#39;s internal flag that records whether the last character was a space and returns a r...
Definition: qdebug.h:92
qreal x() const
Returns the x coordinate of this point.
Definition: qvector3d.h:161
qreal z() const
Returns the z coordinate of this point.
Definition: qvector3d.h:163
qreal y() const
Returns the y coordinate of this point.
Definition: qvector3d.h:162
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
Definition: qdebug.h:91

◆ operator<<() [2/2]

Q_GUI_EXPORT QDataStream& operator<< ( QDataStream ,
const QVector3D  
)
related

Definition at line 674 of file qvector3d.cpp.

675 {
676  stream << double(vector.x()) << double(vector.y())
677  << double(vector.z());
678  return stream;
679 }
static FILE * stream

◆ operator==()

bool operator== ( const QVector3D v1,
const QVector3D v2 
)
inline

Definition at line 209 of file qvector3d.h.

210 {
211  return v1.xp == v2.xp && v1.yp == v2.yp && v1.zp == v2.zp;
212 }
float zp
Definition: qvector3d.h:132
float yp
Definition: qvector3d.h:132
float xp
Definition: qvector3d.h:132

◆ operator>>()

Q_GUI_EXPORT QDataStream& operator>> ( QDataStream ,
QVector3D  
)
related

Definition at line 694 of file qvector3d.cpp.

695 {
696  double x, y, z;
697  stream >> x;
698  stream >> y;
699  stream >> z;
700  vector.setX(qreal(x));
701  vector.setY(qreal(y));
702  vector.setZ(qreal(z));
703  return stream;
704 }
double qreal
Definition: qglobal.h:1193
static FILE * stream

◆ Q_DECLARE_TYPEINFO()

Q_DECLARE_TYPEINFO ( QVector3D  ,
Q_MOVABLE_TYPE   
)

◆ qFuzzyCompare()

bool qFuzzyCompare ( const QVector3D v1,
const QVector3D v2 
)
inline

Definition at line 254 of file qvector3d.h.

255 {
256  return qFuzzyCompare(v1.xp, v2.xp) &&
257  qFuzzyCompare(v1.yp, v2.yp) &&
258  qFuzzyCompare(v1.zp, v2.zp);
259 }
float zp
Definition: qvector3d.h:132
float yp
Definition: qvector3d.h:132
float xp
Definition: qvector3d.h:132
bool qFuzzyCompare(const QMatrix &m1, const QMatrix &m2)
The qFuzzyCompare function is for comparing two matrices using a fuzziness factor.
Definition: qmatrix.h:172