58 #ifndef QT_NO_VECTOR4D
64 QVector4D(qreal xpos, qreal ypos, qreal zpos, qreal wpos);
67 #ifndef QT_NO_VECTOR2D
69 QVector4D(
const QVector2D& vector, qreal zpos, qreal wpos);
71 #ifndef QT_NO_VECTOR3D
73 QVector4D(
const QVector3D& vector, qreal wpos);
89 qreal lengthSquared()
const;
114 #ifndef QT_NO_VECTOR2D
115 QVector2D toVector2D()
const;
116 QVector2D toVector2DAffine()
const;
118 #ifndef QT_NO_VECTOR3D
119 QVector3D toVector3D()
const;
120 QVector3D toVector3DAffine()
const;
129 float xp, yp, zp, wp;
131 QVector4D(
float xpos,
float ypos,
float zpos,
float wpos,
int dummy);
133 friend class QVector2D;
134 friend class QVector3D;
135 #ifndef QT_NO_MATRIX4X4
145 inline QVector4D::QVector4D(qreal xpos, qreal ypos, qreal zpos, qreal wpos) : xp(xpos), yp(ypos), zp(zpos), wp(wpos) {}
147 inline QVector4D::QVector4D(
float xpos,
float ypos,
float zpos,
float wpos,
int) : xp(xpos), yp(ypos), zp(zpos), wp(wpos) {}
155 return qIsNull(xp) && qIsNull(yp) && qIsNull(zp) && qIsNull(wp);
215 return v1.xp == v2.xp && v1.yp == v2.yp && v1.zp == v2.zp && v1.wp == v2.wp;
220 return v1.xp != v2.xp || v1.yp != v2.yp || v1.zp != v2.zp || v1.wp != v2.wp;
225 return QVector4D(v1.xp + v2.xp, v1.yp + v2.yp, v1.zp + v2.zp, v1.wp + v2.wp, 1);
230 return QVector4D(v1.xp - v2.xp, v1.yp - v2.yp, v1.zp - v2.zp, v1.wp - v2.wp, 1);
235 return QVector4D(vector.xp * factor, vector.yp * factor, vector.zp * factor, vector.wp * factor, 1);
240 return QVector4D(vector.xp * factor, vector.yp * factor, vector.zp * factor, vector.wp * factor, 1);
245 return QVector4D(v1.xp * v2.xp, v1.yp * v2.yp, v1.zp * v2.zp, v1.wp * v2.wp, 1);
250 return QVector4D(-vector.xp, -vector.yp, -vector.zp, -vector.wp, 1);
255 return QVector4D(vector.xp / divisor, vector.yp / divisor, vector.zp / divisor, vector.wp / divisor, 1);
268 return QPoint(qRound(xp), qRound(yp));
273 return QPointF(qreal(xp), qreal(yp));
276 #ifndef QT_NO_DEBUG_STREAM
280 #ifndef QT_NO_DATASTREAM
Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QVector4D &vector)
QVector4D & operator-=(const QVector4D &vector)
Q_DECLARE_TYPEINFO(QVector4D, Q_MOVABLE_TYPE)
QByteArray & operator+=(QByteArray &a, const QStringBuilder< A, B > &b)
GLfloat GLfloat GLfloat v2
const QVector4D operator+(const QVector4D &v1, const QVector4D &v2)
bool qFuzzyCompare(const QVector4D &v1, const QVector4D &v2)
Q_GUI_EXPORT QDataStream & operator>>(QDataStream &, QVector4D &)
const QVector4D operator/(const QVector4D &vector, qreal divisor)
#define QT_BEGIN_NAMESPACE
bool operator!=(const QVector4D &v1, const QVector4D &v2)
GLuint GLsizei GLsizei * length
const QVector4D operator-(const QVector4D &v1, const QVector4D &v2)
bool operator==(const QVector4D &v1, const QVector4D &v2)
QVector4D & operator*=(qreal factor)
QVector4D & operator+=(const QVector4D &vector)
GLint GLenum GLboolean normalized
QVector4D & operator/=(qreal divisor)
GLubyte GLubyte GLubyte GLubyte w
GLXDrawable int64_t int64_t divisor
const QVector4D operator*(qreal factor, const QVector4D &vector)