Qt 4.8
Functions
qvector4d.cpp File Reference
#include "qvector4d.h"
#include "qvector3d.h"
#include "qvector2d.h"
#include <QtCore/qdebug.h>
#include <QtCore/qvariant.h>
#include <QtCore/qmath.h>

Go to the source code of this file.

Functions

QDebug operator<< (QDebug dbg, const QVector4D &vector)
 
QDataStreamoperator<< (QDataStream &stream, const QVector4D &vector)
 
QDataStreamoperator>> (QDataStream &stream, QVector4D &vector)
 

Function Documentation

◆ operator<<() [1/2]

QDebug operator<< ( QDebug  dbg,
const QVector4D vector 
)

Definition at line 602 of file qvector4d.cpp.

603 {
604  dbg.nospace() << "QVector4D("
605  << vector.x() << ", " << vector.y() << ", "
606  << vector.z() << ", " << vector.w() << ')';
607  return dbg.space();
608 }
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 w() const
Returns the w coordinate of this point.
Definition: qvector4d.h:161
qreal x() const
Returns the x coordinate of this point.
Definition: qvector4d.h:158
qreal z() const
Returns the z coordinate of this point.
Definition: qvector4d.h:160
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
Definition: qdebug.h:91
qreal y() const
Returns the y coordinate of this point.
Definition: qvector4d.h:159

◆ operator<<() [2/2]

QDataStream& operator<< ( QDataStream stream,
const QVector4D vector 
)
related

Definition at line 627 of file qvector4d.cpp.

628 {
629  stream << double(vector.x()) << double(vector.y())
630  << double(vector.z()) << double(vector.w());
631  return stream;
632 }
qreal w() const
Returns the w coordinate of this point.
Definition: qvector4d.h:161
static FILE * stream
qreal x() const
Returns the x coordinate of this point.
Definition: qvector4d.h:158
qreal z() const
Returns the z coordinate of this point.
Definition: qvector4d.h:160
qreal y() const
Returns the y coordinate of this point.
Definition: qvector4d.h:159

◆ operator>>()

QDataStream& operator>> ( QDataStream stream,
QVector4D vector 
)
related

Definition at line 647 of file qvector4d.cpp.

648 {
649  double x, y, z, w;
650  stream >> x;
651  stream >> y;
652  stream >> z;
653  stream >> w;
654  vector.setX(qreal(x));
655  vector.setY(qreal(y));
656  vector.setZ(qreal(z));
657  vector.setW(qreal(w));
658  return stream;
659 }
double qreal
Definition: qglobal.h:1193
static FILE * stream
void setZ(qreal z)
Sets the z coordinate of this point to the given z coordinate.
Definition: qvector4d.h:165
void setW(qreal w)
Sets the w coordinate of this point to the given w coordinate.
Definition: qvector4d.h:166
void setX(qreal x)
Sets the x coordinate of this point to the given x coordinate.
Definition: qvector4d.h:163
void setY(qreal y)
Sets the y coordinate of this point to the given y coordinate.
Definition: qvector4d.h:164