Qt 4.8
Classes | Macros | Typedefs | Functions | Variables
qtriangulator.cpp File Reference
#include "qtriangulator_p.h"
#include <QtGui/qdialog.h>
#include <QtGui/qevent.h>
#include <QtGui/qpainter.h>
#include <QtGui/qpainterpath.h>
#include <QtGui/private/qbezier_p.h>
#include <QtGui/private/qdatabuffer_p.h>
#include <QtCore/qbitarray.h>
#include <QtCore/qvarlengtharray.h>
#include <QtCore/qqueue.h>
#include <QtCore/qglobal.h>
#include <QtCore/qpoint.h>
#include <QtCore/qalgorithms.h>
#include <QtDebug>
#include <math.h>
#include <private/qgl_p.h>

Go to the source code of this file.

Classes

struct  QFraction
 
class  QInt64Set
 
struct  QIntersectionPoint
 
class  QMaxHeap< T >
 
struct  QPodPoint
 
struct  QRBTree< T >
 
struct  QRBTree< T >::Node
 
class  QRingBuffer< T >
 
class  QTriangulator< T >
 
class  QTriangulator< T >::ComplexToSimple
 
class  QTriangulator< T >::ComplexToSimple::CompareEdges
 
struct  QTriangulator< T >::ComplexToSimple::Edge
 
struct  QTriangulator< T >::ComplexToSimple::Event
 
struct  QTriangulator< T >::ComplexToSimple::Intersection
 
struct  QTriangulator< T >::ComplexToSimple::Split
 
class  QTriangulator< T >::MonotoneToTriangles
 
class  QTriangulator< T >::SimpleToMonotone
 
class  QTriangulator< T >::SimpleToMonotone::CompareVertices
 
struct  QTriangulator< T >::SimpleToMonotone::Edge
 
struct  QVertexSet< T >
 

Macros

#define Q_FIXED_POINT_SCALE   32
 

Typedefs

typedef QRBTree< int >::NodeQRBTreeIntNodePointer
 

Functions

static int compare (quint64 a, quint64 b)
 
static int comparePoints (const QPodPoint &u, const QPodPoint &v)
 
static quint64 gcd (quint64 x, quint64 y)
 
static int primeForCount (int count)
 
static int primeForNumBits (int numBits)
 
static int qCompareFractions (quint64 a, quint64 b, quint64 c, quint64 d)
 
static qint64 qCross (const QPodPoint &u, const QPodPoint &v)
 
static qint64 qDot (const QPodPoint &u, const QPodPoint &v)
 
static QFraction qFraction (quint64 n, quint64 d)
 
static QIntersectionPoint qIntersectionPoint (const QPodPoint &point)
 
static QIntersectionPoint qIntersectionPoint (int x, int y)
 
static QIntersectionPoint qIntersectionPoint (const QPodPoint &u1, const QPodPoint &u2, const QPodPoint &v1, const QPodPoint &v2)
 
static qint64 qPointDistanceFromLine (const QPodPoint &p, const QPodPoint &v1, const QPodPoint &v2)
 
static bool qPointIsLeftOfLine (const QPodPoint &p, const QPodPoint &v1, const QPodPoint &v2)
 
QPolylineSet qPolyline (const QVectorPath &path, const QTransform &matrix, qreal lod)
 
QPolylineSet qPolyline (const QPainterPath &path, const QTransform &matrix, qreal lod)
 
QTriangleSet qTriangulate (const qreal *polygon, int count, uint hint, const QTransform &matrix)
 
QTriangleSet qTriangulate (const QVectorPath &path, const QTransform &matrix, qreal lod)
 
QTriangleSet qTriangulate (const QPainterPath &path, const QTransform &matrix, qreal lod)
 
template<class T , class LessThan >
static void sort (T *array, int count, LessThan lessThan)
 
template<class T >
static void sort (T *array, int count)
 

Variables

static const uchar prime_deltas []
 

Macro Definition Documentation

◆ Q_FIXED_POINT_SCALE

#define Q_FIXED_POINT_SCALE   32

Typedef Documentation

◆ QRBTreeIntNodePointer

Definition at line 1313 of file qtriangulator.cpp.

Function Documentation

◆ compare()

static int compare ( quint64  a,
quint64  b 
)
inlinestatic

Definition at line 233 of file qtriangulator.cpp.

Referenced by qCompareFractions().

234 {
235  return (a > b) - (a < b);
236 }
long ASN1_INTEGER_get ASN1_INTEGER * a

◆ comparePoints()

static int comparePoints ( const QPodPoint u,
const QPodPoint v 
)
static

Definition at line 349 of file qtriangulator.cpp.

Referenced by QTriangulator< T >::ComplexToSimple::CompareEdges::operator()().

350 {
351  if (u.y < v.y)
352  return -1;
353  if (u.y > v.y)
354  return 1;
355  if (u.x < v.x)
356  return -1;
357  if (u.x > v.x)
358  return 1;
359  return 0;
360 }

◆ gcd()

static quint64 gcd ( quint64  x,
quint64  y 
)
inlinestatic

Definition at line 223 of file qtriangulator.cpp.

Referenced by qFraction().

224 {
225  while (y != 0) {
226  quint64 z = y;
227  y = x % y;
228  x = z;
229  }
230  return x;
231 }
unsigned __int64 quint64
Definition: qglobal.h:943

◆ primeForCount()

static int primeForCount ( int  count)
inlinestatic

Definition at line 1121 of file qtriangulator.cpp.

Referenced by QInt64Set::insert(), and QInt64Set::QInt64Set().

1122 {
1123  int low = 0;
1124  int high = 32;
1125  for (int i = 0; i < 5; ++i) {
1126  int mid = (high + low) / 2;
1127  if (count >= 1 << mid)
1128  low = mid;
1129  else
1130  high = mid;
1131  }
1132  return primeForNumBits(high);
1133 }
static int primeForNumBits(int numBits)

◆ primeForNumBits()

static int primeForNumBits ( int  numBits)
inlinestatic

Definition at line 1116 of file qtriangulator.cpp.

Referenced by primeForCount().

1117 {
1118  return (1 << numBits) + prime_deltas[numBits];
1119 }
static const uchar prime_deltas[]

◆ qCompareFractions()

static int qCompareFractions ( quint64  a,
quint64  b,
quint64  c,
quint64  d 
)
static

Definition at line 241 of file qtriangulator.cpp.

Referenced by QFraction::operator<().

242 {
243  const quint64 LIMIT = Q_UINT64_C(0x100000000);
244  for (;;) {
245  // If the products 'ad' and 'bc' fit into 64 bits, they can be directly compared.
246  if (b < LIMIT && d < LIMIT)
247  return compare(a * d, b * c);
248 
249  if (a == 0 || c == 0)
250  return compare(a, c);
251 
252  // a/b < c/d <=> d/c < b/a
253  quint64 b_div_a = b / a;
254  quint64 d_div_c = d / c;
255  if (b_div_a != d_div_c)
256  return compare(d_div_c, b_div_a);
257 
258  // floor(d/c) == floor(b/a)
259  // frac(d/c) < frac(b/a) ?
260  // frac(x/y) = (x%y)/y
261  d -= d_div_c * c; //d %= c;
262  b -= b_div_a * a; //b %= a;
263  qSwap(a, d);
264  qSwap(b, c);
265  }
266 }
double d
Definition: qnumeric_p.h:62
unsigned char c[8]
Definition: qnumeric_p.h:62
long ASN1_INTEGER_get ASN1_INTEGER * a
unsigned __int64 quint64
Definition: qglobal.h:943
static int compare(quint64 a, quint64 b)
void qSwap(T &value1, T &value2)
Definition: qglobal.h:2181
#define Q_UINT64_C(c)
Definition: qglobal.h:941

◆ qCross()

static qint64 qCross ( const QPodPoint u,
const QPodPoint v 
)
inlinestatic

Definition at line 321 of file qtriangulator.cpp.

Referenced by qIntersectionPoint(), qPointDistanceFromLine(), and QTriangulator< T >::ComplexToSimple::sortEdgeList().

322 {
323  return qint64(u.x) * qint64(v.y) - qint64(u.y) * qint64(v.x);
324 }
__int64 qint64
Definition: qglobal.h:942

◆ qDot()

static qint64 qDot ( const QPodPoint u,
const QPodPoint v 
)
inlinestatic

Definition at line 326 of file qtriangulator.cpp.

Referenced by QTriangulator< T >::ComplexToSimple::Event::operator<().

327 {
328  return qint64(u.x) * qint64(v.x) + qint64(u.y) * qint64(v.y);
329 }
__int64 qint64
Definition: qglobal.h:942

◆ qFraction()

static QFraction qFraction ( quint64  n,
quint64  d 
)
static

Definition at line 270 of file qtriangulator.cpp.

Referenced by QIntersectionPoint::isOnLine(), and qIntersectionPoint().

270  {
271  QFraction result;
272  if (n == 0) {
273  result.numerator = 0;
274  result.denominator = 1;
275  } else {
276  quint64 g = gcd(n, d);
277  result.numerator = n / g;
278  result.denominator = d / g;
279  }
280  return result;
281 }
double d
Definition: qnumeric_p.h:62
quint64 denominator
static quint64 gcd(quint64 x, quint64 y)
unsigned __int64 quint64
Definition: qglobal.h:943
quint64 numerator

◆ qIntersectionPoint() [1/3]

static QIntersectionPoint qIntersectionPoint ( const QPodPoint point)
inlinestatic

◆ qIntersectionPoint() [2/3]

static QIntersectionPoint qIntersectionPoint ( int  x,
int  y 
)
inlinestatic

Definition at line 391 of file qtriangulator.cpp.

392 {
393  // upperLeft = (x, y), xOffset = 0/1, yOffset = 0/1.
394  QIntersectionPoint p = {{x, y}, {0, 1}, {0, 1}};
395  return p;
396 }

◆ qIntersectionPoint() [3/3]

static QIntersectionPoint qIntersectionPoint ( const QPodPoint u1,
const QPodPoint u2,
const QPodPoint v1,
const QPodPoint v2 
)
static

Definition at line 398 of file qtriangulator.cpp.

399 {
400  QIntersectionPoint result = {{0, 0}, {0, 0}, {0, 0}};
401 
402  QPodPoint u = u2 - u1;
403  QPodPoint v = v2 - v1;
404  qint64 d1 = qCross(u, v1 - u1);
405  qint64 d2 = qCross(u, v2 - u1);
406  qint64 det = d2 - d1;
407  qint64 d3 = qCross(v, u1 - v1);
408  qint64 d4 = d3 - det; //qCross(v, u2 - v1);
409 
410  // Check that the math is correct.
411  Q_ASSERT(d4 == qCross(v, u2 - v1));
412 
413  // The intersection point can be expressed as:
414  // v1 - v * d1/det
415  // v2 - v * d2/det
416  // u1 + u * d3/det
417  // u2 + u * d4/det
418 
419  // I'm only interested in lines that are crossing, so ignore parallel lines even if they overlap.
420  if (det == 0)
421  return result;
422 
423  if (det < 0) {
424  det = -det;
425  d1 = -d1;
426  d2 = -d2;
427  d3 = -d3;
428  d4 = -d4;
429  }
430 
431  // I'm only interested in lines intersecting at their interior, not at their end points.
432  // The lines intersect at their interior if and only if 'd1 < 0', 'd2 > 0', 'd3 < 0' and 'd4 > 0'.
433  if (d1 >= 0 || d2 <= 0 || d3 <= 0 || d4 >= 0)
434  return result;
435 
436  // Calculate the intersection point as follows:
437  // v1 - v * d1/det | v1 <= v2 (component-wise)
438  // v2 - v * d2/det | v2 < v1 (component-wise)
439 
440  // Assuming 21 bits per vector component.
441  // TODO: Make code path for 31 bits per vector component.
442  if (v.x >= 0) {
443  result.upperLeft.x = v1.x + (-v.x * d1) / det;
444  result.xOffset = qFraction(quint64(-v.x * d1) % quint64(det), quint64(det));
445  } else {
446  result.upperLeft.x = v2.x + (-v.x * d2) / det;
447  result.xOffset = qFraction(quint64(-v.x * d2) % quint64(det), quint64(det));
448  }
449 
450  if (v.y >= 0) {
451  result.upperLeft.y = v1.y + (-v.y * d1) / det;
452  result.yOffset = qFraction(quint64(-v.y * d1) % quint64(det), quint64(det));
453  } else {
454  result.upperLeft.y = v2.y + (-v.y * d2) / det;
455  result.yOffset = qFraction(quint64(-v.y * d2) % quint64(det), quint64(det));
456  }
457 
458  Q_ASSERT(result.xOffset.isValid());
459  Q_ASSERT(result.yOffset.isValid());
460  return result;
461 }
static qint64 qCross(const QPodPoint &u, const QPodPoint &v)
quint16 u
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
unsigned __int64 quint64
Definition: qglobal.h:943
__int64 qint64
Definition: qglobal.h:942
bool isValid() const
static QFraction qFraction(quint64 n, quint64 d)

◆ qPointDistanceFromLine()

static qint64 qPointDistanceFromLine ( const QPodPoint p,
const QPodPoint v1,
const QPodPoint v2 
)
inlinestatic

◆ qPointIsLeftOfLine()

static bool qPointIsLeftOfLine ( const QPodPoint p,
const QPodPoint v1,
const QPodPoint v2 
)
inlinestatic

Definition at line 340 of file qtriangulator.cpp.

Referenced by QTriangulator< T >::MonotoneToTriangles::leftOfEdge(), QTriangulator< T >::SimpleToMonotone::monotoneDecomposition(), and QTriangulator< T >::SimpleToMonotone::pointIsInSector().

341 {
342  return QT_PREPEND_NAMESPACE(qPointDistanceFromLine)(p, v1, v2) < 0;
343 }
static qint64 qPointDistanceFromLine(const QPodPoint &p, const QPodPoint &v1, const QPodPoint &v2)
#define QT_PREPEND_NAMESPACE(name)
This macro qualifies identifier with the full namespace.
Definition: qglobal.h:87

◆ qPolyline() [1/2]

QPolylineSet qPolyline ( const QVectorPath path,
const QTransform matrix,
qreal  lod 
)

Definition at line 3077 of file qtriangulator.cpp.

3079 {
3080  QPolylineSet polyLineSet;
3082  QTriangulator<quint32> triangulator;
3083  triangulator.initialize(path, matrix, lod);
3084  QVertexSet<quint32> vertexSet = triangulator.polyline();
3085  polyLineSet.vertices = vertexSet.vertices;
3086  polyLineSet.indices.setDataUint(vertexSet.indices);
3087  } else {
3088  QTriangulator<quint16> triangulator;
3089  triangulator.initialize(path, matrix, lod);
3090  QVertexSet<quint16> vertexSet = triangulator.triangulate();
3091  polyLineSet.vertices = vertexSet.vertices;
3092  polyLineSet.indices.setDataUshort(vertexSet.indices);
3093  }
3094  return polyLineSet;
3095 }
QVertexSet< T > triangulate()
void setDataUint(const QVector< quint32 > &data)
QVector< qreal > vertices
QVertexIndexVector indices
void setDataUshort(const QVector< quint16 > &data)
QVertexSet< T > polyline()
QVector< qreal > vertices
void initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix)
static Extensions glExtensions()
Definition: qgl.cpp:5781
QVector< T > indices

◆ qPolyline() [2/2]

QPolylineSet qPolyline ( const QPainterPath path,
const QTransform matrix,
qreal  lod 
)

Definition at line 3097 of file qtriangulator.cpp.

3099 {
3100  QPolylineSet polyLineSet;
3102  QTriangulator<quint32> triangulator;
3103  triangulator.initialize(path, matrix, lod);
3104  QVertexSet<quint32> vertexSet = triangulator.polyline();
3105  polyLineSet.vertices = vertexSet.vertices;
3106  polyLineSet.indices.setDataUint(vertexSet.indices);
3107  } else {
3108  QTriangulator<quint16> triangulator;
3109  triangulator.initialize(path, matrix, lod);
3110  QVertexSet<quint16> vertexSet = triangulator.triangulate();
3111  polyLineSet.vertices = vertexSet.vertices;
3112  polyLineSet.indices.setDataUshort(vertexSet.indices);
3113  }
3114  return polyLineSet;
3115 }
QVertexSet< T > triangulate()
void setDataUint(const QVector< quint32 > &data)
QVector< qreal > vertices
QVertexIndexVector indices
void setDataUshort(const QVector< quint16 > &data)
QVertexSet< T > polyline()
QVector< qreal > vertices
void initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix)
static Extensions glExtensions()
Definition: qgl.cpp:5781
QVector< T > indices

◆ qTriangulate() [1/3]

QTriangleSet qTriangulate ( const qreal polygon,
int  count,
uint  hint,
const QTransform matrix 
)

Definition at line 3016 of file qtriangulator.cpp.

Referenced by QGL2PaintEngineExPrivate::fill().

3018 {
3019  QTriangleSet triangleSet;
3021  QTriangulator<quint32> triangulator;
3022  triangulator.initialize(polygon, count, hint, matrix);
3023  QVertexSet<quint32> vertexSet = triangulator.triangulate();
3024  triangleSet.vertices = vertexSet.vertices;
3025  triangleSet.indices.setDataUint(vertexSet.indices);
3026 
3027  } else {
3028  QTriangulator<quint16> triangulator;
3029  triangulator.initialize(polygon, count, hint, matrix);
3030  QVertexSet<quint16> vertexSet = triangulator.triangulate();
3031  triangleSet.vertices = vertexSet.vertices;
3032  triangleSet.indices.setDataUshort(vertexSet.indices);
3033  }
3034  return triangleSet;
3035 }
QVertexSet< T > triangulate()
QVertexIndexVector indices
void setDataUint(const QVector< quint32 > &data)
QVector< qreal > vertices
void setDataUshort(const QVector< quint16 > &data)
QVector< qreal > vertices
void initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix)
static Extensions glExtensions()
Definition: qgl.cpp:5781
QVector< T > indices

◆ qTriangulate() [2/3]

QTriangleSet qTriangulate ( const QVectorPath path,
const QTransform matrix,
qreal  lod 
)

Definition at line 3037 of file qtriangulator.cpp.

3039 {
3040  QTriangleSet triangleSet;
3042  QTriangulator<quint32> triangulator;
3043  triangulator.initialize(path, matrix, lod);
3044  QVertexSet<quint32> vertexSet = triangulator.triangulate();
3045  triangleSet.vertices = vertexSet.vertices;
3046  triangleSet.indices.setDataUint(vertexSet.indices);
3047  } else {
3048  QTriangulator<quint16> triangulator;
3049  triangulator.initialize(path, matrix, lod);
3050  QVertexSet<quint16> vertexSet = triangulator.triangulate();
3051  triangleSet.vertices = vertexSet.vertices;
3052  triangleSet.indices.setDataUshort(vertexSet.indices);
3053  }
3054  return triangleSet;
3055 }
QVertexSet< T > triangulate()
QVertexIndexVector indices
void setDataUint(const QVector< quint32 > &data)
QVector< qreal > vertices
void setDataUshort(const QVector< quint16 > &data)
QVector< qreal > vertices
void initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix)
static Extensions glExtensions()
Definition: qgl.cpp:5781
QVector< T > indices

◆ qTriangulate() [3/3]

QTriangleSet qTriangulate ( const QPainterPath path,
const QTransform matrix,
qreal  lod 
)

Definition at line 3057 of file qtriangulator.cpp.

3059 {
3060  QTriangleSet triangleSet;
3062  QTriangulator<quint32> triangulator;
3063  triangulator.initialize(path, matrix, lod);
3064  QVertexSet<quint32> vertexSet = triangulator.triangulate();
3065  triangleSet.vertices = vertexSet.vertices;
3066  triangleSet.indices.setDataUint(vertexSet.indices);
3067  } else {
3068  QTriangulator<quint16> triangulator;
3069  triangulator.initialize(path, matrix, lod);
3070  QVertexSet<quint16> vertexSet = triangulator.triangulate();
3071  triangleSet.vertices = vertexSet.vertices;
3072  triangleSet.indices.setDataUshort(vertexSet.indices);
3073  }
3074  return triangleSet;
3075 }
QVertexSet< T > triangulate()
QVertexIndexVector indices
void setDataUint(const QVector< quint32 > &data)
QVector< qreal > vertices
void setDataUshort(const QVector< quint16 > &data)
QVector< qreal > vertices
void initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix)
static Extensions glExtensions()
Definition: qgl.cpp:5781
QVector< T > indices

◆ sort() [1/2]

template<class T , class LessThan >
static void sort ( T *  array,
int  count,
LessThan  lessThan 
)
static

Definition at line 73 of file qtriangulator.cpp.

Referenced by QSortFilterProxyModelPrivate::_q_sourceColumnsInserted(), QSortFilterProxyModelPrivate::_q_sourceReset(), QSortFilterProxyModelPrivate::_q_sourceRowsInserted(), QSortFilterProxyModelPrivate::create_index(), QTriangulator< T >::ComplexToSimple::fillPriorityQueue(), QTriangulator< T >::SimpleToMonotone::fillPriorityQueue(), QTableModel::index(), QStandardItemModelPrivate::itemFromIndex(), QStringList::QStringList(), QDir::setSorting(), QAbstractItemModel::sibling(), sort(), QDir::temp(), and QPatternist::NodeSortExpression::wrapAround().

75 {
76  // If the number of elements fall below some threshold, use insertion sort.
77  const int INSERTION_SORT_LIMIT = 7; // About 7 is fastest on my computer...
78  if (count <= INSERTION_SORT_LIMIT) {
79  for (int i = 1; i < count; ++i) {
80  T temp = array[i];
81  int j = i;
82  while (j > 0 && lessThan(temp, array[j - 1])) {
83  array[j] = array[j - 1];
84  --j;
85  }
86  array[j] = temp;
87  }
88  return;
89  }
90 
91  int high = count - 1;
92  int low = 0;
93  int mid = high / 2;
94  if (lessThan(array[mid], array[low]))
95  qSwap(array[mid], array[low]);
96  if (lessThan(array[high], array[mid]))
97  qSwap(array[high], array[mid]);
98  if (lessThan(array[mid], array[low]))
99  qSwap(array[mid], array[low]);
100 
101  --high;
102  ++low;
103  qSwap(array[mid], array[high]);
104  int pivot = high;
105  --high;
106 
107  while (low <= high) {
108  while (!lessThan(array[pivot], array[low])) {
109  ++low;
110  if (low > high)
111  goto sort_loop_end;
112  }
113  while (!lessThan(array[high], array[pivot])) {
114  --high;
115  if (low > high)
116  goto sort_loop_end;
117  }
118  qSwap(array[low], array[high]);
119  ++low;
120  --high;
121  }
122 sort_loop_end:
123  if (low != pivot)
124  qSwap(array[pivot], array[low]);
125  sort(array, low, lessThan);
126  sort(array + low + 1, count - low - 1, lessThan);
127 }
static bool lessThan(const QChar *a, int l, const char *c)
Definition: qurl.cpp:3253
static void sort(T *array, int count, LessThan lessThan)
void qSwap(T &value1, T &value2)
Definition: qglobal.h:2181

◆ sort() [2/2]

template<class T >
static void sort ( T *  array,
int  count 
)
static

Definition at line 134 of file qtriangulator.cpp.

136 {
137  // If the number of elements fall below some threshold, use insertion sort.
138  const int INSERTION_SORT_LIMIT = 25; // About 25 is fastest on my computer...
139  if (count <= INSERTION_SORT_LIMIT) {
140  for (int i = 1; i < count; ++i) {
141  T temp = array[i];
142  int j = i;
143  while (j > 0 && (temp < array[j - 1])) {
144  array[j] = array[j - 1];
145  --j;
146  }
147  array[j] = temp;
148  }
149  return;
150  }
151 
152  int high = count - 1;
153  int low = 0;
154  int mid = high / 2;
155  if ((array[mid] < array[low]))
156  qSwap(array[mid], array[low]);
157  if ((array[high] < array[mid]))
158  qSwap(array[high], array[mid]);
159  if ((array[mid] < array[low]))
160  qSwap(array[mid], array[low]);
161 
162  --high;
163  ++low;
164  qSwap(array[mid], array[high]);
165  int pivot = high;
166  --high;
167 
168  while (low <= high) {
169  while (!(array[pivot] < array[low])) {
170  ++low;
171  if (low > high)
172  goto sort_loop_end;
173  }
174  while (!(array[high] < array[pivot])) {
175  --high;
176  if (low > high)
177  goto sort_loop_end;
178  }
179  qSwap(array[low], array[high]);
180  ++low;
181  --high;
182  }
183 sort_loop_end:
184  if (low != pivot)
185  qSwap(array[pivot], array[low]);
186  sort(array, low);
187  sort(array + low + 1, count - low - 1);
188 }
static void sort(T *array, int count, LessThan lessThan)
void qSwap(T &value1, T &value2)
Definition: qglobal.h:2181

Variable Documentation

◆ prime_deltas

const uchar prime_deltas[]
static
Initial value:
= {
0, 0, 1, 3, 1, 5, 3, 3, 1, 9, 7, 5, 3, 9, 25, 3,
1, 21, 3, 21, 7, 15, 9, 5, 3, 29, 15, 0, 0, 0, 0, 0
}

Definition at line 1110 of file qtriangulator.cpp.