Qt 4.8
Classes | Public Types | Public Functions | Public Variables | Private Functions | List of all members
QTessellatorPrivate Class Reference

Classes

struct  Edge
 
class  EdgeSorter
 
struct  Intersection
 
struct  IntersectionLink
 
class  Scanline
 
struct  Vertex
 
struct  Vertices
 

Public Types

typedef QMap< Intersection, IntersectionLinkIntersections
 

Public Functions

void addEdges ()
 
void addIntersections ()
 
void cancelCoincidingEdges ()
 
QRectF collectAndSortVertices (const QPointF *points, int *maxActiveEdges)
 
void emitEdges (QTessellator *tessellator)
 
void processIntersections ()
 
 QTessellatorPrivate ()
 
void removeEdges ()
 

Public Variables

int currentVertex
 
Intersections intersections
 
Scanline scanline
 
Vertices vertices
 
bool winding
 
Q27Dot5 y
 

Private Functions

void addIntersection (const Edge *e1, const Edge *e2)
 
bool edgeInChain (Intersection i, int edge)
 

Detailed Description

Definition at line 74 of file qtessellator.cpp.

Typedefs

◆ Intersections

Definition at line 109 of file qtessellator.cpp.

Constructors and Destructors

◆ QTessellatorPrivate()

QTessellatorPrivate::QTessellatorPrivate ( )
inline

Definition at line 78 of file qtessellator.cpp.

Referenced by QTessellator::QTessellator().

78 {}

Functions

◆ addEdges()

void QTessellatorPrivate::addEdges ( )

Definition at line 950 of file qtessellator.cpp.

Referenced by QTessellatorPrivate().

951 {
952  while (currentVertex < vertices.nPoints) {
953  const Vertex *v = vertices.sorted[currentVertex];
954  if (v->y > y)
955  break;
956  if (v->flags & LineBeforeStarts) {
957  // add new edge
958  int start = vertices.prevPos(v);
959  Edge e(vertices, start);
960  int pos = scanline.findEdgePosition(e);
961  QDEBUG() << " adding edge" << start << "at position" << pos;
962  scanline.insert(pos, e);
963  if (!mark_clever || !(v->flags & LineAfterEnds)) {
964  if (pos > 0)
965  scanline.edges[pos - 1]->mark = true;
966  if (pos < scanline.size - 1)
967  scanline.edges[pos + 1]->mark = true;
968  }
969  }
970  if (v->flags & LineAfterStarts) {
972  int pos = scanline.findEdgePosition(e);
973  QDEBUG() << " adding edge" << vertices.position(v) << "at position" << pos;
974  scanline.insert(pos, e);
975  if (!mark_clever || !(v->flags & LineBeforeEnds)) {
976  if (pos > 0)
977  scanline.edges[pos - 1]->mark = true;
978  if (pos < scanline.size - 1)
979  scanline.edges[pos + 1]->mark = true;
980  }
981  }
982  if (v->flags & LineAfterHorizontal) {
983  int pos1 = scanline.findEdgePosition(v->x, v->y);
984  const Vertex *next = vertices.next(v);
985  Q_ASSERT(v->y == next->y);
986  int pos2 = scanline.findEdgePosition(next->x, next->y);
987  if (pos2 < pos1)
988  qSwap(pos1, pos2);
989  if (pos1 > 0)
990  --pos1;
991  if (pos2 == scanline.size)
992  --pos2;
993  //QDEBUG() << "marking horizontal edge from " << pos1 << "to" << pos2;
994  scanline.markEdges(pos1, pos2);
995  }
996  ++currentVertex;
997  }
998 }
void markEdges(int pos1, int pos2)
int findEdgePosition(Q27Dot5 x, Q27Dot5 y) const
int position(const Vertex *v) const
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define QDEBUG
void qSwap(T &value1, T &value2)
Definition: qglobal.h:2181
int prevPos(const Vertex *v) const
static const bool mark_clever
void insert(int pos, const Edge &e)

◆ addIntersection()

void QTessellatorPrivate::addIntersection ( const Edge e1,
const Edge e2 
)
private

Definition at line 1055 of file qtessellator.cpp.

Referenced by addIntersections().

1056 {
1057  const IntersectionLink emptyLink = {-1, -1};
1058 
1059  int next = vertices.nextPos(vertices[e1->edge]);
1060  if (e2->edge == next)
1061  return;
1062  int prev = vertices.prevPos(vertices[e1->edge]);
1063  if (e2->edge == prev)
1064  return;
1065 
1066  Q27Dot5 yi;
1067  bool det_positive;
1068  bool isect = e1->intersect(*e2, &yi, &det_positive);
1069  QDEBUG("checking edges %d and %d", e1->edge, e2->edge);
1070  if (!isect) {
1071  QDEBUG() << " no intersection";
1072  return;
1073  }
1074 
1075  // don't emit an intersection if it's at the start of a line segment or above us
1076  if (yi <= y) {
1077  if (!det_positive)
1078  return;
1079  QDEBUG() << " ----->>>>>> WRONG ORDER!";
1080  yi = y;
1081  }
1082  QDEBUG() << " between edges " << e1->edge << "and" << e2->edge << "at point ("
1083  << Q27Dot5ToDouble(yi) << ')';
1084 
1085  Intersection i1;
1086  i1.y = yi;
1087  i1.edge = e1->edge;
1088  IntersectionLink link1 = intersections.value(i1, emptyLink);
1089  Intersection i2;
1090  i2.y = yi;
1091  i2.edge = e2->edge;
1092  IntersectionLink link2 = intersections.value(i2, emptyLink);
1093 
1094  // new pair of edges
1095  if (link1.next == -1 && link2.next == -1) {
1096  link1.next = link1.prev = i2.edge;
1097  link2.next = link2.prev = i1.edge;
1098  } else if (link1.next == i2.edge || link1.prev == i2.edge
1099  || link2.next == i1.edge || link2.prev == i1.edge) {
1100 #ifdef DEBUG
1101  checkLinkChain(intersections, i1);
1102  checkLinkChain(intersections, i2);
1103  Q_ASSERT(edgeInChain(i1, i2.edge));
1104 #endif
1105  return;
1106  } else if (link1.next == -1 || link2.next == -1) {
1107  if (link2.next == -1) {
1108  qSwap(i1, i2);
1109  qSwap(link1, link2);
1110  }
1111  Q_ASSERT(link1.next == -1);
1112 #ifdef DEBUG
1113  checkLinkChain(intersections, i2);
1114 #endif
1115  // only i2 in list
1116  link1.next = i2.edge;
1117  link1.prev = link2.prev;
1118  link2.prev = i1.edge;
1119  Intersection other;
1120  other.y = yi;
1121  other.edge = link1.prev;
1122  IntersectionLink link = intersections.value(other, emptyLink);
1123  Q_ASSERT(link.next == i2.edge);
1124  Q_ASSERT(link.prev != -1);
1125  link.next = i1.edge;
1126  intersections.insert(other, link);
1127  } else {
1128  bool connected = edgeInChain(i1, i2.edge);
1129  if (connected)
1130  return;
1131 #ifdef DEBUG
1132  checkLinkChain(intersections, i1);
1133  checkLinkChain(intersections, i2);
1134 #endif
1135  // both already in some list. Have to make sure they are connected
1136  // this can be done by cutting open the ring(s) after the two eges and
1137  // connecting them again
1138  Intersection other1;
1139  other1.y = yi;
1140  other1.edge = link1.next;
1141  IntersectionLink linko1 = intersections.value(other1, emptyLink);
1142  Intersection other2;
1143  other2.y = yi;
1144  other2.edge = link2.next;
1145  IntersectionLink linko2 = intersections.value(other2, emptyLink);
1146 
1147  linko1.prev = i2.edge;
1148  link2.next = other1.edge;
1149 
1150  linko2.prev = i1.edge;
1151  link1.next = other2.edge;
1152  intersections.insert(other1, linko1);
1153  intersections.insert(other2, linko2);
1154  }
1155  intersections.insert(i1, link1);
1156  intersections.insert(i2, link2);
1157 #ifdef DEBUG
1158  checkLinkChain(intersections, i1);
1159  checkLinkChain(intersections, i2);
1160  Q_ASSERT(edgeInChain(i1, i2.edge));
1161 #endif
1162  return;
1163 
1164 }
#define Q27Dot5ToDouble(i)
int nextPos(const Vertex *v) const
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
bool edgeInChain(Intersection i, int edge)
#define QDEBUG
static QIntfbScreen * connected
const T value(const Key &key) const
Returns the value associated with the key key.
Definition: qmap.h:499
int Q27Dot5
void qSwap(T &value1, T &value2)
Definition: qglobal.h:2181
Intersections intersections
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
Definition: qmap.h:559
int prevPos(const Vertex *v) const

◆ addIntersections()

void QTessellatorPrivate::addIntersections ( )

Definition at line 1167 of file qtessellator.cpp.

Referenced by QTessellatorPrivate().

1168 {
1169  if (scanline.size) {
1170  QDEBUG() << "INTERSECTIONS";
1171  // check marked edges for intersections
1172 #ifdef DEBUG
1173  for (int i = 0; i < scanline.size; ++i) {
1174  Edge *e = scanline.edges[i];
1175  QDEBUG() << " " << i << e->edge << "isect=(" << e->intersect_left << e->intersect_right
1176  << ')';
1177  }
1178 #endif
1179 
1180  for (int i = 0; i < scanline.size - 1; ++i) {
1181  Edge *e1 = scanline.edges[i];
1182  Edge *e2 = scanline.edges[i + 1];
1183  // check for intersection
1184  if (e1->intersect_right || e2->intersect_left)
1185  addIntersection(e1, e2);
1186  }
1187  }
1188 #if 0
1189  if (intersections.constBegin().key().y == y) {
1190  QDEBUG() << "----------------> intersection on same line";
1191  scanline.clearMarks();
1192  scanline.processIntersections(y, &intersections);
1193  goto redo;
1194  }
1195 #endif
1196 }
#define QDEBUG
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the map.
Definition: qmap.h:374
Intersections intersections
void addIntersection(const Edge *e1, const Edge *e2)

◆ cancelCoincidingEdges()

void QTessellatorPrivate::cancelCoincidingEdges ( )

Definition at line 725 of file qtessellator.cpp.

Referenced by QTessellatorPrivate().

726 {
727  Vertex **vv = vertices.sorted;
728 
729  QCoincidingEdge *tl = 0;
730  int tlSize = 0;
731 
732  for (int i = 0; i < vertices.nPoints - 1; ++i) {
733  Vertex *v = vv[i];
734  int testListSize = 0;
735  while (i < vertices.nPoints - 1) {
736  Vertex *n = vv[i];
737  if (v->x != n->x || v->y != n->y)
738  break;
739 
740  if (testListSize > tlSize - 2) {
741  tlSize = qMax(tlSize*2, 16);
742  tl = q_check_ptr((QCoincidingEdge *)realloc(tl, tlSize*sizeof(QCoincidingEdge)));
743  }
744  if (n->flags & (LineBeforeStarts|LineBeforeHorizontal)) {
745  tl[testListSize].start = n;
746  tl[testListSize].end = vertices.prev(n);
747  tl[testListSize].used = false;
748  tl[testListSize].before = true;
749  ++testListSize;
750  }
751  if (n->flags & (LineAfterStarts|LineAfterHorizontal)) {
752  tl[testListSize].start = n;
753  tl[testListSize].end = vertices.next(n);
754  tl[testListSize].used = false;
755  tl[testListSize].before = false;
756  ++testListSize;
757  }
758  ++i;
759  }
760  if (!testListSize)
761  continue;
762 
763  qSort(tl, tl + testListSize);
764 
765  for (int j = 0; j < testListSize; ++j) {
766  if (tl[j].used)
767  continue;
768 
769  for (int k = j + 1; k < testListSize; ++k) {
770  if (tl[j].end->x != tl[k].end->x
771  || tl[j].end->y != tl[k].end->y
772  || tl[k].used)
773  break;
774 
775  if (!winding || tl[j].before != tl[k].before) {
776  cancelEdges(tl[j], tl[k]);
777  break;
778  }
779  ++k;
780  }
781  ++j;
782  }
783  }
784  free(tl);
785 }
T * q_check_ptr(T *p)
Definition: qglobal.h:1857
QTessellatorPrivate::Vertex * end
QTessellatorPrivate::Vertex * start
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
static void cancelEdges(QCoincidingEdge &e1, QCoincidingEdge &e2)
void qSort(RandomAccessIterator start, RandomAccessIterator end)
Definition: qalgorithms.h:177
static const KeyPair *const end

◆ collectAndSortVertices()

QRectF QTessellatorPrivate::collectAndSortVertices ( const QPointF points,
int *  maxActiveEdges 
)

Definition at line 606 of file qtessellator.cpp.

Referenced by QTessellatorPrivate().

607 {
608  *maxActiveEdges = 0;
609  Vertex *v = vertices.storage;
610  Vertex **vv = vertices.sorted;
611 
612  qreal xmin(points[0].x());
613  qreal xmax(points[0].x());
614  qreal ymin(points[0].y());
615  qreal ymax(points[0].y());
616 
617  // collect vertex data
618  Q27Dot5 y_prev = FloatToQ27Dot5(points[vertices.nPoints-1].y());
619  Q27Dot5 x_next = FloatToQ27Dot5(points[0].x());
620  Q27Dot5 y_next = FloatToQ27Dot5(points[0].y());
621  int j = 0;
622  int i = 0;
623  while (i < vertices.nPoints) {
624  Q27Dot5 y_curr = y_next;
625 
626  *vv = v;
627 
628  v->x = x_next;
629  v->y = y_next;
630  v->flags = 0;
631 
632  next_point:
633 
634  xmin = qMin(xmin, points[i+1].x());
635  xmax = qMax(xmax, points[i+1].x());
636  ymin = qMin(ymin, points[i+1].y());
637  ymax = qMax(ymax, points[i+1].y());
638 
639  y_next = FloatToQ27Dot5(points[i+1].y());
640  x_next = FloatToQ27Dot5(points[i+1].x());
641 
642  // skip vertices on top of each other
643  if (v->x == x_next && v->y == y_next) {
644  ++i;
645  if (i < vertices.nPoints)
646  goto next_point;
647  Vertex *v0 = vertices.storage;
649  if (y_prev < y_curr)
650  v0->flags |= LineBeforeEnds;
651  else if (y_prev > y_curr)
652  v0->flags |= LineBeforeStarts;
653  else
654  v0->flags |= LineBeforeHorizontal;
655  if ((v0->flags & (LineBeforeStarts|LineAfterStarts))
656  && !(v0->flags & (LineAfterEnds|LineBeforeEnds)))
657  *maxActiveEdges += 2;
658  break;
659  }
660 
661  if (y_prev < y_curr)
662  v->flags |= LineBeforeEnds;
663  else if (y_prev > y_curr)
664  v->flags |= LineBeforeStarts;
665  else
666  v->flags |= LineBeforeHorizontal;
667 
668 
669  if (y_curr < y_next)
670  v->flags |= LineAfterStarts;
671  else if (y_curr > y_next)
672  v->flags |= LineAfterEnds;
673  else
674  v->flags |= LineAfterHorizontal;
675  // ### could probably get better limit by looping over sorted list and counting down on ending edges
676  if ((v->flags & (LineBeforeStarts|LineAfterStarts))
677  && !(v->flags & (LineAfterEnds|LineBeforeEnds)))
678  *maxActiveEdges += 2;
679  y_prev = y_curr;
680  ++v;
681  ++vv;
682  ++j;
683  ++i;
684  }
685  vertices.nPoints = j;
686 
687  QDEBUG() << "maxActiveEdges=" << *maxActiveEdges;
688  vv = vertices.sorted;
689  qSort(vv, vv + vertices.nPoints, compareVertex);
690 
691  return QRectF(xmin, ymin, xmax-xmin, ymax-ymin);
692 }
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
static bool compareVertex(const QTessellatorPrivate::Vertex *p1, const QTessellatorPrivate::Vertex *p2)
#define FloatToQ27Dot5(i)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define QDEBUG
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
int Q27Dot5
void qSort(RandomAccessIterator start, RandomAccessIterator end)
Definition: qalgorithms.h:177
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287

◆ edgeInChain()

bool QTessellatorPrivate::edgeInChain ( Intersection  i,
int  edge 
)
private

Definition at line 1027 of file qtessellator.cpp.

Referenced by addIntersection().

1028 {
1029  int end = i.edge;
1030  while (1) {
1031  if (i.edge == edge)
1032  return true;
1033  IntersectionLink l = intersections.value(i);
1034  if (l.next == end)
1035  break;
1036  Q_ASSERT(l.next != -1);
1037  Q_ASSERT(l.prev != -1);
1038 
1039  Intersection i2 = i;
1040  i2.edge = l.next;
1041 
1042 #ifndef QT_NO_DEBUG
1043  IntersectionLink l2 = intersections.value(i2);
1044  Q_ASSERT(l2.next != -1);
1045  Q_ASSERT(l2.prev != -1);
1046  Q_ASSERT(l.next == i2.edge);
1047  Q_ASSERT(l2.prev == i.edge);
1048 #endif
1049  i = i2;
1050  }
1051  return false;
1052 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const T value(const Key &key) const
Returns the value associated with the key key.
Definition: qmap.h:499
Intersections intersections
QFactoryLoader * l
static const KeyPair *const end

◆ emitEdges()

void QTessellatorPrivate::emitEdges ( QTessellator tessellator)

Definition at line 788 of file qtessellator.cpp.

Referenced by QTessellatorPrivate().

789 {
790  //QDEBUG() << "TRAPS:";
791  if (!scanline.old_size)
792  return;
793 
794  // emit edges
795  if (winding) {
796  // winding fill rule
797  int w = 0;
798 
799  scanline.old[0]->y_left = y;
800 
801  for (int i = 0; i < scanline.old_size - 1; ++i) {
802  Edge *left = scanline.old[i];
803  Edge *right = scanline.old[i+1];
804  w += left->winding;
805 // qDebug() << "i=" << i << "edge->winding=" << left->winding << "winding=" << winding;
806  if (w == 0) {
807  left->y_right = y;
808  right->y_left = y;
809  } else if (!emit_clever || left->mark || right->mark) {
810  Q27Dot5 top = qMax(left->y_right, right->y_left);
811  if (top != y) {
813  fillTrapezoid(top, y, left->edge, right->edge, vertices, &trap);
814  tessellator->addTrap(trap);
815 // QDEBUG() << " top=" << Q27Dot5ToDouble(top) << "left=" << left->edge << "right=" << right->edge;
816  }
817  right->y_left = y;
818  left->y_right = y;
819  }
820  left->mark = false;
821  }
822  if (scanline.old[scanline.old_size - 1]->mark) {
824  scanline.old[scanline.old_size - 1]->mark = false;
825  }
826  } else {
827  // odd-even fill rule
828  for (int i = 0; i < scanline.old_size; i += 2) {
829  Edge *left = scanline.old[i];
830  Edge *right = scanline.old[i+1];
831  if (!emit_clever || left->mark || right->mark) {
832  Q27Dot5 top = qMax(left->y_right, right->y_left);
833  if (top != y) {
835  fillTrapezoid(top, y, left->edge, right->edge, vertices, &trap);
836  tessellator->addTrap(trap);
837  }
838 // QDEBUG() << " top=" << Q27Dot5ToDouble(top) << "left=" << left->edge << "right=" << right->edge;
839  left->y_left = y;
840  left->y_right = y;
841  right->y_left = y;
842  right->y_right = y;
843  left->mark = right->mark = false;
844  }
845  }
846  }
847 }
static const bool emit_clever
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
static void fillTrapezoid(Q27Dot5 y1, Q27Dot5 y2, int left, int right, const QTessellatorPrivate::Vertices &vertices, QTessellator::Trapezoid *trap)
int Q27Dot5
virtual void addTrap(const Trapezoid &trap)=0
Q_CORE_EXPORT QTextStream & left(QTextStream &s)

◆ processIntersections()

void QTessellatorPrivate::processIntersections ( )

Definition at line 850 of file qtessellator.cpp.

Referenced by QTessellatorPrivate().

851 {
852  QDEBUG() << "PROCESS INTERSECTIONS";
853  // process intersections
854  while (!intersections.isEmpty()) {
856  if (it.key().y != y)
857  break;
858 
859  // swap edges
860  QDEBUG() << " swapping intersecting edges ";
861  int min = scanline.size;
862  int max = 0;
863  Q27Dot5 xmin = INT_MAX;
864  Q27Dot5 xmax = INT_MIN;
865  int num = 0;
866  while (1) {
867  const Intersection &i = it.key();
868  int next = it->next;
869 
870  int edgePos = scanline.findEdge(i.edge);
871  if (edgePos >= 0) {
872  ++num;
873  min = qMin(edgePos, min);
874  max = qMax(edgePos, max);
875  Edge *edge = scanline.edges[edgePos];
876  xmin = qMin(xmin, edge->positionAt(y));
877  xmax = qMax(xmax, edge->positionAt(y));
878  }
879  Intersection key;
880  key.y = y;
881  key.edge = next;
882  it = intersections.find(key);
884  if (it == intersections.end())
885  break;
886  }
887  if (num < 2)
888  continue;
889 
890  Q_ASSERT(min != max);
891  QDEBUG() << "sorting between" << min << "and" << max << "xpos=" << xmin << xmax;
892  while (min > 0 && scanline.edges[min - 1]->positionAt(y) >= xmin) {
893  QDEBUG() << " adding edge on left";
894  --min;
895  }
896  while (max + 1 < scanline.size && scanline.edges[max + 1]->positionAt(y) <= xmax) {
897  QDEBUG() << " adding edge on right";
898  ++max;
899  }
900 
901  qSort(scanline.edges + min, scanline.edges + max + 1, EdgeSorter(y));
902 #ifdef DEBUG
903  for (int i = min; i <= max; ++i)
904  QDEBUG() << " " << scanline.edges[i]->edge << "at pos" << i;
905 #endif
906  for (int i = min; i <= max; ++i) {
907  Edge *edge = scanline.edges[i];
908  edge->intersect_left = true;
909  edge->intersect_right = true;
910  edge->mark = true;
911  }
912  }
913 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
#define it(className, varName)
iterator find(const Key &key)
Returns an iterator pointing to the item with key key in the map.
Definition: qmap.h:618
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define QDEBUG
Q27Dot5 positionAt(Q27Dot5 y) const
int Q27Dot5
void qSort(RandomAccessIterator start, RandomAccessIterator end)
Definition: qalgorithms.h:177
iterator begin()
Returns an STL-style iterator pointing to the first item in the map.
Definition: qmap.h:372
int remove(const Key &key)
Removes all the items that have the key key from the map.
Definition: qmap.h:662
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the map...
Definition: qmap.h:375
Intersections intersections
int key
bool isEmpty() const
Returns true if the map contains no items; otherwise returns false.
Definition: qmap.h:203
int findEdge(int edge) const
#define INT_MAX

◆ removeEdges()

void QTessellatorPrivate::removeEdges ( )

Definition at line 915 of file qtessellator.cpp.

Referenced by QTessellatorPrivate().

916 {
917  int cv = currentVertex;
918  while (cv < vertices.nPoints) {
919  const Vertex *v = vertices.sorted[cv];
920  if (v->y > y)
921  break;
922  if (v->flags & LineBeforeEnds) {
923  QDEBUG() << " removing edge" << vertices.prevPos(v);
924  int pos = scanline.findEdge(vertices.prevPos(v));
925  if (pos == -1)
926  continue;
927  scanline.edges[pos]->mark = true;
928  if (pos > 0)
929  scanline.edges[pos - 1]->intersect_right = true;
930  if (pos < scanline.size - 1)
931  scanline.edges[pos + 1]->intersect_left = true;
932  scanline.removeAt(pos);
933  }
934  if (v->flags & LineAfterEnds) {
935  QDEBUG() << " removing edge" << vertices.position(v);
936  int pos = scanline.findEdge(vertices.position(v));
937  if (pos == -1)
938  continue;
939  scanline.edges[pos]->mark = true;
940  if (pos > 0)
941  scanline.edges[pos - 1]->intersect_right = true;
942  if (pos < scanline.size - 1)
943  scanline.edges[pos + 1]->intersect_left = true;
944  scanline.removeAt(pos);
945  }
946  ++cv;
947  }
948 }
int position(const Vertex *v) const
#define QDEBUG
int prevPos(const Vertex *v) const
int findEdge(int edge) const

Properties

◆ currentVertex

int QTessellatorPrivate::currentVertex

Definition at line 233 of file qtessellator.cpp.

Referenced by addEdges(), and removeEdges().

◆ intersections

Intersections QTessellatorPrivate::intersections

Definition at line 229 of file qtessellator.cpp.

Referenced by addEdges(), and processIntersections().

◆ scanline

Scanline QTessellatorPrivate::scanline

◆ vertices

Vertices QTessellatorPrivate::vertices

◆ winding

bool QTessellatorPrivate::winding

◆ y

Q27Dot5 QTessellatorPrivate::y

Definition at line 232 of file qtessellator.cpp.

Referenced by QImageTextureGlyphCache::fillTexture().


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