Beispiel #1
0
        public void AddPoint(double x, double y)
        {
            Point v = new Point {
                X = x, Y = y
            };

            if (prevPoint.Equals(v))
            {
                return;
            }


            if (prevPoint.HasValue)
            {
                RawBorder rb = new RawBorder(prevPoint.Value, v);
                Borders.Add(rb);
            }
            prevPoint = v;



            string p = string.Format("{0}_{1}", x, y);

            if (!existingPoints.Contains(p))
            {
                Points.Add(v);
                calcExtreme();
                existingPoints.Add(p);
            }
        }
Beispiel #2
0
        protected TiltBorder getBorder(DirectionBase direction, Type type)
        {
            ColoBox box = new ColoBox("", 1);
            Point   p1  = new Point();
            Point   p2  = new Point();

            if (type == typeof(FirstBorderPositive))
            {
                p1.X = 160.21;
                p2.X = 310;
            }
            else
            {
                p1.X = 310;
                p2.X = 160.21;
            }

            p1.Y = -530.45;
            p2.Y = -390;
            RawBorder rb = new RawBorder(p1, p2);

            TiltBorder tb = new TiltBorder(rb, box);

            direction.LocationMachine = new Machine(new InitParams {
                Tolerance = 0.5
            }, null);
            return(tb);
        }