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

Go to the source code of this file.

Functions

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

Function Documentation

◆ operator<<() [1/2]

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]

QDataStream& operator<< ( QDataStream stream,
const QVector3D vector 
)
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 }
qreal x() const
Returns the x coordinate of this point.
Definition: qvector3d.h:161
static FILE * stream
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

◆ operator>>()

QDataStream& operator>> ( QDataStream stream,
QVector3D vector 
)
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
void setX(qreal x)
Sets the x coordinate of this point to the given x coordinate.
Definition: qvector3d.h:165
void setZ(qreal z)
Sets the z coordinate of this point to the given z coordinate.
Definition: qvector3d.h:167
void setY(qreal y)
Sets the y coordinate of this point to the given y coordinate.
Definition: qvector3d.h:166