| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qpolygon.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | - | |||||||||||||
| 7 | static void qt_polygon_isect_line(const QPointF &p1, const QPointF &p2, const QPointF &pos, | - | ||||||||||||
| 8 | int *winding) | - | ||||||||||||
| 9 | { | - | ||||||||||||
| 10 | qreal x1 = p1.x(); | - | ||||||||||||
| 11 | qreal y1 = p1.y(); | - | ||||||||||||
| 12 | qreal x2 = p2.x(); | - | ||||||||||||
| 13 | qreal y2 = p2.y(); | - | ||||||||||||
| 14 | qreal y = pos.y(); | - | ||||||||||||
| 15 | - | |||||||||||||
| 16 | int dir = 1; | - | ||||||||||||
| 17 | - | |||||||||||||
| 18 | if (qFuzzyCompare(y1, y2)
| 0 | ||||||||||||
| 19 | - | |||||||||||||
| 20 | return; never executed: return; | 0 | ||||||||||||
| 21 | } else if (y2 < y1
| 0 | ||||||||||||
| 22 | qreal x_tmp = x2; x2 = x1; x1 = x_tmp; | - | ||||||||||||
| 23 | qreal y_tmp = y2; y2 = y1; y1 = y_tmp; | - | ||||||||||||
| 24 | dir = -1; | - | ||||||||||||
| 25 | } never executed: end of block | 0 | ||||||||||||
| 26 | - | |||||||||||||
| 27 | if (y >= y1
| 0 | ||||||||||||
| 28 | qreal x = x1 + ((x2 - x1) / (y2 - y1)) * (y - y1); | - | ||||||||||||
| 29 | - | |||||||||||||
| 30 | - | |||||||||||||
| 31 | if (x<=pos.x()
| 0 | ||||||||||||
| 32 | (*winding) += dir; | - | ||||||||||||
| 33 | } never executed: end of block | 0 | ||||||||||||
| 34 | } never executed: end of block | 0 | ||||||||||||
| 35 | } never executed: end of block | 0 | ||||||||||||
| 36 | QPolygon::QPolygon(const QRect &r, bool closed) | - | ||||||||||||
| 37 | { | - | ||||||||||||
| 38 | reserve(closed ? 5 : 4); | - | ||||||||||||
| 39 | *this << QPoint(r.x(), r.y()) | - | ||||||||||||
| 40 | << QPoint(r.x() + r.width(), r.y()) | - | ||||||||||||
| 41 | << QPoint(r.x() + r.width(), r.y() + r.height()) | - | ||||||||||||
| 42 | << QPoint(r.x(), r.y() + r.height()); | - | ||||||||||||
| 43 | if (closed
| 0 | ||||||||||||
| 44 | * never executed: this << QPoint(r.left(), r.top());*this << QPoint(r.left(), r.top());never executed: *this << QPoint(r.left(), r.top()); | 0 | ||||||||||||
| 45 | } never executed: end of block | 0 | ||||||||||||
| 46 | QPolygon::QPolygon(int nPoints, const int *points) | - | ||||||||||||
| 47 | { | - | ||||||||||||
| 48 | setPoints(nPoints, points); | - | ||||||||||||
| 49 | } never executed: end of block | 0 | ||||||||||||
| 50 | void QPolygon::translate(int dx, int dy) | - | ||||||||||||
| 51 | { | - | ||||||||||||
| 52 | if (dx == 0
| 0 | ||||||||||||
| 53 | return; never executed: return; | 0 | ||||||||||||
| 54 | - | |||||||||||||
| 55 | QPoint *p = data(); | - | ||||||||||||
| 56 | int i = size(); | - | ||||||||||||
| 57 | QPoint pt(dx, dy); | - | ||||||||||||
| 58 | while (i--
| 0 | ||||||||||||
| 59 | *p += pt; | - | ||||||||||||
| 60 | ++p; | - | ||||||||||||
| 61 | } never executed: end of block | 0 | ||||||||||||
| 62 | } never executed: end of block | 0 | ||||||||||||
| 63 | QPolygon QPolygon::translated(int dx, int dy) const | - | ||||||||||||
| 64 | { | - | ||||||||||||
| 65 | QPolygon copy(*this); | - | ||||||||||||
| 66 | copy.translate(dx, dy); | - | ||||||||||||
| 67 | return never executed: copy;return copy;never executed: return copy; | 0 | ||||||||||||
| 68 | } | - | ||||||||||||
| 69 | void QPolygon::point(int index, int *x, int *y) const | - | ||||||||||||
| 70 | { | - | ||||||||||||
| 71 | QPoint p = at(index); | - | ||||||||||||
| 72 | if (x
| 0 | ||||||||||||
| 73 | * never executed: x = (int)p.x();*x = (int)p.x();never executed: *x = (int)p.x(); | 0 | ||||||||||||
| 74 | if (y
| 0 | ||||||||||||
| 75 | * never executed: y = (int)p.y();*y = (int)p.y();never executed: *y = (int)p.y(); | 0 | ||||||||||||
| 76 | } never executed: end of block | 0 | ||||||||||||
| 77 | void QPolygon::setPoints(int nPoints, const int *points) | - | ||||||||||||
| 78 | { | - | ||||||||||||
| 79 | resize(nPoints); | - | ||||||||||||
| 80 | int i = 0; | - | ||||||||||||
| 81 | while (nPoints--
| 0 | ||||||||||||
| 82 | setPoint(i++, *points, *(points+1)); | - | ||||||||||||
| 83 | points += 2; | - | ||||||||||||
| 84 | } never executed: end of block | 0 | ||||||||||||
| 85 | } never executed: end of block | 0 | ||||||||||||
| 86 | void QPolygon::setPoints(int nPoints, int firstx, int firsty, ...) | - | ||||||||||||
| 87 | { | - | ||||||||||||
| 88 | va_list ap; | - | ||||||||||||
| 89 | resize(nPoints); | - | ||||||||||||
| 90 | setPoint(0, firstx, firsty); | - | ||||||||||||
| 91 | int i = 0, x, y; | - | ||||||||||||
| 92 | __builtin_va_start(ap,firsty); | - | ||||||||||||
| 93 | while (--
| 0 | ||||||||||||
| 94 | x = __builtin_va_arg(ap,int); | - | ||||||||||||
| 95 | y = __builtin_va_arg(ap,int); | - | ||||||||||||
| 96 | setPoint(++i, x, y); | - | ||||||||||||
| 97 | } never executed: end of block | 0 | ||||||||||||
| 98 | __builtin_va_end(ap); | - | ||||||||||||
| 99 | } never executed: end of block | 0 | ||||||||||||
| 100 | void QPolygon::putPoints(int index, int nPoints, const int *points) | - | ||||||||||||
| 101 | { | - | ||||||||||||
| 102 | if (index + nPoints > size()
| 0 | ||||||||||||
| 103 | resize(index + nPoints); never executed: resize(index + nPoints); | 0 | ||||||||||||
| 104 | int i = index; | - | ||||||||||||
| 105 | while (nPoints--
| 0 | ||||||||||||
| 106 | setPoint(i++, *points, *(points+1)); | - | ||||||||||||
| 107 | points += 2; | - | ||||||||||||
| 108 | } never executed: end of block | 0 | ||||||||||||
| 109 | } never executed: end of block | 0 | ||||||||||||
| 110 | void QPolygon::putPoints(int index, int nPoints, int firstx, int firsty, ...) | - | ||||||||||||
| 111 | { | - | ||||||||||||
| 112 | va_list ap; | - | ||||||||||||
| 113 | if (index + nPoints > size()
| 0 | ||||||||||||
| 114 | resize(index + nPoints); never executed: resize(index + nPoints); | 0 | ||||||||||||
| 115 | if (nPoints <= 0
| 0 | ||||||||||||
| 116 | return; never executed: return; | 0 | ||||||||||||
| 117 | setPoint(index, firstx, firsty); | - | ||||||||||||
| 118 | int i = index, x, y; | - | ||||||||||||
| 119 | __builtin_va_start(ap,firsty); | - | ||||||||||||
| 120 | while (--
| 0 | ||||||||||||
| 121 | x = __builtin_va_arg(ap,int); | - | ||||||||||||
| 122 | y = __builtin_va_arg(ap,int); | - | ||||||||||||
| 123 | setPoint(++i, x, y); | - | ||||||||||||
| 124 | } never executed: end of block | 0 | ||||||||||||
| 125 | __builtin_va_end(ap); | - | ||||||||||||
| 126 | } never executed: end of block | 0 | ||||||||||||
| 127 | void QPolygon::putPoints(int index, int nPoints, const QPolygon & from, int fromIndex) | - | ||||||||||||
| 128 | { | - | ||||||||||||
| 129 | if (index + nPoints > size()
| 0 | ||||||||||||
| 130 | resize(index + nPoints); never executed: resize(index + nPoints); | 0 | ||||||||||||
| 131 | if (nPoints <= 0
| 0 | ||||||||||||
| 132 | return; never executed: return; | 0 | ||||||||||||
| 133 | int n = 0; | - | ||||||||||||
| 134 | while(n < nPoints
| 0 | ||||||||||||
| 135 | setPoint(index + n, from[fromIndex+n]); | - | ||||||||||||
| 136 | ++n; | - | ||||||||||||
| 137 | } never executed: end of block | 0 | ||||||||||||
| 138 | } never executed: end of block | 0 | ||||||||||||
| 139 | QRect QPolygon::boundingRect() const | - | ||||||||||||
| 140 | { | - | ||||||||||||
| 141 | if (isEmpty()
| 0 | ||||||||||||
| 142 | return never executed: QRect(0, 0, 0, 0);return QRect(0, 0, 0, 0);never executed: return QRect(0, 0, 0, 0); | 0 | ||||||||||||
| 143 | const QPoint *pd = constData(); | - | ||||||||||||
| 144 | int minx, maxx, miny, maxy; | - | ||||||||||||
| 145 | minx = maxx = pd->x(); | - | ||||||||||||
| 146 | miny = maxy = pd->y(); | - | ||||||||||||
| 147 | ++pd; | - | ||||||||||||
| 148 | for (int i = 1; i < size()
| 0 | ||||||||||||
| 149 | if (pd->x() < minx
| 0 | ||||||||||||
| 150 | minx = pd->x(); never executed: minx = pd->x(); | 0 | ||||||||||||
| 151 | else if (pd->x() > maxx
| 0 | ||||||||||||
| 152 | maxx = pd->x(); never executed: maxx = pd->x(); | 0 | ||||||||||||
| 153 | if (pd->y() < miny
| 0 | ||||||||||||
| 154 | miny = pd->y(); never executed: miny = pd->y(); | 0 | ||||||||||||
| 155 | else if (pd->y() > maxy
| 0 | ||||||||||||
| 156 | maxy = pd->y(); never executed: maxy = pd->y(); | 0 | ||||||||||||
| 157 | ++pd; | - | ||||||||||||
| 158 | } never executed: end of block | 0 | ||||||||||||
| 159 | return never executed: QRect(QPoint(minx,miny), QPoint(maxx,maxy));return QRect(QPoint(minx,miny), QPoint(maxx,maxy));never executed: return QRect(QPoint(minx,miny), QPoint(maxx,maxy)); | 0 | ||||||||||||
| 160 | } | - | ||||||||||||
| 161 | - | |||||||||||||
| 162 | - | |||||||||||||
| 163 | QDebug operator<<(QDebug dbg, const QPolygon &a) | - | ||||||||||||
| 164 | { | - | ||||||||||||
| 165 | QDebugStateSaver saver(dbg); | - | ||||||||||||
| 166 | dbg.nospace() << "QPolygon("; | - | ||||||||||||
| 167 | for (int i = 0; i < a.count()
| 0 | ||||||||||||
| 168 | dbg.nospace() << a.at(i); never executed: dbg.nospace() << a.at(i); | 0 | ||||||||||||
| 169 | dbg.nospace() << ')'; | - | ||||||||||||
| 170 | return never executed: dbg;return dbg;never executed: return dbg; | 0 | ||||||||||||
| 171 | } | - | ||||||||||||
| 172 | QPolygonF::QPolygonF(const QRectF &r) | - | ||||||||||||
| 173 | { | - | ||||||||||||
| 174 | reserve(5); | - | ||||||||||||
| 175 | append(QPointF(r.x(), r.y())); | - | ||||||||||||
| 176 | append(QPointF(r.x() + r.width(), r.y())); | - | ||||||||||||
| 177 | append(QPointF(r.x() + r.width(), r.y() + r.height())); | - | ||||||||||||
| 178 | append(QPointF(r.x(), r.y() + r.height())); | - | ||||||||||||
| 179 | append(QPointF(r.x(), r.y())); | - | ||||||||||||
| 180 | } never executed: end of block | 0 | ||||||||||||
| 181 | QPolygonF::QPolygonF(const QPolygon &a) | - | ||||||||||||
| 182 | { | - | ||||||||||||
| 183 | reserve(a.size()); | - | ||||||||||||
| 184 | for (int i=0; i<a.size()
| 0 | ||||||||||||
| 185 | append(a.at(i)); never executed: append(a.at(i)); | 0 | ||||||||||||
| 186 | } never executed: end of block | 0 | ||||||||||||
| 187 | void QPolygonF::translate(const QPointF &offset) | - | ||||||||||||
| 188 | { | - | ||||||||||||
| 189 | if (offset.isNull()
| 0 | ||||||||||||
| 190 | return; never executed: return; | 0 | ||||||||||||
| 191 | - | |||||||||||||
| 192 | QPointF *p = data(); | - | ||||||||||||
| 193 | int i = size(); | - | ||||||||||||
| 194 | while (i--
| 0 | ||||||||||||
| 195 | *p += offset; | - | ||||||||||||
| 196 | ++p; | - | ||||||||||||
| 197 | } never executed: end of block | 0 | ||||||||||||
| 198 | } never executed: end of block | 0 | ||||||||||||
| 199 | QPolygonF QPolygonF::translated(const QPointF &offset) const | - | ||||||||||||
| 200 | { | - | ||||||||||||
| 201 | QPolygonF copy(*this); | - | ||||||||||||
| 202 | copy.translate(offset); | - | ||||||||||||
| 203 | return never executed: copy;return copy;never executed: return copy; | 0 | ||||||||||||
| 204 | } | - | ||||||||||||
| 205 | QRectF QPolygonF::boundingRect() const | - | ||||||||||||
| 206 | { | - | ||||||||||||
| 207 | if (isEmpty()
| 0 | ||||||||||||
| 208 | return never executed: QRectF(0, 0, 0, 0);return QRectF(0, 0, 0, 0);never executed: return QRectF(0, 0, 0, 0); | 0 | ||||||||||||
| 209 | const QPointF *pd = constData(); | - | ||||||||||||
| 210 | qreal minx, maxx, miny, maxy; | - | ||||||||||||
| 211 | minx = maxx = pd->x(); | - | ||||||||||||
| 212 | miny = maxy = pd->y(); | - | ||||||||||||
| 213 | ++pd; | - | ||||||||||||
| 214 | for (int i = 1; i < size()
| 0 | ||||||||||||
| 215 | if (pd->x() < minx
| 0 | ||||||||||||
| 216 | minx = pd->x(); never executed: minx = pd->x(); | 0 | ||||||||||||
| 217 | else if (pd->x() > maxx
| 0 | ||||||||||||
| 218 | maxx = pd->x(); never executed: maxx = pd->x(); | 0 | ||||||||||||
| 219 | if (pd->y() < miny
| 0 | ||||||||||||
| 220 | miny = pd->y(); never executed: miny = pd->y(); | 0 | ||||||||||||
| 221 | else if (pd->y() > maxy
| 0 | ||||||||||||
| 222 | maxy = pd->y(); never executed: maxy = pd->y(); | 0 | ||||||||||||
| 223 | ++pd; | - | ||||||||||||
| 224 | } never executed: end of block | 0 | ||||||||||||
| 225 | return never executed: QRectF(minx,miny, maxx - minx, maxy - miny);return QRectF(minx,miny, maxx - minx, maxy - miny);never executed: return QRectF(minx,miny, maxx - minx, maxy - miny); | 0 | ||||||||||||
| 226 | } | - | ||||||||||||
| 227 | QPolygon QPolygonF::toPolygon() const | - | ||||||||||||
| 228 | { | - | ||||||||||||
| 229 | QPolygon a; | - | ||||||||||||
| 230 | a.reserve(size()); | - | ||||||||||||
| 231 | for (int i=0; i<size()
| 0 | ||||||||||||
| 232 | a.append(at(i).toPoint()); never executed: a.append(at(i).toPoint()); | 0 | ||||||||||||
| 233 | return never executed: a;return a;never executed: return a; | 0 | ||||||||||||
| 234 | } | - | ||||||||||||
| 235 | QPolygon::operator QVariant() const | - | ||||||||||||
| 236 | { | - | ||||||||||||
| 237 | return never executed: QVariant(QVariant::Polygon, this);return QVariant(QVariant::Polygon, this);never executed: return QVariant(QVariant::Polygon, this); | 0 | ||||||||||||
| 238 | } | - | ||||||||||||
| 239 | QDataStream &operator<<(QDataStream &s, const QPolygon &a) | - | ||||||||||||
| 240 | { | - | ||||||||||||
| 241 | const QVector<QPoint> &v = a; | - | ||||||||||||
| 242 | return never executed: s << v;return s << v;never executed: return s << v; | 0 | ||||||||||||
| 243 | } | - | ||||||||||||
| 244 | QDataStream &operator>>(QDataStream &s, QPolygon &a) | - | ||||||||||||
| 245 | { | - | ||||||||||||
| 246 | QVector<QPoint> &v = a; | - | ||||||||||||
| 247 | return never executed: s >> v;return s >> v;never executed: return s >> v; | 0 | ||||||||||||
| 248 | } | - | ||||||||||||
| 249 | QDataStream &operator<<(QDataStream &s, const QPolygonF &a) | - | ||||||||||||
| 250 | { | - | ||||||||||||
| 251 | quint32 len = a.size(); | - | ||||||||||||
| 252 | uint i; | - | ||||||||||||
| 253 | - | |||||||||||||
| 254 | s << len; | - | ||||||||||||
| 255 | for (i = 0; i < len
| 0 | ||||||||||||
| 256 | s << a.at(i); never executed: s << a.at(i); | 0 | ||||||||||||
| 257 | return never executed: s;return s;never executed: return s; | 0 | ||||||||||||
| 258 | } | - | ||||||||||||
| 259 | QDataStream &operator>>(QDataStream &s, QPolygonF &a) | - | ||||||||||||
| 260 | { | - | ||||||||||||
| 261 | quint32 len; | - | ||||||||||||
| 262 | uint i; | - | ||||||||||||
| 263 | - | |||||||||||||
| 264 | s >> len; | - | ||||||||||||
| 265 | a.reserve(a.size() + (int)len); | - | ||||||||||||
| 266 | QPointF p; | - | ||||||||||||
| 267 | for (i = 0; i < len
| 0 | ||||||||||||
| 268 | s >> p; | - | ||||||||||||
| 269 | a.insert(i, p); | - | ||||||||||||
| 270 | } never executed: end of block | 0 | ||||||||||||
| 271 | return never executed: s;return s;never executed: return s; | 0 | ||||||||||||
| 272 | } | - | ||||||||||||
| 273 | - | |||||||||||||
| 274 | - | |||||||||||||
| 275 | - | |||||||||||||
| 276 | QDebug operator<<(QDebug dbg, const QPolygonF &a) | - | ||||||||||||
| 277 | { | - | ||||||||||||
| 278 | QDebugStateSaver saver(dbg); | - | ||||||||||||
| 279 | dbg.nospace() << "QPolygonF("; | - | ||||||||||||
| 280 | for (int i = 0; i < a.count()
| 0 | ||||||||||||
| 281 | dbg.nospace() << a.at(i); never executed: dbg.nospace() << a.at(i); | 0 | ||||||||||||
| 282 | dbg.nospace() << ')'; | - | ||||||||||||
| 283 | return never executed: dbg;return dbg;never executed: return dbg; | 0 | ||||||||||||
| 284 | } | - | ||||||||||||
| 285 | bool QPolygonF::containsPoint(const QPointF &pt, Qt::FillRule fillRule) const | - | ||||||||||||
| 286 | { | - | ||||||||||||
| 287 | if (isEmpty()
| 0 | ||||||||||||
| 288 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 289 | - | |||||||||||||
| 290 | int winding_number = 0; | - | ||||||||||||
| 291 | - | |||||||||||||
| 292 | QPointF last_pt = at(0); | - | ||||||||||||
| 293 | QPointF last_start = at(0); | - | ||||||||||||
| 294 | for (int i = 1; i < size()
| 0 | ||||||||||||
| 295 | const QPointF &e = at(i); | - | ||||||||||||
| 296 | qt_polygon_isect_line(last_pt, e, pt, &winding_number); | - | ||||||||||||
| 297 | last_pt = e; | - | ||||||||||||
| 298 | } never executed: end of block | 0 | ||||||||||||
| 299 | - | |||||||||||||
| 300 | - | |||||||||||||
| 301 | if (last_pt != last_start
| 0 | ||||||||||||
| 302 | qt_polygon_isect_line(last_pt, last_start, pt, &winding_number); never executed: qt_polygon_isect_line(last_pt, last_start, pt, &winding_number); | 0 | ||||||||||||
| 303 | - | |||||||||||||
| 304 | return never executed: (fillRule == Qt::WindingFillreturn (fillRule == Qt::WindingFill ? (winding_number != 0) : ((winding_number % 2) != 0));
never executed: return (fillRule == Qt::WindingFill ? (winding_number != 0) : ((winding_number % 2) != 0)); | 0 | ||||||||||||
| 305 | ? (winding_number != 0) never executed: return (fillRule == Qt::WindingFill ? (winding_number != 0) : ((winding_number % 2) != 0)); | 0 | ||||||||||||
| 306 | : ((winding_number % 2) != 0)); never executed: return (fillRule == Qt::WindingFill ? (winding_number != 0) : ((winding_number % 2) != 0)); | 0 | ||||||||||||
| 307 | } | - | ||||||||||||
| 308 | bool QPolygon::containsPoint(const QPoint &pt, Qt::FillRule fillRule) const | - | ||||||||||||
| 309 | { | - | ||||||||||||
| 310 | if (isEmpty()
| 0 | ||||||||||||
| 311 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 312 | - | |||||||||||||
| 313 | int winding_number = 0; | - | ||||||||||||
| 314 | - | |||||||||||||
| 315 | QPoint last_pt = at(0); | - | ||||||||||||
| 316 | QPoint last_start = at(0); | - | ||||||||||||
| 317 | for (int i = 1; i < size()
| 0 | ||||||||||||
| 318 | const QPoint &e = at(i); | - | ||||||||||||
| 319 | qt_polygon_isect_line(last_pt, e, pt, &winding_number); | - | ||||||||||||
| 320 | last_pt = e; | - | ||||||||||||
| 321 | } never executed: end of block | 0 | ||||||||||||
| 322 | - | |||||||||||||
| 323 | - | |||||||||||||
| 324 | if (last_pt != last_start
| 0 | ||||||||||||
| 325 | qt_polygon_isect_line(last_pt, last_start, pt, &winding_number); never executed: qt_polygon_isect_line(last_pt, last_start, pt, &winding_number); | 0 | ||||||||||||
| 326 | - | |||||||||||||
| 327 | return never executed: (fillRule == Qt::WindingFillreturn (fillRule == Qt::WindingFill ? (winding_number != 0) : ((winding_number % 2) != 0));
never executed: return (fillRule == Qt::WindingFill ? (winding_number != 0) : ((winding_number % 2) != 0)); | 0 | ||||||||||||
| 328 | ? (winding_number != 0) never executed: return (fillRule == Qt::WindingFill ? (winding_number != 0) : ((winding_number % 2) != 0)); | 0 | ||||||||||||
| 329 | : ((winding_number % 2) != 0)); never executed: return (fillRule == Qt::WindingFill ? (winding_number != 0) : ((winding_number % 2) != 0)); | 0 | ||||||||||||
| 330 | } | - | ||||||||||||
| 331 | QPolygon QPolygon::united(const QPolygon &r) const | - | ||||||||||||
| 332 | { | - | ||||||||||||
| 333 | QPainterPath subject; subject.addPolygon(*this); | - | ||||||||||||
| 334 | QPainterPath clip; clip.addPolygon(r); | - | ||||||||||||
| 335 | - | |||||||||||||
| 336 | return never executed: subject.united(clip).toFillPolygon().toPolygon();return subject.united(clip).toFillPolygon().toPolygon();never executed: return subject.united(clip).toFillPolygon().toPolygon(); | 0 | ||||||||||||
| 337 | } | - | ||||||||||||
| 338 | QPolygon QPolygon::intersected(const QPolygon &r) const | - | ||||||||||||
| 339 | { | - | ||||||||||||
| 340 | QPainterPath subject; subject.addPolygon(*this); | - | ||||||||||||
| 341 | QPainterPath clip; clip.addPolygon(r); | - | ||||||||||||
| 342 | - | |||||||||||||
| 343 | return never executed: subject.intersected(clip).toFillPolygon().toPolygon();return subject.intersected(clip).toFillPolygon().toPolygon();never executed: return subject.intersected(clip).toFillPolygon().toPolygon(); | 0 | ||||||||||||
| 344 | } | - | ||||||||||||
| 345 | QPolygon QPolygon::subtracted(const QPolygon &r) const | - | ||||||||||||
| 346 | { | - | ||||||||||||
| 347 | QPainterPath subject; subject.addPolygon(*this); | - | ||||||||||||
| 348 | QPainterPath clip; clip.addPolygon(r); | - | ||||||||||||
| 349 | - | |||||||||||||
| 350 | return never executed: subject.subtracted(clip).toFillPolygon().toPolygon();return subject.subtracted(clip).toFillPolygon().toPolygon();never executed: return subject.subtracted(clip).toFillPolygon().toPolygon(); | 0 | ||||||||||||
| 351 | } | - | ||||||||||||
| 352 | QPolygonF QPolygonF::united(const QPolygonF &r) const | - | ||||||||||||
| 353 | { | - | ||||||||||||
| 354 | QPainterPath subject; subject.addPolygon(*this); | - | ||||||||||||
| 355 | QPainterPath clip; clip.addPolygon(r); | - | ||||||||||||
| 356 | - | |||||||||||||
| 357 | return never executed: subject.united(clip).toFillPolygon();return subject.united(clip).toFillPolygon();never executed: return subject.united(clip).toFillPolygon(); | 0 | ||||||||||||
| 358 | } | - | ||||||||||||
| 359 | QPolygonF QPolygonF::intersected(const QPolygonF &r) const | - | ||||||||||||
| 360 | { | - | ||||||||||||
| 361 | QPainterPath subject; subject.addPolygon(*this); | - | ||||||||||||
| 362 | QPainterPath clip; clip.addPolygon(r); | - | ||||||||||||
| 363 | - | |||||||||||||
| 364 | return never executed: subject.intersected(clip).toFillPolygon();return subject.intersected(clip).toFillPolygon();never executed: return subject.intersected(clip).toFillPolygon(); | 0 | ||||||||||||
| 365 | } | - | ||||||||||||
| 366 | QPolygonF QPolygonF::subtracted(const QPolygonF &r) const | - | ||||||||||||
| 367 | { | - | ||||||||||||
| 368 | QPainterPath subject; subject.addPolygon(*this); | - | ||||||||||||
| 369 | QPainterPath clip; clip.addPolygon(r); | - | ||||||||||||
| 370 | return never executed: subject.subtracted(clip).toFillPolygon();return subject.subtracted(clip).toFillPolygon();never executed: return subject.subtracted(clip).toFillPolygon(); | 0 | ||||||||||||
| 371 | } | - | ||||||||||||
| 372 | - | |||||||||||||
| 373 | - | |||||||||||||
| 374 | - | |||||||||||||
| 375 | - | |||||||||||||
| 376 | - | |||||||||||||
| 377 | QPolygonF::operator QVariant() const | - | ||||||||||||
| 378 | { | - | ||||||||||||
| 379 | return never executed: QVariant(QMetaType::QPolygonF, this);return QVariant(QMetaType::QPolygonF, this);never executed: return QVariant(QMetaType::QPolygonF, this); | 0 | ||||||||||||
| 380 | } | - | ||||||||||||
| 381 | - | |||||||||||||
| 382 | - | |||||||||||||
| Switch to Source code | Preprocessed file |