Esempio n. 1
0
        public void createAdvancingFront()
        {
            AdvancingFrontNode head, tail, middle;
            // Initial triangle
            DelaunayTriangle iTriangle = new DelaunayTriangle(_points[0],
                                                              getTail(),
                                                              getHead());

            addToList(iTriangle);

            head            = new AdvancingFrontNode(iTriangle.points[1]);
            head.triangle   = iTriangle;
            middle          = new AdvancingFrontNode(iTriangle.points[0]);
            middle.triangle = iTriangle;
            tail            = new AdvancingFrontNode(iTriangle.points[2]);

            aFront = new AdvancingFront(head, tail);
            aFront.addNode(middle);

            // TODO: I think it would be more intuitive if head is middles next and not previous
            //       so swap head and tail
            aFront.head.next = middle;
            middle.next      = aFront.tail;
            middle.prev      = aFront.head;
            aFront.tail.prev = middle;
        }
Esempio n. 2
0
 public void addNode(AdvancingFrontNode node)
 {
     //        Console.Out.WriteLine( "add:" + node.key + ":" + System.identityHashCode(node.key));
     //        m_nodeTree.put( node.getKey(), node );
     aFront.addNode(node);
 }