예제 #1
0
        public override Fractal GetClone()
        {
            Mandelbrot Clone = new Mandelbrot();

            Mandelbrot.CopyTo(this, Clone);
            return(Clone);
        }
예제 #2
0
 private void ReturnEditedData(object sender, EventArgs e)
 {
     DialogResult    = DialogResult.Yes;
     IterationsCount = (ulong)numericUpDown1.Value;
     double.TryParse(LeftEdgeEdit.Text.Replace('.', ','), out LeftEdge);
     double.TryParse(RightEdgeEdit.Text.Replace('.', ','), out RightEdge);
     double.TryParse(TopEdgeEdit.Text.Replace('.', ','), out TopEdge);
     double.TryParse(BottomEdgeEdit.Text.Replace('.', ','), out BottomEdge);
     double.TryParse(RealPartEdit.Text.Replace('.', ','), out RealPart);
     double.TryParse(ImaginePartEdit.Text.Replace('.', ','), out ImaginePart);
     if (Mandelbrot.GetIterAtRealPoint(new Complex(RealPart, ImaginePart)) > 999UL)
     {
         if (MessageBox.Show(this, "Фрактал Жюлиа из введённого вами комплексного числа можеть быть вырожденным!\n"
                             + "Вы действительно хотите создать этот фрактал?", "Проблемное комплексное число!",
                             MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
         {
             return;
         }
     }
     if (TopEdge > BottomEdge)
     {
         double swap = TopEdge;
         TopEdge    = BottomEdge;
         BottomEdge = swap;
     }
     this.Dispose();
 }
예제 #3
0
 /*_____________________________________________Общедоступные_статические_методы_____________________________________________________________*/
 #region Public static methods
 public static void CopyTo(MandelbrotWithClouds Source, MandelbrotWithClouds Destinator)
 {
     Mandelbrot.CopyTo(Source, Destinator);
     Destinator._max_ammount_at_trace = Source._max_ammount_at_trace;
     Destinator._max_sqr_radius       = Source._max_sqr_radius;
     Destinator._abciss_step_length   = Source._abciss_step_length;
     Destinator._ordinate_step_length = Source._ordinate_step_length;
 }
예제 #4
0
 /*______________________________________________________Общедоступные_статические_методы_класса________________________________________________________*/
 #region /Public static methods
 public static void CopyTo(Mandelbrot Source, Mandelbrot Destinator)
 {
     _2DFractal.CopyTo(Source, Destinator);
 }
예제 #5
0
 private void JuliaSearcher_Load(object sender, EventArgs e)
 {
     fpb1                  = new FractalPictureBox();
     fpb1.SizeMode         = PictureBoxSizeMode.AutoSize;
     fpb1.ContextMenuStrip = contextMenuStrip1;
     if (_m_fcm == null)
     {
         _m_fcm = new Simple2DFractalColorMode();
     }
     panel1.Controls.Add(fpb1);
     fpb1.ToClickMode();
     if (_mandelbrot == null)
     {
         _mandelbrot = new Mandelbrot();
     }
     _m_fap          = _mandelbrot.CreateFractal(panel1.Width, panel1.Height);
     fpb1.Image      = _m_fcm.GetDrawnBitmap(_m_fap);
     fpb1.MouseMove += (_sender, _e) => { label1.Text = _get_complex_loc(_mandelbrot, _e.X, _e.Y).ToString(); };
     fpb2            = new FractalPictureBox();
     fpb2.SizeMode   = PictureBoxSizeMode.AutoSize;
     panel2.Controls.Add(fpb2);
     fpb1.MouseDown += (_sender, _e) =>
     {
         if (!clickable)
         {
             return;
         }
         if (_e.Button != MouseButtons.Left)
         {
             return;
         }
         _using_complex = _get_complex_loc(_mandelbrot, _e.X, _e.Y);
         label2.Text    = _using_complex.ToString();
         _julia.SetComplex(_using_complex);
         fpb2.Image = _j_fcm.GetDrawnBitmap(((_2DFractal)_julia).CreateFractal(panel2.Width, panel2.Height));
     };
     fpb2.RectangleSelected += (_sender, rec) =>
     {
         ((_2DFractal)_julia).CreateParallelFractal(panel2.Width, panel2.Height, rec.X, rec.Y, rec.Width, rec.Height, true);
     };
     ((_2DFractal)_julia).ParallelFractalCreatingFinished += (s, fap) =>
     {
         Action <Bitmap> act = (bmp) => { fpb2.Image = bmp; };
         Invoke(act, _j_fcm.GetDrawnBitmap(fap));
     };
     fpb2.SelectionPen       = null;
     fpb1.RectangleSelected += (_s, rec) => {
         _mandelbrot.CreateParallelFractal(panel1.Width, panel1.Height, rec.X, rec.Y, rec.Width, rec.Height, true);
     };
     _mandelbrot.ParallelFractalCreatingFinished += (s, fap) =>
     {
         Action <Bitmap> act = (bmp) => { fpb1.Image = bmp; };
         Invoke(act, _m_fcm.GetDrawnBitmap(fap));
     };
     fpb2.ContextMenuStrip = contextMenuStrip2;
     fpb1.SelectionPen     = null;
     clickable             = true;
     _fpb1_h_scale         = this.Width / (double)panel1.Width;
     _fpb1_v_scale         = this.Height / (double)panel1.Height;
     _fpb2_h_scale         = this.Width / (double)panel2.Width;
     _fpb2_v_scale         = this.Height / (double)panel2.Height;
     oldheight             = panel1.Height;
     oldwidth = panel1.Width;
     вРежимВращенияToolStripMenuItem.Visible = вРежимВращенияToolStripMenuItem.Enabled = _mandelbrot is IUsingQuaternion;
 }