Init() public méthode

public Init ( ) : void
Résultat void
Exemple #1
0
        internal void Init(DnaDrawing drawing, JobInfo info)
        {
            Points = new List <DnaPoint>();

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

            origin.Init(drawing, info);

            if (drawing.Polygons.Count < 1)
            {
                origin.X = info.SourceImage.Width / 2;
                origin.Y = info.SourceImage.Height / 2;
            }

            for (int i = 0; i < info.Settings.PointsPerPolygonMin; i++)
            {
                var point = new DnaPoint
                {
                    X =
                        Math.Min(Math.Max(0, origin.X + info.GetRandomNumber(-3, 3)),
                                 info.SourceImage.Width),
                    Y =
                        Math.Min(Math.Max(0, origin.Y + info.GetRandomNumber(-3, 3)),
                                 info.SourceImage.Height)
                };

                Points.Add(point);
            }

            Brush = new DnaBrush();
            Brush.Init(info);
        }
Exemple #2
0
        internal void Init(DnaDrawing drawing, JobInfo info)
        {
            Points = new List<DnaPoint>();

            //int count = info.GetRandomNumber(3, 3);
            var origin = new DnaPoint();
            origin.Init(drawing, info);

            if (drawing.Polygons.Count < 1)
            {
                origin.X = info.SourceImage.Width / 2;
                origin.Y = info.SourceImage.Height / 2;
            }

            for (int i = 0; i < info.Settings.PointsPerPolygonMin; i++)
            {
                var point = new DnaPoint
                                {
                                    X =
                                        Math.Min(Math.Max(0, origin.X + info.GetRandomNumber(-3, 3)),
                                                 info.SourceImage.Width),
                                    Y =
                                        Math.Min(Math.Max(0, origin.Y + info.GetRandomNumber(-3, 3)),
                                                 info.SourceImage.Height)
                                };

                Points.Add(point);
            }

            Brush = new DnaBrush();
            Brush.Init(info);
        }
Exemple #3
0
        public override void Init()
        {
            origin = new DnaPoint();
            origin.Init(tool);

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

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

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

            rx = ry = tool.GetRandomNumber(0.0, 5.0);
            rotation = 0;
        }
Exemple #5
0
        public void Init()
        {
            Center = new DnaPoint();
            Center.Init();

            // TODO: Test random number
            Radius = Tools.GetRandomNumber(0, Tools.MaxWidth);

            Brush = new DnaBrush();
            Brush.Init();
        }
Exemple #6
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);
        }
Exemple #7
0
        public void Init(DnaDrawing drawing, JobInfo info)
        {
            Points = new List <DnaPoint>();

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

            origin.Init(drawing, info);

            if (drawing.Polygons.Count < 1)
            {
                origin.X = info.SourceImage.Width / 2;
                origin.Y = info.SourceImage.Height / 2;
            }

            for (int i = 0; i < info.Settings.PointsPerPolygonMin; i++)
            {
                var point = new DnaPoint
                {
                    X =
                        Math.Min(Math.Max(0, origin.X + info.GetRandomNumber(-3, 3)),
                                 info.SourceImage.Width),
                    Y =
                        Math.Min(Math.Max(0, origin.Y + info.GetRandomNumber(-3, 3)),
                                 info.SourceImage.Height)
                };

                Points.Add(point);
            }

            bool findNew = true;

            if (info.Settings.MuteCurvePolygon &&
                info.Settings.MuteLinePolygon &&
                info.Settings.MuteCurveFillPolygon &&
                info.Settings.MuteLineFillPolygon)
            {
                findNew = false;
            }

            Width = info.GetRandomNumber(1, 8);

            while (findNew)
            {
                bool splines = (info.GetRandomNumber(0, 2) == 1) ? true : false;
                bool filled  = (info.GetRandomNumber(0, 2) == 1) ? true : false;
                findNew = !SetSplinesAndFilled(info.Settings, splines, filled);
            }

            Brush = new DnaBrush();
            Brush.Init(info);
        }
Exemple #8
0
        public void Init(DnaDrawing drawing, JobInfo info)
        {
            Points = new List<DnaPoint>();

            //int count = info.GetRandomNumber(3, 3);
            var origin = new DnaPoint();
            origin.Init(drawing, info);

            if (drawing.Polygons.Count < 1)
            {
                origin.X = info.SourceImage.Width / 2;
                origin.Y = info.SourceImage.Height / 2;
            }

            for (int i = 0; i < info.Settings.PointsPerPolygonMin; i++)
            {
                var point = new DnaPoint
                                {
                                    X =
                                        Math.Min(Math.Max(0, origin.X + info.GetRandomNumber(-3, 3)),
                                                 info.SourceImage.Width),
                                    Y =
                                        Math.Min(Math.Max(0, origin.Y + info.GetRandomNumber(-3, 3)),
                                                 info.SourceImage.Height)
                                };

                Points.Add(point);
            }

            bool findNew = true;

            if (info.Settings.MuteCurvePolygon &&
                info.Settings.MuteLinePolygon &&
                info.Settings.MuteCurveFillPolygon &&
                info.Settings.MuteLineFillPolygon)
                findNew = false;

            Width = info.GetRandomNumber(1, 8);

            while (findNew)
            {
                bool splines = (info.GetRandomNumber(0, 2) == 1) ? true : false;
                bool filled = (info.GetRandomNumber(0, 2) == 1) ? true : false;
                findNew = !SetSplinesAndFilled(info.Settings, splines, filled);
            }

            Brush = new DnaBrush();
            Brush.Init(info);
        }
Exemple #9
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();
        }
Exemple #10
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();
        }
        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++) //adds the minimum (3) number of points to the polygon, and gives them random positions
            {
                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(); //gives the shape some colour
            Brush.Init();
        }