KrisLibrary  1.0.0
DCEL.h
1 struct Vertex;
2 struct HalfEdge;
3 struct Face;
4 
5 struct Vertex
6 {
7  int data;
8  HalfEdge* edge; //one edge with this vertex as head
9 };
10 
11 struct HalfEdge
12 {
13  Vertex* tail() const { return next->head; }
14 
15  int data;
16  Vertex* head;
17  Face* face;
18  HalfEdge* next;
19  HalfEdge* adj;
20 };
21 
22 struct Face
23 {
24  bool HasEdge(const Edge* e) const {
25  HalfEdge* e = edge;
26  do
27  {
28  if(e->adj->face == f)
29  return true;
30  e = e->next;
31  }
32  while(e != edge);
33  return false;
34  }
35  HalfEdge AdjEdge(const Face* f) const {
36  HalfEdge* e = edge;
37  do
38  {
39  if(e->adj->face == f)
40  return e;
41  e = e->next;
42  }
43  while(e != edge);
44  return NULL;
45  }
46  bool IsAdj(const Face* f) const {
47  HalfEdge* e = AdjEdge(f);
48  return (e != NULL);
49  }
50 
51  int data;
52  HalfEdge* edge;
53 };
Definition: DCEL.h:22
Abstract base class for an edge planner / edge checker (i.e., local planner).
Definition: EdgePlanner.h:49
Definition: DCEL.h:5
Definition: DCEL.h:11