Line data Source code
1 : #include "DisplayList.h"
2 : #include "constants.h"
3 :
4 : //------------------------------------------------------------------------------
5 78 : DisplayList::DisplayList() {
6 39 : head = NULL;
7 39 : tail = NULL;
8 78 : }
9 :
10 : //------------------------------------------------------------------------------
11 78 : DisplayList::~DisplayList() {}
12 :
13 : //------------------------------------------------------------------------------
14 11 : void DisplayList::traverseList() {
15 11 : QuadTreeNode *n = head;
16 :
17 22 : while (n != NULL) {
18 : PRINT_DEBUG_LVL(4, "Node:\n");
19 : PRINT_DEBUG_LVL(4, "0=%f,%f\n", n->min[0], n->max[0]);
20 : PRINT_DEBUG_LVL(4, "1=%f,%f\n", n->min[1], n->max[1]);
21 11 : n = n->next;
22 : }
23 11 : }
24 :
25 : //------------------------------------------------------------------------------
26 28 : void DisplayList::insertLast(QuadTreeNode* n) {
27 28 : if (head == NULL) {
28 18 : head = n;
29 18 : head->next = NULL;
30 18 : }
31 :
32 28 : if (tail == NULL)
33 18 : tail = n;
34 : else {
35 10 : tail->next = n;
36 10 : tail = n;
37 : }
38 :
39 28 : tail->next = NULL;
40 28 : }
41 :
42 : //------------------------------------------------------------------------------
43 2 : void DisplayList::clearList() {
44 2 : head = NULL;
45 2 : tail = NULL;
46 2 : }
|