5 #include <bits/stdc++.h> 30 in_file.open(filename);
31 while (in_file.is_open()) {
34 while (in_file >> a >> b >> c) {
42 LaggingTwin = Edges.
addTwinTo(edge, LaggingTwin);
43 LaggingTwin->
face = outer;
44 outer->
edge = LaggingTwin;
47 if (!Vertices.
length) firstVertex = next;
61 cout <<
"OFF" << endl;
62 cout << Vertices.
length <<
" " << Faces.
length() <<
" 0" << endl;
68 edgeWalker = walker->
edge;
72 edgeWalker = edgeWalker->
next;
73 }
while (edgeWalker != walker->
edge);
74 cout << (double)rand() / RAND_MAX <<
" " << (double)rand() / RAND_MAX <<
" " << (double)rand() / RAND_MAX;
77 walker = walker->
next;
88 {face = walker->
face;
break;}
90 }
while (twinWalker != v2->
edge);
92 }
while (walker != v1->
edge && !face);
102 }
while (walker != v1->
edge);
106 if (v1 == v2)
return;
DCELHalfEdge * edge
Definition: DCELVertex.h:10
DCELHalfEdge * twin
Definition: DCELHalfEdge.h:14
void addToList(DCELHalfEdge *newEdge)
Definition: HalfEdgeList.h:33
DCELHalfEdge * next
Definition: DCELHalfEdge.h:15
void printPolygon()
Definition: origin.h:60
Definition: HalfEdgeList.h:7
void getPolygon(char const *filename)
Extract Data from Input File.
Definition: origin.h:22
void setCoords(double a, double b)
Definition: DCELVertex.h:30
FaceList Faces
Definition: origin.h:15
void removeFromList(DCELFace *face)
CREATE FACES.
Definition: FaceList.h:58
VertexList Vertices
Definition: origin.h:13
void addToList(DCELFace *newFace)
CREATE FACES.
Definition: FaceList.h:28
DCELVertex * origin
Definition: DCELHalfEdge.h:17
DCELFace * head
Definition: FaceList.h:9
void insertDiagonal(DCELVertex *v1, DCELVertex *v2)
Definition: origin.h:105
int length()
Definition: FaceList.h:42
int boundaryLength()
Definition: DCELFace.h:22
DCELHalfEdge * head
Definition: HalfEdgeList.h:13
DCELFace * face
Definition: DCELHalfEdge.h:16
DCELFace * next
Definition: DCELFace.h:9
void echo()
Definition: VertexList.h:26
Definition: DCELVertex.h:2
DCELFace * getFaceCommonTo(DCELVertex *v1, DCELVertex *v2)
Definition: origin.h:81
int index
Definition: DCELVertex.h:16
bool checkEdge(DCELVertex *v1, DCELVertex *v2)
Definition: origin.h:95
DCELHalfEdge * tail
Definition: HalfEdgeList.h:14
int length
Definition: VertexList.h:13
Definition: VertexList.h:3
HalfEdgeList Edges
Definition: origin.h:14
void addToList(DCELVertex *newVertex)
Definition: VertexList.h:38
DCELHalfEdge * addTwinTo(DCELHalfEdge *edge, DCELHalfEdge *LaggingTwin)
GETTTING THE HALF EDGE LIST.
Definition: HalfEdgeList.h:51
DCELFace * addEdgeBetween(DCELVertex *v1, DCELVertex *v2, DCELFace *face)
GETTTING THE HALF EDGE LIST.
Definition: HalfEdgeList.h:75
Definition: DCELHalfEdge.h:8
bool bordered
Definition: DCELFace.h:8
DCELHalfEdge * edge
Definition: DCELFace.h:7