qline.sip 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. // qline.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtCore 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 <qline.h>
  23. %End
  24. class QLine
  25. {
  26. %TypeHeaderCode
  27. #include <qline.h>
  28. %End
  29. %PickleCode
  30. sipRes = Py_BuildValue("iiii", sipCpp->x1(), sipCpp->y1(), sipCpp->x2(), sipCpp->y2());
  31. %End
  32. public:
  33. QLine();
  34. QLine(const QPoint &pt1_, const QPoint &pt2_);
  35. QLine(int x1pos, int y1pos, int x2pos, int y2pos);
  36. SIP_PYOBJECT __repr__() const /TypeHint="str"/;
  37. %MethodCode
  38. if (sipCpp->isNull())
  39. {
  40. sipRes = PyUnicode_FromString("PyQt6.QtCore.QLine()");
  41. }
  42. else
  43. {
  44. sipRes = PyUnicode_FromFormat(
  45. "PyQt6.QtCore.QLine(%i, %i, %i, %i)",
  46. sipCpp->x1(), sipCpp->y1(), sipCpp->x2(), sipCpp->y2());
  47. }
  48. %End
  49. bool isNull() const;
  50. int __bool__() const;
  51. %MethodCode
  52. sipRes = !sipCpp->isNull();
  53. %End
  54. int x1() const;
  55. int y1() const;
  56. int x2() const;
  57. int y2() const;
  58. QPoint p1() const;
  59. QPoint p2() const;
  60. int dx() const;
  61. int dy() const;
  62. void translate(const QPoint &point);
  63. void translate(int adx, int ady);
  64. %If (- Qt_6_8_0)
  65. bool operator==(const QLine &d) const;
  66. %End
  67. %If (- Qt_6_8_0)
  68. bool operator!=(const QLine &d) const;
  69. %End
  70. QLine translated(const QPoint &p) const;
  71. QLine translated(int adx, int ady) const;
  72. void setP1(const QPoint &aP1);
  73. void setP2(const QPoint &aP2);
  74. void setPoints(const QPoint &aP1, const QPoint &aP2);
  75. void setLine(int aX1, int aY1, int aX2, int aY2);
  76. QPoint center() const;
  77. %If (Qt_6_4_0 -)
  78. QLineF toLineF() const;
  79. %End
  80. };
  81. QDataStream &operator<<(QDataStream &, const QLine &) /ReleaseGIL/;
  82. QDataStream &operator>>(QDataStream &, QLine & /Constrained/) /ReleaseGIL/;
  83. class QLineF
  84. {
  85. %TypeHeaderCode
  86. #include <qline.h>
  87. %End
  88. %PickleCode
  89. sipRes = Py_BuildValue("dddd", sipCpp->x1(), sipCpp->y1(), sipCpp->x2(), sipCpp->y2());
  90. %End
  91. public:
  92. enum IntersectionType
  93. {
  94. NoIntersection,
  95. BoundedIntersection,
  96. UnboundedIntersection,
  97. };
  98. QLineF(const QLine &line);
  99. bool isNull() const;
  100. int __bool__() const;
  101. %MethodCode
  102. sipRes = !sipCpp->isNull();
  103. %End
  104. qreal length() const;
  105. QLineF unitVector() const;
  106. QLineF::IntersectionType intersects(const QLineF &l, QPointF *intersectionPoint /Out/ = 0) const;
  107. QLineF();
  108. QLineF(const QPointF &apt1, const QPointF &apt2);
  109. QLineF(qreal x1pos, qreal y1pos, qreal x2pos, qreal y2pos);
  110. SIP_PYOBJECT __repr__() const /TypeHint="str"/;
  111. %MethodCode
  112. if (sipCpp->isNull())
  113. {
  114. sipRes = PyUnicode_FromString("PyQt6.QtCore.QLineF()");
  115. }
  116. else
  117. {
  118. PyObject *x1 = PyFloat_FromDouble(sipCpp->x1());
  119. PyObject *y1 = PyFloat_FromDouble(sipCpp->y1());
  120. PyObject *x2 = PyFloat_FromDouble(sipCpp->x2());
  121. PyObject *y2 = PyFloat_FromDouble(sipCpp->y2());
  122. if (x1 && y1 && x2 && y2)
  123. {
  124. sipRes = PyUnicode_FromFormat("PyQt6.QtCore.QLineF(%R, %R, %R, %R)",
  125. x1, y1, x2, y2);
  126. }
  127. Py_XDECREF(x1);
  128. Py_XDECREF(y1);
  129. Py_XDECREF(x2);
  130. Py_XDECREF(y2);
  131. }
  132. %End
  133. qreal x1() const;
  134. qreal y1() const;
  135. qreal x2() const;
  136. qreal y2() const;
  137. QPointF p1() const;
  138. QPointF p2() const;
  139. qreal dx() const;
  140. qreal dy() const;
  141. QLineF normalVector() const;
  142. void translate(const QPointF &point);
  143. void translate(qreal adx, qreal ady);
  144. void setLength(qreal len);
  145. QPointF pointAt(qreal t) const;
  146. QLine toLine() const;
  147. %If (- Qt_6_8_0)
  148. bool operator==(const QLineF &d) const;
  149. %End
  150. %If (- Qt_6_8_0)
  151. bool operator!=(const QLineF &d) const;
  152. %End
  153. static QLineF fromPolar(qreal length, qreal angle);
  154. qreal angle() const;
  155. void setAngle(qreal angle);
  156. qreal angleTo(const QLineF &l) const;
  157. QLineF translated(const QPointF &p) const;
  158. QLineF translated(qreal adx, qreal ady) const;
  159. void setP1(const QPointF &aP1);
  160. void setP2(const QPointF &aP2);
  161. void setPoints(const QPointF &aP1, const QPointF &aP2);
  162. void setLine(qreal aX1, qreal aY1, qreal aX2, qreal aY2);
  163. QPointF center() const;
  164. };
  165. QDataStream &operator<<(QDataStream &, const QLineF &) /ReleaseGIL/;
  166. QDataStream &operator>>(QDataStream &, QLineF & /Constrained/) /ReleaseGIL/;
  167. %If (Qt_6_8_0 -)
  168. bool operator!=(const QLineF &lhs, const QLine &rhs);
  169. %End
  170. %If (Qt_6_8_0 -)
  171. bool operator!=(const QLine &lhs, const QLineF &rhs);
  172. %End
  173. %If (Qt_6_8_0 -)
  174. bool operator!=(const QLineF &lhs, const QLineF &rhs);
  175. %End
  176. %If (Qt_6_8_0 -)
  177. bool operator!=(const QLine &lhs, const QLine &rhs);
  178. %End
  179. %If (Qt_6_8_0 -)
  180. bool operator==(const QLineF &lhs, const QLine &rhs);
  181. %End
  182. %If (Qt_6_8_0 -)
  183. bool operator==(const QLine &lhs, const QLineF &rhs);
  184. %End
  185. %If (Qt_6_8_0 -)
  186. bool operator==(const QLineF &lhs, const QLineF &rhs);
  187. %End
  188. %If (Qt_6_8_0 -)
  189. bool operator==(const QLine &lhs, const QLine &rhs);
  190. %End
  191. %If (Qt_6_8_0 -)
  192. bool qFuzzyCompare(const QLineF &lhs, const QLineF &rhs);
  193. %End
  194. %If (Qt_6_8_0 -)
  195. bool qFuzzyIsNull(const QLineF &line);
  196. %End