Ejemplo n.º 1
0
        // final Point openString[] = { new Point(1220, 1320),
        // new Point(1220, 2320), new Point(3000, 2320),
        // new Point(3520, 1720), new Point(3000, 1320), };
        //
        // final Point3D openString3[] = { new Point3D(1220, 1320, 11),
        // new Point3D(1220, 2320, 2), new Point3D(3000, 2320, 3),
        // new Point3D(3520, 1720, 4), new Point3D(3000, 1320, 5), };
        internal virtual com.epl.geometry.Point _GenerateNewPoint()
        {
            if (points.Count == maxcount)
            {
                return(_RandomizeExisting());
            }
            com.epl.geometry.Point pt;
            double f = random.NextDouble() - 0.5;

            if (points.Count == 0)
            {
                pt = env.GetCenter();
            }
            else
            {
                pt = points.Last();
            }
            // pt.x = pt.x + env.Width() * f;
            pt.SetX(pt.GetX() + maxlen * f);
            f = 1.0 * random.NextDouble() - 0.5;
            pt.SetY(pt.GetY() + env.GetHeight() * f);
            pt.SetY(pt.GetY() + maxlen * f);
            pt = _snapClip(pt, env);
            points.Add(pt);
            return(pt);
        }