コード例 #1
0
        private void CalcCombinedFractal()
        {
            fractalPlotter.InitImages(MainImage, PointsImage.Bitmap, BSize);
            fractalPlotter.DoCalculation();

            if (fractalType == FractalType.Julia && mandelbrotInsetBitmap != null && smoozeType == SmoozeType.Single)
            {
                using Graphics g = Graphics.FromImage(PointsImage.Bitmap);
                //  AdjustAspect();
                mandelbrotPlotInset.SmoozeType = SmoozeType.Single;
                mandelbrotPlotInset.XMini      = -2;
                mandelbrotPlotInset.XMaxi      = 0.7;
                mandelbrotPlotInset.YMini      = -1.5;
                mandelbrotPlotInset.YMaxi      = 1.5;
                mandelbrotPlotInset.DoCalculation();
                JuliaPlot p = (JuliaPlot)fractalPlotter;
                mandelbrotPlotInset.AddRedDot(p.Initial_C);
                Rectangle source = new Rectangle(0, 0,
                                                 mandelbrotInsetBitmap.Width, mandelbrotInsetBitmap.Height);
                Rectangle dest = new Rectangle(0, PointsImage.Height - mandelbrotPlotInset.Map.Height, mandelbrotPlotInset.Map.Width, mandelbrotPlotInset.Map.Height);
                g.DrawImage(mandelbrotInsetBitmap.Bitmap, dest, source, GraphicsUnit.Pixel);
            }
            int       cSize    = BSize / 50;
            Rectangle destRect = DestRect;

            try {
                using Graphics g = Graphics.FromImage(MainImage);
                string text = fractalPlotter.Title + ", Escape radius:" + max_MAG_SQUARED + ", Iterations:" + maxIterations;
                g.Clear(Color.LightGray);
                using Pen pen0 = new Pen(Color.Black, 4);
                g.DrawRectangle(pen0, new Rectangle(destRect.X - 1, destRect.Y - 1, destRect.Width + 2, destRect.Height + 2));
                using Pen pen = new Pen(Color.White, 4);
                g.DrawLine(pen, destRect.X - 4, destRect.Y - 1, destRect.Width + destRect.X, destRect.Y - 1);
                g.DrawLine(pen, destRect.X - 1, destRect.Y - 1, destRect.X - 1, destRect.Height + destRect.Y);
                g.DrawString(text, new Font("Calibri", cSize), Brushes.Blue, pictBoxSize.Height / 20, BSize / 70);
                g.DrawString(yMax.ToString("0.00"), new Font("Calibri", 2 * cSize / 3), Brushes.Blue, 5, destRect.Y);
                g.DrawString(yMin.ToString("0.00"), new Font("Calibri", 2 * cSize / 3), Brushes.Blue, 5, destRect.Y + destRect.Height - cSize);
                g.DrawString(xMin.ToString("0.00"), new Font("Calibri", 2 * cSize / 3), Brushes.Blue, destRect.X - cSize, destRect.Y + destRect.Height + cSize / 4);
                g.DrawString(xMax.ToString("0.00"), new Font("Calibri", 2 * cSize / 3), Brushes.Blue, destRect.X + destRect.Width - cSize, destRect.Y + destRect.Height + cSize / 4);

                g.DrawImage(PointsImage.Bitmap, destRect, sourceRect, GraphicsUnit.Pixel);
            }
            catch { }

            fractalPlotter.Copy2GIF(MainImage, BSize, sourceRect);

            if (PlotForm != null)
            {
                PlotForm.FormImage = MainImage;
            }
        }
コード例 #2
0
 public void JuliaMouseMove(double x, double y, DirectBitmap map)
 {
     if (fractalType == FractalType.Mandelbrot)
     {
         if (juliaPlotInset == null)
         {
             juliaPlotInset = new JuliaPlot(this, JuliaPlot.Initials.Length - 1, map);
         }
         juliaPlotInset.SetUserDefined((float)x, (float)y);
         juliaPlotInset.Reset();
         juliaPlotInset.SmoozeType = this.smoozeType;
         juliaPlotInset.DoCalculation();
     }
 }
コード例 #3
0
        public Control4NonLineairSystems(ICombined f, Control4AllViews bf) : base(f, bf)
        {
            pictBoxSize = new Size(BSize, BSize);

            mandelbrotInsetBitmap = new DirectBitmap(pictBoxSize.Width / 5, pictBoxSize.Height / 5);
            mandelbrotPlotInset   = new MandelbrotPlot(this, mandelbrotInsetBitmap);

            generalPlotters.Add(new UserdefinedPlot(this));
            generalPlotters.Add(new MandelbrotPlot(this));
            generalPlotters.Add(new JuliaPlot3(this, 0));
            generalPlotters.Add(new JuliaRationalPlot(this, 0));
            generalPlotters.Add(new HenonPlot(this));
            generalPlotters.Add(new LambdaPlot(this));
            generalPlotters.Add(new MultibrotReciprokePlot(this));
            generalPlotters.Add(new MandelbarPlot(this));

            fractalPlotter = generalPlotters[1];

            for (int jp = 0; jp < JuliaPlot.Initials.Length; jp++)
            {
                JuliaPlot jpp = new JuliaPlot(this, jp);
                JuliaPlotters.Add(jpp);
            }
            MiraLinePlotter miraLinePlotter = new MiraLinePlotter(this);

            linePlotters.Add(miraLinePlotter);
            linePlotters.Add(new BolSpiralLinePlotter(this));
            linePlotters.Add(new HenonLinePlotter(this));
            linePlotters.Add(new DustLinePlotter(this));
            linePlotters.Add(new CloudLinePlotter(this, CloudType.Type0));
            linePlotters.Add(new CloudLinePlotter(this, CloudType.Type1));
            //   linePlotters.Add(new CloudLinePlotter(this, CloudType.Type2));
            linePlotters.Add(new DendriteLinePlotter(this));
            linePlotters.Add(new StarLinePlotter(this));
            linePlotters.Add(new JuliaLinePlotter(this));

            for (int i = 0; i < miraLinePlotter.Favorites.Length; i++)
            {
                MiraLinePlotter miraExample = (MiraLinePlotter)miraLinePlotter.Clone(new DirectBitmap(100, 100));
                miraExample.ExampleNumber = i;
                miraLineplotExamples.Add(miraExample);
            }
            Xmin = (decimal)fractalPlotter.XMin;
            Xmax = (decimal)fractalPlotter.XMax;
            Ymin = (decimal)fractalPlotter.YMin;
            Ymax = (decimal)fractalPlotter.YMax;

            InterpolateColorPalette();

            foreach (BasePlotter p in generalPlotters)
            {
                BasePlotter pp = p.Clone(new DirectBitmap(100, 100));
                examplePlottersGeneral.Add(pp);
            }
            for (int jp = 0; jp < JuliaPlot.Initials.Length; jp++)
            {
                JuliaPlot jpp = new JuliaPlot(this, jp, new DirectBitmap(100, 100));
                examplePlottersJulia.Add(jpp);
            }
            for (int mp = 0; mp < linePlotters.Count; mp++)// Enum.GetNames(typeof(SpecificLineType)).Length - 1; mp++) {
            {
                BasePlotter mpp = linePlotters[mp].Clone(new DirectBitmap(100, 100, true));
                examplePlottersMira.Add(mpp);
            }
        }