コード例 #1
0
        public void CreateAdvancingFront()
        {
            AdvancingFrontNode head, tail, middle;

            // Initial triangle
            DelaunayTriangle iTriangle = new DelaunayTriangle(Points[0], Tail, Head);

            Triangles.Add(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;
        }
コード例 #2
0
 public void AddNode(AdvancingFrontNode node)
 {
     //        Console.WriteLine( "add:" + node.key + ":" + System.identityHashCode(node.key));
     //        m_nodeTree.put( node.getKey(), node );
     Front.AddNode(node);
 }
コード例 #3
0
        public void CreateAdvancingFront()
        {
            AdvancingFrontNode head, tail, middle;
            // Initial triangle
            DelaunayTriangle iTriangle = new DelaunayTriangle(Points[0], Tail, Head);
            Triangles.Add(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;
        }
コード例 #4
0
 public void AddNode(AdvancingFrontNode node)
 {
     Front.AddNode(node);
 }