qtransform.sip 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. // qtransform.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtGui Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. %ModuleCode
  22. #include <qtransform.h>
  23. %End
  24. class QTransform
  25. {
  26. %TypeHeaderCode
  27. #include <qtransform.h>
  28. %End
  29. %PickleCode
  30. sipRes = Py_BuildValue("ddddddddd", sipCpp->m11(), sipCpp->m12(), sipCpp->m13(), sipCpp->m21(), sipCpp->m22(), sipCpp->m23(), sipCpp->m31(), sipCpp->m32(), sipCpp->m33());
  31. %End
  32. public:
  33. enum TransformationType
  34. {
  35. TxNone,
  36. TxTranslate,
  37. TxScale,
  38. TxRotate,
  39. TxShear,
  40. TxProject,
  41. };
  42. QTransform();
  43. QTransform(qreal h11, qreal h12, qreal h13, qreal h21, qreal h22, qreal h23, qreal h31, qreal h32, qreal h33);
  44. QTransform(qreal h11, qreal h12, qreal h13, qreal h21, qreal h22, qreal h23);
  45. QTransform(const QTransform &other);
  46. QTransform::TransformationType type() const;
  47. void setMatrix(qreal m11, qreal m12, qreal m13, qreal m21, qreal m22, qreal m23, qreal m31, qreal m32, qreal m33);
  48. QTransform inverted(bool *invertible = 0) const;
  49. QTransform adjoint() const;
  50. QTransform transposed() const;
  51. QTransform &translate(qreal dx, qreal dy);
  52. QTransform &scale(qreal sx, qreal sy);
  53. QTransform &shear(qreal sh, qreal sv);
  54. QTransform &rotate(qreal angle, Qt::Axis axis = Qt::ZAxis);
  55. %If (Qt_6_5_0 -)
  56. QTransform &rotate(qreal a, Qt::Axis axis, qreal distanceToPlane);
  57. %End
  58. QTransform &rotateRadians(qreal angle, Qt::Axis axis = Qt::ZAxis);
  59. %If (Qt_6_5_0 -)
  60. QTransform &rotateRadians(qreal a, Qt::Axis axis, qreal distanceToPlane);
  61. %End
  62. static bool squareToQuad(const QPolygonF &square, QTransform &result);
  63. static bool quadToSquare(const QPolygonF &quad, QTransform &result);
  64. static bool quadToQuad(const QPolygonF &one, const QPolygonF &two, QTransform &result);
  65. bool operator==(const QTransform &) const;
  66. bool operator!=(const QTransform &) const;
  67. QTransform &operator*=(const QTransform &) /__imatmul__/;
  68. QTransform operator*(const QTransform &o) const /__matmul__/;
  69. void reset();
  70. void map(int x /Constrained/, int y /Constrained/, int *tx, int *ty) const;
  71. void map(qreal x, qreal y, qreal *tx, qreal *ty) const;
  72. QPoint map(const QPoint &p) const;
  73. QPointF map(const QPointF &p) const;
  74. QLine map(const QLine &l) const;
  75. QLineF map(const QLineF &l) const;
  76. QPolygonF map(const QPolygonF &a) const;
  77. QPolygon map(const QPolygon &a) const;
  78. QRegion map(const QRegion &r) const;
  79. QPainterPath map(const QPainterPath &p) const;
  80. QPolygon mapToPolygon(const QRect &r) const;
  81. QRect mapRect(const QRect &) const;
  82. QRectF mapRect(const QRectF &) const;
  83. bool isAffine() const;
  84. bool isIdentity() const;
  85. bool isInvertible() const;
  86. bool isScaling() const;
  87. bool isRotating() const;
  88. bool isTranslating() const;
  89. qreal determinant() const;
  90. qreal m11() const;
  91. qreal m12() const;
  92. qreal m13() const;
  93. qreal m21() const;
  94. qreal m22() const;
  95. qreal m23() const;
  96. qreal m31() const;
  97. qreal m32() const;
  98. qreal m33() const;
  99. qreal dx() const;
  100. qreal dy() const;
  101. static QTransform fromTranslate(qreal dx, qreal dy);
  102. static QTransform fromScale(qreal dx, qreal dy);
  103. QTransform &operator*=(qreal num);
  104. QTransform &operator/=(qreal div);
  105. QTransform &operator+=(qreal num);
  106. QTransform &operator-=(qreal num);
  107. Py_hash_t __hash__() const;
  108. %MethodCode
  109. sipRes = qHash(*sipCpp);
  110. %End
  111. };
  112. QDataStream &operator<<(QDataStream &, const QTransform &) /ReleaseGIL/;
  113. QDataStream &operator>>(QDataStream &, QTransform & /Constrained/) /ReleaseGIL/;
  114. QPoint operator*(const QPoint &p, const QTransform &m);
  115. QPointF operator*(const QPointF &p, const QTransform &m);
  116. QLineF operator*(const QLineF &l, const QTransform &m);
  117. QLine operator*(const QLine &l, const QTransform &m);
  118. QPolygon operator*(const QPolygon &a, const QTransform &m);
  119. QPolygonF operator*(const QPolygonF &a, const QTransform &m);
  120. QRegion operator*(const QRegion &r, const QTransform &m);
  121. QTransform operator*(const QTransform &a, qreal n);
  122. QTransform operator/(const QTransform &a, qreal n);
  123. QTransform operator+(const QTransform &a, qreal n);
  124. QTransform operator-(const QTransform &a, qreal n);
  125. bool qFuzzyCompare(const QTransform &t1, const QTransform &t2);