Computational Geometry Algorithms Library  1.0
Computational Geometry Algorithms Library Documentation
Public Member Functions | Public Attributes | List of all members
FaceList Class Reference

#include <FaceList.h>

Collaboration diagram for FaceList:
Collaboration graph
[legend]

Public Member Functions

 FaceList ()
 
 ~FaceList ()
 
void addToList (DCELFace *newFace)
 CREATE FACES. More...
 
int length ()
 
void removeFromList (DCELFace *face)
 CREATE FACES. More...
 

Public Attributes

DCELFacehead
 
DCELFacetail
 

Constructor & Destructor Documentation

FaceList::FaceList ( )
17  : head(NULL)
18 {
19 }
DCELFace * head
Definition: FaceList.h:9
FaceList::~FaceList ( )
22 {
23 }

Member Function Documentation

void FaceList::addToList ( DCELFace newFace)

CREATE FACES.

Add to the list

28  {
29  if (head)
30  {
31  tail->next = newFace;
32  DCELFace *walker = newFace;
33  while (walker->next) walker = walker->next;
34  tail = walker;
35  }
36  else {
37  head = newFace;
38  tail = newFace;
39  }
40 }
Definition: DCELFace.h:1
DCELFace * head
Definition: FaceList.h:9
DCELFace * next
Definition: DCELFace.h:9
DCELFace * tail
Definition: FaceList.h:10
int FaceList::length ( )
42  {
43  if (head) {
44  DCELFace* walker = head;
45  int length = 1;
46  while (walker->next) {
47  walker = walker->next;
48  length++;
49  }
50  return length - 1;
51  }
52  else return 0;
53 }
Definition: DCELFace.h:1
DCELFace * head
Definition: FaceList.h:9
int length()
Definition: FaceList.h:42
DCELFace * next
Definition: DCELFace.h:9
void FaceList::removeFromList ( DCELFace face)

CREATE FACES.

Remove From the list

58  {
59  if (face == head) {
60  head = head->next;
61  return;
62  }
63  DCELFace* walker = head;
64  while (walker) {
65  if (walker->next == face)
66  break;
67  walker = walker->next;
68  }
69  walker->next = walker->next->next;
70 }
Definition: DCELFace.h:1
DCELFace * head
Definition: FaceList.h:9
DCELFace * next
Definition: DCELFace.h:9

Member Data Documentation

DCELFace* FaceList::head
DCELFace* FaceList::tail

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