Ejemplo n.º 1
0
        public void DrawDots(System.Drawing.Graphics gContext, int w, int h)
        {
            cVertexList listcopy = new cVertexList();

            listcopy.SetVertex(list.head.Point.X, list.head.Point.Y);

            if (nlinks == 3)
            {
                /*for the first link:*/
                listcopy = MakePoints(0, firstlinks, firstlinks - 1, list.head, list.head.NextVertex, listcopy);
                /*set the middle link*/
                listcopy.SetVertex(list.head.NextVertex.Point.X, list.head.NextVertex.Point.Y);
                listcopy.SetVertex(list.head.NextVertex.NextVertex.Point.X, list.head.NextVertex.NextVertex.Point.Y);
                /* for the last link, the third one*/
                listcopy = MakePoints(firstlinks + 1, nlinksback, nlinksback, list.head.NextVertex.NextVertex, list.head.PrevVertex, listcopy);
            }

            else
            {
                if (nlinksback > 2)
                /*if we have any extra - points*/
                {
                    /*first link:*/
                    listcopy = MakePoints(0, firstlinks, firstlinks - 1, list.head, list.head.NextVertex, listcopy);
                    /*set the middle point:*/
                    listcopy.SetVertex(list.head.NextVertex.Point.X, list.head.NextVertex.Point.Y);
                    /*set the last link*/
                    listcopy = MakePoints(firstlinks, nlinksback + 1, nlinksback - 1, list.head.PrevVertex.PrevVertex, list.head.PrevVertex, listcopy);
                } //end if nlinksback > 2
            }     // end else
            /*set the last point and draw everything*/
            listcopy.SetVertex(list.head.PrevVertex.Point.X, list.head.PrevVertex.Point.Y);
            listcopy.DrawPoints(gContext, w, h);
        }
Ejemplo n.º 2
0
        public void DrawHull(System.Drawing.Graphics gContext, int w, int h)
        {
            if (list.head != null)
            {
                list.DrawPoints(gContext, w, h);
            }

            if (top.n == 0 || top.head == null)
            {
                System.Diagnostics.Debug.WriteLine("No drawing is possible.");
            }
            else
            {
                cVertex v1 = top.head;

                if (top.n > 2)
                {
                    //do
                    //{
                    //    gContext.drawLine(v1.v.x, v1.v.y, v1.next.v.x, v1.next.v.y);
                    //    v1 = v1.next;
                    //} while (v1 != top.head);
                }
            } //end else
        }     //end draw