Exemplo n.º 1
0
        public void CreateAdvancingFront()
        {
            DelaunayTriangle delaunayTriangle = new DelaunayTriangle(this.Points[0], this.Tail, this.Head);

            this.Triangles.Add(delaunayTriangle);
            AdvancingFrontNode advancingFrontNode = new AdvancingFrontNode(delaunayTriangle.Points[1]);

            advancingFrontNode.Triangle = delaunayTriangle;
            AdvancingFrontNode advancingFrontNode2 = new AdvancingFrontNode(delaunayTriangle.Points[0]);

            advancingFrontNode2.Triangle = delaunayTriangle;
            AdvancingFrontNode tail = new AdvancingFrontNode(delaunayTriangle.Points[2]);

            this.aFront = new AdvancingFront(advancingFrontNode, tail);
            this.aFront.AddNode(advancingFrontNode2);
            this.aFront.Head.Next    = advancingFrontNode2;
            advancingFrontNode2.Next = this.aFront.Tail;
            advancingFrontNode2.Prev = this.aFront.Head;
            this.aFront.Tail.Prev    = advancingFrontNode2;
        }
Exemplo n.º 2
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;
        }