Exemple #1
0
 public void method_1(VattiClipper2I.Class191 localMinimum)
 {
     this.class196_0.Y = this.int_0;
     VattiClipper2I.Class200 edge1 = new VattiClipper2I.Class200()
     {
         Edge = localMinimum.Left
     };
     this.list_0.Insert(this.list_0.BinarySearch(edge1, (IComparer <VattiClipper2I.Class200>) this.class196_0), edge1);
     VattiClipper2I.Class199 class199 = localMinimum.Right;
     while (class199.Dy == 0)
     {
         class199 = class199.Successor;
     }
     VattiClipper2I.Class200 edge2 = (VattiClipper2I.Class200)null;
     if (class199 != null)
     {
         edge2 = new VattiClipper2I.Class200()
         {
             Edge = class199
         };
         this.list_0.Insert(this.list_0.BinarySearch(edge2, (IComparer <VattiClipper2I.Class200>) this.class196_0), edge2);
     }
     this.class35_0.Add((VattiClipper2I.Class192) new VattiClipper2I.Class194(edge1));
     if (edge2 == null)
     {
         return;
     }
     this.class35_0.Add((VattiClipper2I.Class192) new VattiClipper2I.Class194(edge2));
 }
Exemple #2
0
 public static VattiClipper2I.Class199 smethod_0(VattiClipper2I.Class199 e)
 {
     while (e != null && e.Successor != null)
     {
         e = e.Successor;
     }
     return(e);
 }
Exemple #3
0
 private static void smethod_1(
     Point2I p,
     List <VattiClipper2I.Class191> localMinimumList,
     VattiClipper2I.Class199 e0,
     VattiClipper2I.Class199 e1)
 {
     VattiClipper2I.Class191 class191 = new VattiClipper2I.Class191()
     {
         Y = p.Y
     };
     localMinimumList.Add(class191);
     VattiClipper2I.Class199 class199_1;
     VattiClipper2I.Class199 class199_2;
     if (Vector2I.CompareAngles(new Vector2I(e0.Dx, e0.Dy), new Vector2I(e1.Dx, e1.Dy)) <= 0)
     {
         class199_1 = e1;
         class199_2 = e0;
     }
     else
     {
         class199_1 = e0;
         class199_2 = e1;
     }
     if (class199_1.Dy == 0)
     {
         class191.Left        = class199_1.Successor;
         class199_1.Successor = class199_2;
         class199_1.method_3();
         class191.Right = class199_1;
     }
     else
     {
         class191.Left  = class199_1;
         class191.Right = class199_2;
     }
     e1.XBottom = p.X;
 }
Exemple #4
0
 public void method_2(VattiClipper2I.Class200 activeEdge)
 {
     if (activeEdge.Edge.Successor == null)
     {
         this.list_0.Remove(activeEdge);
     }
     else
     {
         VattiClipper2I.Class199 successor = activeEdge.Edge.Successor;
         while (successor != null && successor.Dy == 0)
         {
             successor = activeEdge.Edge.Successor;
         }
         if (successor == null)
         {
             this.list_0.Remove(activeEdge);
         }
         else
         {
             activeEdge.Edge = activeEdge.Edge.Successor;
             this.class35_0.Add((VattiClipper2I.Class192) new VattiClipper2I.Class194(activeEdge));
         }
     }
 }
Exemple #5
0
 internal void method_2(VattiClipper2I.Class199 e)
 {
     this.int_2 += e.int_2;
 }
Exemple #6
0
        internal static void smethod_0(
            Polygon2I polygon,
            byte type,
            List <VattiClipper2I.Class191> localMinimumList)
        {
            if (polygon.Count == 0)
            {
                return;
            }
            Point2I point2I1 = polygon[polygon.Count - 1];
            Point2I p        = polygon[0];

            VattiClipper2I.Class199 class199_1 = new VattiClipper2I.Class199(point2I1.X, point2I1.Y, p.X, p.Y)
            {
                Type = type
            };
            VattiClipper2I.Class199 e0 = class199_1;
            int  num1  = System.Math.Sign(p.Y - point2I1.Y);
            bool flag1 = false;

            if (num1 == 0)
            {
                flag1 = true;
                for (int index = polygon.Count - 2; index > 0; --index)
                {
                    num1 = System.Math.Sign(p.Y - polygon[index].Y);
                    if (num1 != 0)
                    {
                        break;
                    }
                }
            }
            class199_1.XBottom = num1 < 0 ? p.X : point2I1.X;
            for (int index = 1; index < polygon.Count; ++index)
            {
                Point2I point2I2 = polygon[index];
                VattiClipper2I.Class199 class199_2 = new VattiClipper2I.Class199(p.X, p.Y, point2I2.X, point2I2.Y)
                {
                    Type = type
                };
                int  num2  = System.Math.Sign(point2I2.Y - p.Y);
                bool flag2 = false;
                if (num2 == 0)
                {
                    flag2 = true;
                    num2  = num1;
                    if (flag1)
                    {
                        e0.method_2(class199_2);
                        class199_2 = e0;
                    }
                    else if (num2 > 0)
                    {
                        e0.Successor       = class199_2;
                        class199_2.XBottom = p.X;
                    }
                    else
                    {
                        class199_2.Successor = e0;
                        class199_2.XBottom   = point2I2.X;
                    }
                }
                else if (num2 == num1)
                {
                    if (num2 > 0)
                    {
                        e0.Successor       = class199_2;
                        class199_2.XBottom = p.X;
                    }
                    else
                    {
                        class199_2.Successor = e0;
                        class199_2.XBottom   = point2I2.X;
                    }
                }
                else if (num2 > 0 && num1 < 0)
                {
                    VattiClipper2I.smethod_1(p, localMinimumList, e0, class199_2);
                }
                else if (num2 < 0 && num1 > 0)
                {
                    class199_2.XBottom = point2I2.X;
                }
                num1  = num2;
                flag1 = flag2;
                p     = point2I2;
                e0    = class199_2;
            }
            Point2I point2I3 = polygon[0];

            VattiClipper2I.Class199 class199_3 = class199_1;
            int num3 = System.Math.Sign(point2I3.Y - p.Y);

            if (num3 == 0)
            {
                int num2 = num1;
                if (flag1)
                {
                    e0.method_2(class199_3);
                }
                else if (num2 > 0)
                {
                    e0.Successor       = class199_3;
                    class199_3.XBottom = p.X;
                }
                else
                {
                    class199_3.Successor = e0;
                    class199_3.XBottom   = point2I3.X;
                }
            }
            else if (num3 == num1)
            {
                if (num3 > 0)
                {
                    e0.Successor       = class199_3;
                    class199_3.XBottom = p.X;
                }
                else
                {
                    class199_3.Successor = e0;
                    class199_3.XBottom   = point2I3.X;
                }
            }
            else if (num3 > 0 && num1 < 0)
            {
                VattiClipper2I.smethod_1(p, localMinimumList, e0, class199_3);
            }
            else if (num3 < 0)
            {
                ;
            }
        }