Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

listnode.cpp

Go to the documentation of this file.
00001 #include "listnode.h"
00002 #include "bsp.h"
00003 #include "tll.h"
00004 #include "mmgr.h"
00005 
00006 extern int numlistleaves;
00007 extern int numlistpartitions;
00008 extern ListNode* listnode;
00009 extern LinkedList<ListNode> LeafList;
00010 extern LinkedList<ListNode> PartitionList; 
00011 
00012 int ListNode::Compare(const ListNode& Node)
00013 {
00014   if (linkPosition < Node.linkPosition)
00015     return smaller;
00016   if (linkPosition > Node.linkPosition)
00017     return bigger;
00018   else
00019     return same;
00020 }
00021 
00022 void MakeNodeLists(BSP_node* node)
00023 {
00024     if (node->leaf == true)
00025     {
00026         numlistleaves++;
00027         listnode = new ListNode;
00028         listnode->node = node;
00029         listnode->linkPosition = node->nodeid;
00030         LeafList.Insert(listnode);
00031         return;
00032     }
00033     else
00034     {
00035         if (node->nodeid != 0)
00036         {
00037             numlistpartitions++;
00038             listnode = new ListNode;
00039             listnode->node = node;
00040             listnode->linkPosition = node->nodeid;
00041             PartitionList.Insert(listnode);
00042         }
00043     }
00044     MakeNodeLists(node->frontnode);
00045     MakeNodeLists(node->backnode);
00046 }
00047 

Generated on Fri Dec 23 05:20:18 2005 for Portals by doxygen1.2.15