Beispiel #1
0
 public override bool Equals(object other)
 {
     if (this == other)
     {
         return(true);
     }
     Class811.Class813 class813 = other as Class811.Class813;
     if (class813 == null || this.double_0 != class813.double_0)
     {
         return(false);
     }
     return(this.double_1 == class813.double_1);
 }
Beispiel #2
0
        private static double[] smethod_13(
            Polyline2D[] borders,
            Point2D start,
            Vector2D direction,
            bool fillInterior)
        {
            Point2D point2D1 = new Point2D();
            double  num1     = start.X * (start.Y + direction.Y) - start.Y * (start.X + direction.X);
            List <Class811.Class812> class812List1 = new List <Class811.Class812>();
            bool flag1 = false;

            foreach (Polyline2D border in borders)
            {
                bool    flag2     = false;
                bool    flag3     = false;
                Point2D?nullable1 = new Point2D?();
                bool    flag4     = false;
                bool    flag5     = false;
                Point2D?nullable2 = new Point2D?();
                bool    flag6     = false;
                Point2D?nullable3 = new Point2D?();
                if (border.Count > 0)
                {
                    Point2D point2D2 = border[0];
                }
                IList <Point2D> point2DList;
                if (border.Closed && border.Count > 2)
                {
                    point2DList = (IList <Point2D>) new List <Point2D>((IEnumerable <Point2D>)border);
                    point2DList.Add(border[0]);
                }
                else
                {
                    point2DList = (IList <Point2D>)border;
                }
                foreach (Point2D location2 in (IEnumerable <Point2D>)point2DList)
                {
                    if (nullable3.HasValue)
                    {
                        if (nullable3.Value == location2)
                        {
                            continue;
                        }
                    }
                    else
                    {
                        nullable3 = new Point2D?(Point2D.Zero);
                    }
                    double num2 = num1 - location2.X * direction.Y + location2.Y * direction.X;
                    if (num2 == 0.0)
                    {
                        flag3 = true;
                        if (flag2)
                        {
                            if (!nullable1.HasValue)
                            {
                                nullable1 = new Point2D?(location2);
                                flag4     = flag6;
                            }
                        }
                        else
                        {
                            nullable2 = nullable2.HasValue ? new Point2D?(location2) : new Point2D?(location2);
                        }
                    }
                    else
                    {
                        bool flag7 = num2 > 0.0;
                        if (flag2)
                        {
                            if (flag3)
                            {
                                if (flag7 ^ flag4)
                                {
                                    Point2D?nullable4 = nullable1;
                                    Point2D?nullable5 = nullable3;
                                    if ((nullable4.HasValue != nullable5.HasValue ? 1 : (!nullable4.HasValue ? 0 : (nullable4.GetValueOrDefault() != nullable5.GetValueOrDefault() ? 1 : 0))) != 0)
                                    {
                                        Class811.Class813 class813 = new Class811.Class813(Class811.smethod_16(nullable1.Value, start, direction), Class811.smethod_16(nullable3.Value, start, direction));
                                        Point2D           v        = start + class813.LowerCut * direction;
                                        if (!fillInterior || !Class811.smethod_14(v, borders, border))
                                        {
                                            class812List1.Add((Class811.Class812)class813);
                                            flag1 = true;
                                        }
                                    }
                                    else
                                    {
                                        Class811.Class812 class812 = (Class811.Class812) new Class811.Class814(Class811.smethod_16(nullable3.Value, start, direction));
                                        Point2D           v        = start + class812.LowerCut * direction;
                                        if (!fillInterior || !Class811.smethod_14(v, borders, border))
                                        {
                                            class812List1.Add(class812);
                                        }
                                    }
                                }
                            }
                            else if (flag7 ^ flag6)
                            {
                                Class811.Class812 class812 = (Class811.Class812) new Class811.Class814(Class811.smethod_15(nullable3.Value, location2, start, direction));
                                Point2D           v        = start + class812.LowerCut * direction;
                                if (!fillInterior || !Class811.smethod_14(v, borders, border))
                                {
                                    class812List1.Add(class812);
                                }
                            }
                        }
                        else
                        {
                            flag5 = flag7;
                            flag2 = true;
                        }
                        flag3     = false;
                        flag6     = flag7;
                        nullable1 = new Point2D?();
                    }
                    nullable3 = new Point2D?(location2);
                }
                if (flag2 && flag3 && flag4 ^ flag5)
                {
                    Point2D?nullable4 = nullable1;
                    Point2D?nullable5 = nullable2;
                    if ((nullable4.HasValue != nullable5.HasValue ? 1 : (!nullable4.HasValue ? 0 : (nullable4.GetValueOrDefault() != nullable5.GetValueOrDefault() ? 1 : 0))) != 0)
                    {
                        Class811.Class813 class813 = new Class811.Class813(Class811.smethod_16(nullable1.Value, start, direction), Class811.smethod_16(nullable2.Value, start, direction));
                        Point2D           v        = start + class813.LowerCut * direction;
                        if (!fillInterior || !Class811.smethod_14(v, borders, border))
                        {
                            class812List1.Add((Class811.Class812)class813);
                            flag1 = true;
                        }
                    }
                    else
                    {
                        Class811.Class812 class812 = (Class811.Class812) new Class811.Class814(Class811.smethod_16(nullable2.Value, start, direction));
                        Point2D           v        = start + class812.LowerCut * direction;
                        if (!fillInterior || !Class811.smethod_14(v, borders, border))
                        {
                            class812List1.Add(class812);
                        }
                    }
                }
            }
            if (class812List1.Count <= 0)
            {
                return((double[])null);
            }
            class812List1.Sort();
            if (flag1)
            {
                List <Class811.Class812> class812List2 = new List <Class811.Class812>(class812List1.Count);
                bool   flag2 = false;
                bool   flag3 = false;
                double cut1  = 0.0;
                foreach (Class811.Class812 class812 in class812List1)
                {
                    if (flag2)
                    {
                        if (class812.LowerCut > cut1)
                        {
                            if (flag3)
                            {
                                class812List2.Add((Class811.Class812) new Class811.Class814(cut1));
                            }
                            flag2 = false;
                        }
                        else
                        {
                            flag3 = !flag3;
                            if (class812.UpperCut > cut1)
                            {
                                cut1 = class812.UpperCut;
                                continue;
                            }
                            continue;
                        }
                    }
                    if (class812.IsInterval)
                    {
                        flag2 = true;
                        cut1  = class812.UpperCut;
                        if (class812List2.Count % 2 == 1)
                        {
                            class812List2.Add(class812);
                            flag3 = false;
                        }
                        else
                        {
                            flag3 = true;
                        }
                    }
                    else
                    {
                        class812List2.Add(class812);
                    }
                }
                class812List1 = class812List2;
            }
            Class811.Class812        class812_1    = (Class811.Class812)null;
            List <Class811.Class812> class812List3 = new List <Class811.Class812>();

            foreach (Class811.Class812 class812_2 in class812List1)
            {
                if (class812_2.Equals((object)class812_1))
                {
                    class812_1 = (Class811.Class812)null;
                    class812List3.RemoveAt(class812List3.Count - 1);
                }
                else
                {
                    class812List3.Add(class812_2);
                    class812_1 = class812_2;
                }
            }
            if (class812List3.Count % 2 != 0)
            {
                Console.Error.WriteLine("Error");
            }
            List <Class811.Class812> class812List4 = class812List3;

            double[] numArray = new double[class812List4.Count];
            int      num3     = 0;

            foreach (Class811.Class812 class812_2 in class812List4)
            {
                numArray[num3++] = class812_2.LowerCut;
            }
            return(numArray);
        }