6 vector<pair<DCELVertex *, DCELVertex *> > pendingDiagonals;
9 vector<pair<DCELVertex *, int> >::iterator it;
11 (*(list.end() - 1)).second = -1;
12 stack<pair<DCELVertex *, int> > stck;
18 for (; it != list.end(); it++)
20 if ((*it).second != stck.top().second) {
21 while (stck.size() > 1) {
22 pendingDiagonals.push_back(make_pair(stck.top().first, (*it).first));
26 stck.push((*(it - 1)));
30 pair<DCELVertex *, int> lastPoint;
31 lastPoint = stck.top();
33 while (!stck.empty()) {
34 if ((*it).second == 1) {
36 while (edgeWalker->
face != walker) edgeWalker = edgeWalker->
twin->
next;
38 pendingDiagonals.push_back(make_pair(stck.top().first, (*it).first));
39 lastPoint = stck.top();
44 else if ((*it).second == -1) {
45 DCELHalfEdge *edgeWalker = (*it).first->getEdgeOnFace(walker);
47 pendingDiagonals.push_back(make_pair(stck.top().first, (*it).first));
48 lastPoint = stck.top();
59 walker = walker->
next;
61 for (
int i = 0; i < pendingDiagonals.size(); i++) {
62 insertDiagonal(pendingDiagonals[i].first, pendingDiagonals[i].second);
DCELHalfEdge * twin
Definition: DCELHalfEdge.h:14
DCELHalfEdge * next
Definition: DCELHalfEdge.h:15
FaceList Faces
Definition: origin.h:15
DCELVertex * origin
Definition: DCELHalfEdge.h:17
DCELFace * head
Definition: FaceList.h:9
void insertDiagonal(DCELVertex *v1, DCELVertex *v2)
Definition: origin.h:105
int boundaryLength()
Definition: DCELFace.h:22
int orientation(pair< double, double > a, pair< double, double > b, pair< double, double > c)
Orientation.
Definition: origin.h:33
DCELFace * face
Definition: DCELHalfEdge.h:16
DCELFace * next
Definition: DCELFace.h:9
DCELHalfEdge * getPrev()
Half Edges.
Definition: DCELHalfEdge.h:36
void triangulate()
Definition: triangulate.h:4
#define ANTICLOCKWISE
Definition: origin.h:17
#define CLOCKWISE
Definition: origin.h:16
Definition: DCELHalfEdge.h:8
vector< pair< DCELVertex *, int > > sortedVertices()
Definition: DCELFace.h:32
bool bordered
Definition: DCELFace.h:8