Divide() public méthode

public Divide ( LineParameters &lp1, LineParameters &lp2 ) : void
lp1 LineParameters
lp2 LineParameters
Résultat void
Exemple #1
0
        void Line2NoClip(LineParameters lp, int ex, int ey)
        {
            if (lp.len > LineAA.MAX_LENGTH)
            {
                LineParameters lp1, lp2;
                lp.Divide(out lp1, out lp2);
                Line2NoClip(lp1, lp1.x2 + (lp1.y2 - lp1.y1), lp1.y2 - (lp1.x2 - lp1.x1));
                Line2NoClip(lp2, (lp.x2 + ex) >> 1, (lp.y2 + ey) >> 1);
                return;
            }

            LineAA.FixDegenBisectrixEnd(lp, ref ex, ref ey);
            LineInterpolatorAA2 li = new LineInterpolatorAA2(this, lp, ex, ey);

            if (li.IsVertical)
            {
                while (li.StepV())
                {
                    ;
                }
            }
            else
            {
                while (li.StepH())
                {
                    ;
                }
            }
        }
Exemple #2
0
        void Line3NoClip(LineParameters lp,
                         int sx, int sy, int ex, int ey)
        {
            if (lp.len > LineAA.MAX_LENGTH)
            {
                LineParameters lp1, lp2;
                lp.Divide(out lp1, out lp2);
                int mx = lp1.x2 + (lp1.y2 - lp1.y1);
                int my = lp1.y2 - (lp1.x2 - lp1.x1);
                Line3NoClip(lp1, (lp.x1 + sx) >> 1, (lp.y1 + sy) >> 1, mx, my);
                Line3NoClip(lp2, mx, my, (lp.x2 + ex) >> 1, (lp.y2 + ey) >> 1);
                return;
            }

            LineAA.FixDegenBisectrixStart(lp, ref sx, ref sy);
            LineAA.FixDegenBisectrixEnd(lp, ref ex, ref ey);
            LineInterpolatorAA3 li = new LineInterpolatorAA3(this, lp, sx, sy, ex, ey);

            if (li.IsVertical)
            {
                while (li.StepV())
                {
                    ;
                }
            }
            else
            {
                while (li.StepH())
                {
                    ;
                }
            }
        }
Exemple #3
0
        void Line0NoClip(LineParameters lp)
        {
            if (lp.len > LineAA.MAX_LENGTH)
            {
                LineParameters lp1, lp2;
                lp.Divide(out lp1, out lp2);
                Line0NoClip(lp1);
                Line0NoClip(lp2);
                return;
            }

            LineInterpolatorAA0 li = new LineInterpolatorAA0(this, lp);

            if (li.Count != 0)
            {
                if (li.IsVertical)
                {
                    while (li.StepV())
                    {
                        ;
                    }
                }
                else
                {
                    while (li.StepH())
                    {
                        ;
                    }
                }
            }
        }
Exemple #4
0
        void Line1NoClip(LineParameters lp, int sx, int sy)
        {
            if (lp.len > LineAA.MAX_LENGTH)
            {
                LineParameters lp1, lp2;
                lp.Divide(out lp1, out lp2);
                Line1NoClip(lp1, (lp.x1 + sx) >> 1, (lp.y1 + sy) >> 1);
                Line1NoClip(lp2, lp1.x2 + (lp1.y2 - lp1.y1), lp1.y2 - (lp1.x2 - lp1.x1));
                return;
            }

            LineAA.FixDegenBisectrixStart(lp, ref sx, ref sy);
            LineInterpolatorAA1 li = new LineInterpolatorAA1(this, lp, sx, sy);

            if (li.IsVertical)
            {
                while (li.StepV())
                {
                    ;
                }
            }
            else
            {
                while (li.StepH())
                {
                    ;
                }
            }
        }
Exemple #5
0
        void Line0NoClip(LineParameters lp)
        {
            if (lp.len > LineAA.MAX_LENGTH)
            {
                LineParameters lp1, lp2;
                lp.Divide(out lp1, out lp2);
                Line0NoClip(lp1);
                Line0NoClip(lp2);
                return;
            }

            LineInterpolatorAA0 li = new LineInterpolatorAA0(this, lp);

            li.Loop();
        }
Exemple #6
0
        void Line2NoClip(LineParameters lp, int ex, int ey)
        {
            if (lp.len > LineAA.MAX_LENGTH)
            {
                LineParameters lp1, lp2;
                lp.Divide(out lp1, out lp2);
                Line2NoClip(lp1, lp1.x2 + (lp1.y2 - lp1.y1), lp1.y2 - (lp1.x2 - lp1.x1));
                Line2NoClip(lp2, (lp.x2 + ex) >> 1, (lp.y2 + ey) >> 1);
                return;
            }

            LineAA.FixDegenBisectrixEnd(lp, ref ex, ref ey);
            LineInterpolatorAA2 li = new LineInterpolatorAA2(this, lp, ex, ey);

            li.Loop();
        }
Exemple #7
0
        void Line1NoClip(LineParameters lp, int sx, int sy)
        {
            if (lp.len > LineAA.MAX_LENGTH)
            {
                LineParameters lp1, lp2;
                lp.Divide(out lp1, out lp2);
                Line1NoClip(lp1, (lp.x1 + sx) >> 1, (lp.y1 + sy) >> 1);
                Line1NoClip(lp2, lp1.x2 + (lp1.y2 - lp1.y1), lp1.y2 - (lp1.x2 - lp1.x1));
                return;
            }

            LineAA.FixDegenBisectrixStart(lp, ref sx, ref sy);
            LineInterpolatorAA1 li = new LineInterpolatorAA1(this, lp, sx, sy);

            li.Loop();
        }
        void Line3NoClip(LineParameters lp,
                         int sx, int sy, int ex, int ey)
        {
            if (lp.len > LineAA.MAX_LENGTH)
            {
                LineParameters lp1, lp2;
                lp.Divide(out lp1, out lp2);
                int mx = lp1.x2 + (lp1.y2 - lp1.y1);
                int my = lp1.y2 - (lp1.x2 - lp1.x1);
                Line3NoClip(lp1, (lp.x1 + sx) >> 1, (lp.y1 + sy) >> 1, mx, my);
                Line3NoClip(lp2, mx, my, (lp.x2 + ex) >> 1, (lp.y2 + ey) >> 1);
                return;
            }

            LineAA.FixDegenBisectrixStart(lp, ref sx, ref sy);
            LineAA.FixDegenBisectrixEnd(lp, ref ex, ref ey);
            LineInterpolatorAA3 li = new LineInterpolatorAA3(this, lp, sx, sy, ex, ey);
            if (li.IsVertical)
            {
                while (li.StepV()) ;
            }
            else
            {
                while (li.StepH()) ;
            }
        }
        void Line2NoClip(LineParameters lp, int ex, int ey)
        {
            if (lp.len > LineAA.MAX_LENGTH)
            {
                LineParameters lp1, lp2;
                lp.Divide(out lp1, out lp2);
                Line2NoClip(lp1, lp1.x2 + (lp1.y2 - lp1.y1), lp1.y2 - (lp1.x2 - lp1.x1));
                Line2NoClip(lp2, (lp.x2 + ex) >> 1, (lp.y2 + ey) >> 1);
                return;
            }

            LineAA.FixDegenBisectrixEnd(lp, ref ex, ref ey);
            LineInterpolatorAA2 li = new LineInterpolatorAA2(this, lp, ex, ey);
            if (li.IsVertical)
            {
                while (li.StepV()) ;
            }
            else
            {
                while (li.StepH()) ;
            }
        }
        void Line1NoClip(LineParameters lp, int sx, int sy)
        {
            if (lp.len > LineAA.MAX_LENGTH)
            {
                LineParameters lp1, lp2;
                lp.Divide(out lp1, out lp2);
                Line1NoClip(lp1, (lp.x1 + sx) >> 1, (lp.y1 + sy) >> 1);
                Line1NoClip(lp2, lp1.x2 + (lp1.y2 - lp1.y1), lp1.y2 - (lp1.x2 - lp1.x1));
                return;
            }

            LineAA.FixDegenBisectrixStart(lp, ref sx, ref sy);
            LineInterpolatorAA1 li = new LineInterpolatorAA1(this, lp, sx, sy);
            if (li.IsVertical)
            {
                while (li.StepV()) ;
            }
            else
            {
                while (li.StepH()) ;
            }
        }
        void Line0NoClip(LineParameters lp)
        {
            if (lp.len > LineAA.MAX_LENGTH)
            {
                LineParameters lp1, lp2;
                lp.Divide(out lp1, out lp2);
                Line0NoClip(lp1);
                Line0NoClip(lp2);
                return;
            }

            LineInterpolatorAA0 li = new LineInterpolatorAA0(this, lp);
            if (li.Count != 0)
            {
                if (li.IsVertical)
                {
                    while (li.StepV()) ;
                }
                else
                {
                    while (li.StepH()) ;
                }
            }
        }