45 #include <QtCore/qpoint.h> 46 #include <QtCore/qmetatype.h> 58 #ifndef QT_NO_VECTOR4D 67 #ifndef QT_NO_VECTOR2D 71 #ifndef QT_NO_VECTOR3D 89 qreal lengthSquared()
const;
114 #ifndef QT_NO_VECTOR2D 118 #ifndef QT_NO_VECTOR3D 129 float xp, yp,
zp, wp;
131 QVector4D(
float xpos,
float ypos,
float zpos,
float wpos,
int dummy);
135 #ifndef QT_NO_MATRIX4X4 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;
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);
255 return QVector4D(vector.
xp / divisor, vector.
yp / divisor, vector.
zp / divisor, vector.
wp / divisor, 1);
276 #ifndef QT_NO_DEBUG_STREAM 280 #ifndef QT_NO_DATASTREAM The QVariant class acts like a union for the most common Qt data types.
The QDebug class provides an output stream for debugging information.
friend const QVector4D operator-(const QVector4D &v1, const QVector4D &v2)
Returns a QVector4D object that is formed by subtracting v2 from v1; each component is subtracted sep...
The QVector3D class represents a vector or vertex in 3D space.
#define QT_END_NAMESPACE
This macro expands to.
Q_DECLARE_TYPEINFO(QVector4D, Q_MOVABLE_TYPE)
bool isNull() const
Returns true if the x, y, z, and w coordinates are set to 0.
qreal w() const
Returns the w coordinate of this point.
The QVector4D class represents a vector or vertex in 4D space.
The QPointF class defines a point in the plane using floating point precision.
const QVector4D operator+(const QVector4D &v1, const QVector4D &v2)
static bool qIsNull(double d)
bool qFuzzyCompare(const QVector4D &v1, const QVector4D &v2)
const QVector4D operator/(const QVector4D &vector, qreal divisor)
QPointF toPointF() const
Returns the QPointF form of this 4D vector.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QPoint toPoint() const
Returns the QPoint form of this 4D vector.
qreal x() const
Returns the x coordinate of this point.
void setZ(qreal z)
Sets the z coordinate of this point to the given z coordinate.
QDataStream & operator<<(QDataStream &stream, const QVector4D &vector)
Writes the given vector to the given stream and returns a reference to the stream.
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
QVector4D & operator+=(const QVector4D &vector)
Adds the given vector to this vector and returns a reference to this vector.
The QVector2D class represents a vector or vertex in 2D space.
bool operator!=(const QVector4D &v1, const QVector4D &v2)
friend bool operator==(const QVector4D &v1, const QVector4D &v2)
Returns true if v1 is equal to v2; otherwise returns false.
QVector4D()
Constructs a null vector, i.
friend const QVector4D operator*(qreal factor, const QVector4D &vector)
friend const QVector4D operator+(const QVector4D &v1, const QVector4D &v2)
Returns a QVector4D object that is the sum of the given vectors, v1 and v2; each component is added s...
friend bool operator!=(const QVector4D &v1, const QVector4D &v2)
Returns true if v1 is not equal to v2; otherwise returns false.
const QVector4D operator-(const QVector4D &v1, const QVector4D &v2)
void setW(qreal w)
Sets the w coordinate of this point to the given w coordinate.
bool operator==(const QVector4D &v1, const QVector4D &v2)
friend bool qFuzzyCompare(const QVector4D &v1, const QVector4D &v2)
Returns true if v1 and v2 are equal, allowing for a small fuzziness factor for floating-point compari...
void setX(qreal x)
Sets the x coordinate of this point to the given x coordinate.
The QPoint class defines a point in the plane using integer precision.
QVector4D & operator*=(qreal factor)
Multiplies this vector's coordinates by the given factor, and returns a reference to this vector...
QVector4D & operator-=(const QVector4D &vector)
Subtracts the given vector from this vector and returns a reference to this vector.
The QDataStream class provides serialization of binary data to a QIODevice.
QVector4D & operator/=(qreal divisor)
Divides this vector's coordinates by the given divisor, and returns a reference to this vector...
const QVector4D operator*(qreal factor, const QVector4D &vector)
void setY(qreal y)
Sets the y coordinate of this point to the given y coordinate.
timeval & operator+=(timeval &t1, const timeval &t2)
QDataStream & operator>>(QDataStream &stream, QVector4D &vector)
Reads a 4D vector from the given stream into the given vector and returns a reference to the stream...
qreal z() const
Returns the z coordinate of this point.
static void normalize(double &x, double &y)
qreal y() const
Returns the y coordinate of this point.
Q_DECL_CONSTEXPR int qRound(qreal d)
static bool isNull(const QVariant::Private *d)
friend const QVector4D operator/(const QVector4D &vector, qreal divisor)
Returns the QVector4D object formed by dividing all four components of the given vector by the given ...