示例#1
0
文件: LineList.cs 项目: Thain/CDTK
        public LineListNode Get(Line line)
        {
            LineListNode cur = zero;

            while (cur.value != line)
            {
                cur = cur.next;
            }
            return(cur);
        }
示例#2
0
文件: LineList.cs 项目: Thain/CDTK
        public List <LineListNode> GetAsList()
        {
            LineListNode        cur = zero.next;
            List <LineListNode> ret = new List <LineListNode>();

            do
            {
                ret.Add(cur);
                cur = cur.next;
            }while(cur.value != zero.value);
            return(ret);
        }
示例#3
0
文件: LineList.cs 项目: Thain/CDTK
 // Adds an edge into the list, making sure it is in the correct place in the list so it is always sorted.
 public void AddSorted(Line edge, float edgeAngle)
 {
     Length++;
     if (zero == null)
     {
         zero = new LineListNode(edge, edgeAngle);
     }
     else
     {
         LineListNode cur = zero.next;
         while (edgeAngle - cur.angle > .000001 && cur != zero)
         {
             cur = cur.next;
         }
         LineListNode newLLN = new LineListNode(edge, cur, cur.prev, edgeAngle);
         cur.prev.next = newLLN;
         cur.prev      = newLLN;
     }
 }
示例#4
0
文件: LineList.cs 项目: Thain/CDTK
 public LineListNode(Line v, LineListNode n, LineListNode p, float a)
 {
     value = v; next = n; prev = p; angle = a;
 }
示例#5
0
文件: LineList.cs 项目: Thain/CDTK
 public LineListNode(Line v, float a)
 {
     value = v; next = this; prev = this; angle = a;
 }
示例#6
0
文件: LineList.cs 项目: Thain/CDTK
 // Removes a  vertex
 public void RemoveSorted(LineListNode l)
 {
     l.prev.next = l.next;
     l.next.prev = l.prev;
     l           = null;
 }