Qt 4.8
Functions
qquaternion.cpp File Reference
#include "qquaternion.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 QQuaternion &q)
 
QDataStreamoperator<< (QDataStream &stream, const QQuaternion &quaternion)
 
QDataStreamoperator>> (QDataStream &stream, QQuaternion &quaternion)
 

Function Documentation

◆ operator<<() [1/2]

QDebug operator<< ( QDebug  dbg,
const QQuaternion q 
)

Definition at line 666 of file qquaternion.cpp.

667 {
668  dbg.nospace() << "QQuaternion(scalar:" << q.scalar()
669  << ", vector:(" << q.x() << ", "
670  << q.y() << ", " << q.z() << "))";
671  return dbg.space();
672 }
qreal x() const
Returns the x coordinate of this quaternion&#39;s vector.
Definition: qquaternion.h:156
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 scalar() const
Returns the scalar component of this quaternion.
Definition: qquaternion.h:159
qreal y() const
Returns the y coordinate of this quaternion&#39;s vector.
Definition: qquaternion.h:157
qreal z() const
Returns the z coordinate of this quaternion&#39;s vector.
Definition: qquaternion.h:158
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 QQuaternion quaternion 
)
related

Definition at line 691 of file qquaternion.cpp.

692 {
693  stream << double(quaternion.scalar()) << double(quaternion.x())
694  << double(quaternion.y()) << double(quaternion.z());
695  return stream;
696 }
qreal x() const
Returns the x coordinate of this quaternion&#39;s vector.
Definition: qquaternion.h:156
qreal scalar() const
Returns the scalar component of this quaternion.
Definition: qquaternion.h:159
static FILE * stream
qreal y() const
Returns the y coordinate of this quaternion&#39;s vector.
Definition: qquaternion.h:157
qreal z() const
Returns the z coordinate of this quaternion&#39;s vector.
Definition: qquaternion.h:158

◆ operator>>()

QDataStream& operator>> ( QDataStream stream,
QQuaternion quaternion 
)
related

Definition at line 711 of file qquaternion.cpp.

712 {
713  double scalar, x, y, z;
714  stream >> scalar;
715  stream >> x;
716  stream >> y;
717  stream >> z;
718  quaternion.setScalar(qreal(scalar));
719  quaternion.setX(qreal(x));
720  quaternion.setY(qreal(y));
721  quaternion.setZ(qreal(z));
722  return stream;
723 }
double qreal
Definition: qglobal.h:1193
void setZ(qreal z)
Sets the z coordinate of this quaternion&#39;s vector to the given z coordinate.
Definition: qquaternion.h:163
void setX(qreal x)
Sets the x coordinate of this quaternion&#39;s vector to the given x coordinate.
Definition: qquaternion.h:161
static FILE * stream
void setScalar(qreal scalar)
Sets the scalar component of this quaternion to scalar.
Definition: qquaternion.h:164
void setY(qreal y)
Sets the y coordinate of this quaternion&#39;s vector to the given y coordinate.
Definition: qquaternion.h:162