45 #include <QtCore/qmath.h> 46 #include <QtCore/qvariant.h> 47 #include <QtCore/qdebug.h> 51 #ifndef QT_NO_VECTOR3D 115 #ifndef QT_NO_VECTOR2D 145 #ifndef QT_NO_VECTOR4D 250 double len = double(
xp) * double(
xp) +
251 double(
yp) * double(
yp) +
252 double(
zp) * double(
zp);
256 return *
this /
qSqrt(len);
270 double len = double(
xp) * double(
xp) +
271 double(
yp) * double(
yp) +
272 double(
zp) * double(
zp);
447 return (*
this - point).length();
449 return (*
this - p).length();
567 #ifndef QT_NO_VECTOR2D 581 #ifndef QT_NO_VECTOR4D 648 #ifndef QT_NO_DEBUG_STREAM 653 << vector.
x() <<
", " << vector.
y() <<
", " << vector.
z() <<
')';
659 #ifndef QT_NO_DATASTREAM 676 stream << double(vector.
x()) <<
double(vector.
y())
677 <<
double(vector.
z());
706 #endif // QT_NO_DATASTREAM 708 #endif // QT_NO_VECTOR3D The QVariant class acts like a union for the most common Qt data types.
The QDebug class provides an output stream for debugging information.
qreal distanceToPlane(const QVector3D &plane, const QVector3D &normal) const
Returns the distance from this vertex to a plane defined by the vertex plane and a normal unit vector...
static QVector3D normal(const QVector3D &v1, const QVector3D &v2)
Returns the normal vector of a plane defined by vectors v1 and v2, normalized to be a unit vector...
static qreal dotProduct(const QVector3D &v1, const QVector3D &v2)
Returns the dot product of v1 and v2.
The QVector3D class represents a vector or vertex in 3D space.
#define QT_END_NAMESPACE
This macro expands to.
QDebug & nospace()
Clears the stream's internal flag that records whether the last character was a space and returns a r...
QVector4D toVector4D() const
Returns the 4D form of this 3D vector, with the w coordinate set to zero.
The QVector4D class represents a vector or vertex in 4D space.
QVector3D()
Constructs a null vector, i.
qreal x() const
Returns the x coordinate of this point.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QDataStream & operator>>(QDataStream &stream, QVector3D &vector)
Reads a 3D vector from the given stream into the given vector and returns a reference to the stream...
void setX(qreal x)
Sets the x coordinate of this point to the given x coordinate.
QVector3D normalized() const
Returns the normalized unit vector form of this vector.
The QVector2D class represents a vector or vertex in 2D space.
QDataStream & operator<<(QDataStream &stream, const QVector3D &vector)
Writes the given vector to the given stream and returns a reference to the stream.
qreal z() const
Returns the z coordinate of this point.
QVector2D toVector2D() const
Returns the 2D vector form of this 3D vector, dropping the z coordinate.
qreal length() const
Returns the length of the vector from the origin.
void normalize()
Normalizes the currect vector in place.
bool isNull() const
Returns true if the x, y, and z coordinates are set to 0.
void setZ(qreal z)
Sets the z coordinate of this point to the given z coordinate.
qreal distanceToLine(const QVector3D &point, const QVector3D &direction) const
Returns the distance that this vertex is from a line defined by point and the unit vector direction...
qreal y() const
Returns the y coordinate of this point.
qreal lengthSquared() const
Returns the squared length of the vector from the origin.
static Q_DECL_CONSTEXPR bool qFuzzyIsNull(double d)
The QDataStream class provides serialization of binary data to a QIODevice.
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
void setY(qreal y)
Sets the y coordinate of this point to the given y coordinate.
static QVector3D crossProduct(const QVector3D &v1, const QVector3D &v2)
Returns the cross-product of vectors v1 and v2, which corresponds to the normal vector of a plane def...
Qt::LayoutDirection direction