Exemplo n.º 1
0
        private void makeEdgeRec(ref Point lower, ref Point upper, int yComp, ref SortedDoublyLinkedList<CActiveEdge>[] et)
        {
            var ae = new CActiveEdge
            {
                ReciSlope = (float)(upper.X - lower.X) / (upper.Y - lower.Y),
                XIntersection = lower.X
            };

            // Make shorter edge
            if (upper.Y < yComp)
                ae.YUper = upper.Y - 1;
            else
                ae.YUper = upper.Y;
            et[lower.Y].Add(ae);
        }
Exemplo n.º 2
0
        private void FillScan(int line, ref SortedDoublyLinkedList<CActiveEdge> ae, Graphics graph, Pen penline)
        {
            var points = new CActiveEdge[2];
            int i = 0;

            foreach (var edge in ae)
            {
                points[i] = edge;

                if (i == 1)
                    FillLine((int)Math.Round(points[0].XIntersection, 0), (int)Math.Round(points[1].XIntersection, 0), line, graph, penline);

                i = (i + 1) % 2;
            }
        }