QTransform Class Reference

#include <qtransform.h>

Class Description

Definition at line 65 of file qtransform.h.

Public Types

enum  TransformationType {
  TxNone = 0x00, TxTranslate = 0x01, TxScale = 0x02, TxRotate = 0x04,
  TxShear = 0x08, TxProject = 0x10
}
 

Public Member Functions

 QTransform (Qt::Initialization)
 
 QTransform ()
 
 QTransform (qreal h11, qreal h12, qreal h13, qreal h21, qreal h22, qreal h23, qreal h31, qreal h32, qreal h33=1.0)
 
 QTransform (qreal h11, qreal h12, qreal h21, qreal h22, qreal dx, qreal dy)
 
 QTransform (const QMatrix &mtx)
 
bool isAffine () const
 
bool isIdentity () const
 
bool isInvertible () const
 
bool isScaling () const
 
bool isRotating () const
 
bool isTranslating () const
 
TransformationType type () const
 
qreal determinant () const
 
qreal det () const
 
qreal m11 () const
 
qreal m12 () const
 
qreal m13 () const
 
qreal m21 () const
 
qreal m22 () const
 
qreal m23 () const
 
qreal m31 () const
 
qreal m32 () const
 
qreal m33 () const
 
qreal dx () const
 
qreal dy () const
 
void setMatrix (qreal m11, qreal m12, qreal m13, qreal m21, qreal m22, qreal m23, qreal m31, qreal m32, qreal m33)
 
QTransform inverted (bool *invertible=0) const
 
QTransform adjoint () const
 
QTransform transposed () const
 
QTransformtranslate (qreal dx, qreal dy)
 
QTransformscale (qreal sx, qreal sy)
 
QTransformshear (qreal sh, qreal sv)
 
QTransformrotate (qreal a, Qt::Axis axis=Qt::ZAxis)
 
QTransformrotateRadians (qreal a, Qt::Axis axis=Qt::ZAxis)
 
bool operator== (const QTransform &) const
 
bool operator!= (const QTransform &) const
 
QTransformoperator*= (const QTransform &)
 
QTransform operator* (const QTransform &o) const
 
QTransformoperator= (const QTransform &)
 
 operator QVariant () const
 
void reset ()
 
QPoint map (const QPoint &p) const
 
QPointF map (const QPointF &p) const
 
QLine map (const QLine &l) const
 
QLineF map (const QLineF &l) const
 
QPolygonF map (const QPolygonF &a) const
 
QPolygon map (const QPolygon &a) const
 
QRegion map (const QRegion &r) const
 
QPainterPath map (const QPainterPath &p) const
 
QPolygon mapToPolygon (const QRect &r) const
 
QRect mapRect (const QRect &) const
 
QRectF mapRect (const QRectF &) const
 
void map (int x, int y, int *tx, int *ty) const
 
void map (qreal x, qreal y, qreal *tx, qreal *ty) const
 
const QMatrixtoAffine () const
 
QTransformoperator*= (qreal div)
 
QTransformoperator/= (qreal div)
 
QTransformoperator+= (qreal div)
 
QTransformoperator-= (qreal div)
 

Static Public Member Functions

static bool squareToQuad (const QPolygonF &square, QTransform &result)
 
static bool quadToSquare (const QPolygonF &quad, QTransform &result)
 
static bool quadToQuad (const QPolygonF &one, const QPolygonF &two, QTransform &result)
 
static QTransform fromTranslate (qreal dx, qreal dy)
 
static QTransform fromScale (qreal dx, qreal dy)
 

Member Enumeration Documentation

Enumerator
TxNone 
TxTranslate 
TxScale 
TxRotate 
TxShear 
TxProject 

Definition at line 68 of file qtransform.h.

68  {
69  TxNone = 0x00,
70  TxTranslate = 0x01,
71  TxScale = 0x02,
72  TxRotate = 0x04,
73  TxShear = 0x08,
74  TxProject = 0x10
75  };

Constructor & Destructor Documentation

QTransform ( Qt::Initialization  )
inlineexplicit

Definition at line 77 of file qtransform.h.

QTransform ( qreal  h11,
qreal  h12,
qreal  h13,
qreal  h21,
qreal  h22,
qreal  h23,
qreal  h31,
qreal  h32,
qreal  h33 = 1.0 
)
QTransform ( qreal  h11,
qreal  h12,
qreal  h21,
qreal  h22,
qreal  dx,
qreal  dy 
)
QTransform ( const QMatrix mtx)
explicit

Member Function Documentation

bool isAffine ( ) const
inline

Definition at line 200 of file qtransform.h.

201 {
202  return inline_type() < TxProject;
203 }
bool isIdentity ( ) const
inline

Definition at line 204 of file qtransform.h.

205 {
206  return inline_type() == TxNone;
207 }
bool isInvertible ( ) const
inline

Definition at line 209 of file qtransform.h.

210 {
211  return !qFuzzyIsNull(determinant());
212 }
qreal determinant() const
Definition: qtransform.h:228
bool isScaling ( ) const
inline

Definition at line 214 of file qtransform.h.

215 {
216  return type() >= TxScale;
217 }
TransformationType type() const
bool isRotating ( ) const
inline

Definition at line 218 of file qtransform.h.

219 {
220  return inline_type() >= TxRotate;
221 }
bool isTranslating ( ) const
inline

Definition at line 223 of file qtransform.h.

224 {
225  return inline_type() >= TxTranslate;
226 }
qreal determinant ( ) const
inline

Definition at line 228 of file qtransform.h.

229 {
230  return affine._m11*(m_33*affine._m22-affine._dy*m_23) -
231  affine._m21*(m_33*affine._m12-affine._dy*m_13)+affine._dx*(m_23*affine._m12-affine._m22*m_13);
232 }
qreal det ( ) const
inline

Definition at line 233 of file qtransform.h.

234 {
235  return determinant();
236 }
qreal determinant() const
Definition: qtransform.h:228
qreal m11 ( ) const
inline

Definition at line 237 of file qtransform.h.

238 {
239  return affine._m11;
240 }
qreal m12 ( ) const
inline

Definition at line 241 of file qtransform.h.

242 {
243  return affine._m12;
244 }
qreal m13 ( ) const
inline

Definition at line 245 of file qtransform.h.

246 {
247  return m_13;
248 }
qreal m21 ( ) const
inline

Definition at line 249 of file qtransform.h.

250 {
251  return affine._m21;
252 }
qreal m22 ( ) const
inline

Definition at line 253 of file qtransform.h.

254 {
255  return affine._m22;
256 }
qreal m23 ( ) const
inline

Definition at line 257 of file qtransform.h.

258 {
259  return m_23;
260 }
qreal m31 ( ) const
inline

Definition at line 261 of file qtransform.h.

262 {
263  return affine._dx;
264 }
qreal m32 ( ) const
inline

Definition at line 265 of file qtransform.h.

266 {
267  return affine._dy;
268 }
qreal m33 ( ) const
inline

Definition at line 269 of file qtransform.h.

270 {
271  return m_33;
272 }
qreal dx ( ) const
inline

Definition at line 273 of file qtransform.h.

274 {
275  return affine._dx;
276 }
qreal dy ( ) const
inline

Definition at line 277 of file qtransform.h.

278 {
279  return affine._dy;
280 }
void setMatrix ( qreal  m11,
qreal  m12,
qreal  m13,
qreal  m21,
qreal  m22,
qreal  m23,
qreal  m31,
qreal  m32,
qreal  m33 
)
QTransform inverted ( bool *  invertible = 0) const
QTransform adjoint ( ) const
QTransform transposed ( ) const
QTransform& translate ( qreal  dx,
qreal  dy 
)
QTransform& scale ( qreal  sx,
qreal  sy 
)
QTransform& shear ( qreal  sh,
qreal  sv 
)
QTransform& rotate ( qreal  a,
Qt::Axis  axis = Qt::ZAxis 
)
QTransform& rotateRadians ( qreal  a,
Qt::Axis  axis = Qt::ZAxis 
)
static bool squareToQuad ( const QPolygonF square,
QTransform result 
)
static
static bool quadToSquare ( const QPolygonF quad,
QTransform result 
)
static
static bool quadToQuad ( const QPolygonF one,
const QPolygonF two,
QTransform result 
)
static
bool operator== ( const QTransform ) const
bool operator!= ( const QTransform ) const
QTransform& operator*= ( const QTransform )
QTransform operator* ( const QTransform o) const
QTransform& operator= ( const QTransform )
operator QVariant ( ) const
void reset ( )
QPoint map ( const QPoint p) const
QPointF map ( const QPointF p) const
QLine map ( const QLine l) const
QLineF map ( const QLineF l) const
QPolygonF map ( const QPolygonF a) const
QPolygon map ( const QPolygon a) const
QRegion map ( const QRegion r) const
QPainterPath map ( const QPainterPath p) const
QPolygon mapToPolygon ( const QRect r) const
QRect mapRect ( const QRect ) const
QRectF mapRect ( const QRectF ) const
void map ( int  x,
int  y,
int tx,
int ty 
) const
void map ( qreal  x,
qreal  y,
qreal *  tx,
qreal *  ty 
) const
const QMatrix& toAffine ( ) const
QTransform & operator*= ( qreal  div)
inline

Definition at line 282 of file qtransform.h.

283 {
284  if (num == 1.)
285  return *this;
286  affine._m11 *= num;
287  affine._m12 *= num;
288  m_13 *= num;
289  affine._m21 *= num;
290  affine._m22 *= num;
291  m_23 *= num;
292  affine._dx *= num;
293  affine._dy *= num;
294  m_33 *= num;
295  if (m_dirty < TxScale)
296  m_dirty = TxScale;
297  return *this;
298 }
GLuint GLuint num
Definition: GLee.h:7190
QTransform & operator/= ( qreal  div)
inline

Definition at line 299 of file qtransform.h.

300 {
301  if (div == 0)
302  return *this;
303  div = 1/div;
304  return operator*=(div);
305 }
QTransform & operator*=(const QTransform &)
QTransform & operator+= ( qreal  div)
inline

Definition at line 306 of file qtransform.h.

307 {
308  if (num == 0)
309  return *this;
310  affine._m11 += num;
311  affine._m12 += num;
312  m_13 += num;
313  affine._m21 += num;
314  affine._m22 += num;
315  m_23 += num;
316  affine._dx += num;
317  affine._dy += num;
318  m_33 += num;
319  m_dirty = TxProject;
320  return *this;
321 }
GLuint GLuint num
Definition: GLee.h:7190
QTransform & operator-= ( qreal  div)
inline

Definition at line 322 of file qtransform.h.

323 {
324  if (num == 0)
325  return *this;
326  affine._m11 -= num;
327  affine._m12 -= num;
328  m_13 -= num;
329  affine._m21 -= num;
330  affine._m22 -= num;
331  m_23 -= num;
332  affine._dx -= num;
333  affine._dy -= num;
334  m_33 -= num;
335  m_dirty = TxProject;
336  return *this;
337 }
GLuint GLuint num
Definition: GLee.h:7190
static QTransform fromTranslate ( qreal  dx,
qreal  dy 
)
static
static QTransform fromScale ( qreal  dx,
qreal  dy 
)
static

The documentation for this class was generated from the following file: