Ejemplo n.º 1
0
        override public void Init()
        {
            origin = new DnaPoint();
            origin.Init(tool);

            Brush = new DnaBrush();
            Brush.Init(tool);

            rx       = ry = tool.GetRandomNumber(0, Settings.ActiveMaxCircleRadius);
            rotation = 0;
        }
Ejemplo n.º 2
0
        new public void Init()
        {
            origin = new DnaPoint();
            origin.Init(tool);

            Brush = new DnaBrush();
            Brush.Init(tool);

            rx       = ry = tool.GetRandomNumber(0.0, 5.0);
            rotation = 0;
        }
Ejemplo n.º 3
0
        public virtual void Init()
        {
            origin = new DnaPoint();
            origin.Init(tool);

            Brush = new DnaBrush();
            Brush.Init(tool);

            rx       = tool.GetRandomNumber(0, Settings.ActiveMaxCircleRadius);
            ry       = tool.GetRandomNumber(0, Settings.ActiveMaxCircleRadius);
            rotation = tool.GetRandomNumber(-99.0, 99.0);
        }
Ejemplo n.º 4
0
        public static DnaPolygon GetRandom(int maxX, int maxY)
        {
            var points = new List <DnaPoint>();

            //int count = Tools.GetRandomNumber(3, 3);
            var origin = DnaPoint.GetRandom(maxX, maxY);

            for (int i = 0; i < Settings.ActivePointsPerPolygonMin; i++)
            {
                int clampedX     = MathUtils.Clamp(origin.X + Tools.GetRandomNumber(-3, 3), 0, maxX);
                int clampedY     = MathUtils.Clamp(origin.Y + Tools.GetRandomNumber(-3, 3), 0, maxY);
                var clampedPoint = new DnaPoint(clampedX, clampedY);

                points.Add(clampedPoint);
            }

            var brush = DnaBrush.GetRandom();

            return(new DnaPolygon(points, brush));
        }
Ejemplo n.º 5
0
        public void Init()
        {
            Points = new List <DnaPoint>();

            //int count = Tools.GetRandomNumber(3, 3);
            var origin = new DnaPoint();

            origin.Init();

            for (int i = 0; i < Settings.ActivePointsPerPolygonMin; i++)
            {
                var point = new DnaPoint();
                point.X = Math.Min(Math.Max(0, origin.X + Tools.GetRandomNumber(-3, 3)), Tools.MaxWidth);
                point.Y = Math.Min(Math.Max(0, origin.Y + Tools.GetRandomNumber(-3, 3)), Tools.MaxHeight);

                Points.Add(point);
            }

            Brush = new DnaBrush();
            Brush.Init();
        }
Ejemplo n.º 6
0
 //Convert a DnaBrush to a System.Drawing.Brush
 private static Brush GetGdiBrush(DnaBrush b)
 {
     return new SolidBrush(Color.FromArgb(b.Alpha, b.Red, b.Green, b.Blue));
 }
Ejemplo n.º 7
0
 public DnaPolygon(IEnumerable <DnaPoint> points, DnaBrush brush)
 {
     Points = points.ToList();
     Brush  = brush;
 }
Ejemplo n.º 8
0
 public DnaPolygon(IEnumerable<DnaPoint> points, DnaBrush brush)
 {
     Points = points.ToList();
     Brush = brush;
 }