Esempio n. 1
0
        private void button7_Click(object sender, EventArgs e)
        {
            //Button LEFT
            minx = -0.1 * scale + minx;
            maxx = -0.1 * scale + maxx;

            textBox5.Text = minx.ToString();
            textBox6.Text = maxx.ToString();

            if (radioButton20.Checked)
            {
                scheme = 1;
            }
            if (radioButton21.Checked)
            {
                scheme = 2;
            }
            if (radioButton22.Checked)
            {
                scheme = 3;
            }
            if (radioButton18.Checked)
            {
                j_fractal = true; w_fractal = false; w2_fractal = false; m_fractal = false; i_fractal = false;
            }
            if (radioButton19.Checked)
            {
                m_fractal = true; j_fractal = false; w_fractal = false; w2_fractal = false; i_fractal = false;
            }
            Fractal_GL_window.Refresh();
        }
Esempio n. 2
0
        private void button6_Click(object sender, EventArgs e)
        {
            //Button ZOOMout
            scale = 10 * scale / 7;
            minx  = 10 * minx / 7;
            maxx  = 10 * maxx / 7;
            miny  = 10 * miny / 7;
            maxy  = 10 * maxy / 7;

            textBox5.Text = minx.ToString();
            textBox6.Text = maxx.ToString();
            textBox8.Text = miny.ToString();
            textBox9.Text = maxy.ToString();
            if (radioButton20.Checked)
            {
                scheme = 1;
            }
            if (radioButton21.Checked)
            {
                scheme = 2;
            }
            if (radioButton22.Checked)
            {
                scheme = 3;
            }
            if (radioButton18.Checked)
            {
                j_fractal = true; w_fractal = false; w2_fractal = false; m_fractal = false; i_fractal = false;
            }
            if (radioButton19.Checked)
            {
                m_fractal = true; j_fractal = false; w_fractal = false; w2_fractal = false; i_fractal = false;
            }
            Fractal_GL_window.Refresh();
        }
Esempio n. 3
0
        //Task 1 Julia and Mandelbrot Sets

        private void button4_Click(object sender, EventArgs e)
        {
            //Julia and Mandelbrot Sets button Render;

            try
            {
                jmiterations = int.Parse(textBox2.Text);
                rec          = double.Parse(textBox3.Text);
                imc          = double.Parse(textBox4.Text);
                details      = int.Parse(textBox10.Text);

                if (jmiterations > 300 && jmiterations <= 0)
                {
                    jmiterations = 100;
                }
                if (details > 1252 && details <= 626)
                {
                    details = 626;
                }

                minx = double.Parse(textBox5.Text);
                maxx = double.Parse(textBox6.Text);

                if (maxx < minx)
                {
                    double temp = 0;
                    temp = minx;
                    minx = maxx;
                    maxx = temp;
                }

                miny = double.Parse(textBox8.Text);
                maxy = double.Parse(textBox9.Text);
            }
            catch (Exception mesages)
            {
                MessageBox.Show("Wrong parameters!\nUsing default.");
            }
            if (radioButton20.Checked)
            {
                scheme = 1;
            }
            if (radioButton21.Checked)
            {
                scheme = 2;
            }
            if (radioButton22.Checked)
            {
                scheme = 3;
            }
            if (radioButton18.Checked)
            {
                j_fractal = true; w_fractal = false; w2_fractal = false; m_fractal = false; i_fractal = false;
            }
            if (radioButton19.Checked)
            {
                m_fractal = true; j_fractal = false; w_fractal = false; w2_fractal = false; i_fractal = false;
            }
            Fractal_GL_window.Refresh();
        }
Esempio n. 4
0
        private void button10_Click(object sender, EventArgs e)
        {
            //Button DOWN
            miny = -0.1 * scale + miny;
            maxy = -0.1 * scale + maxy;

            textBox8.Text = miny.ToString();
            textBox9.Text = maxy.ToString();

            if (radioButton20.Checked)
            {
                scheme = 1;
            }
            if (radioButton21.Checked)
            {
                scheme = 2;
            }
            if (radioButton22.Checked)
            {
                scheme = 3;
            }
            if (radioButton18.Checked)
            {
                j_fractal = true; w_fractal = false; w2_fractal = false; m_fractal = false; i_fractal = false;
            }
            if (radioButton19.Checked)
            {
                m_fractal = true; j_fractal = false; w_fractal = false; w2_fractal = false; i_fractal = false;
            }
            Fractal_GL_window.Refresh();
        }
Esempio n. 5
0
        //Fern with wind Timer Tick Event Handler
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (radioButton7.Checked && w_fractal)
            {
                WindFern.Tick(iterations);
                // Fractal_GL_window.Refresh();

                Fractal_GL_window.SwapBuffers();
                Gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
                Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);
                Gl.glShadeModel(Gl.GL_SMOOTH);
                Gl.glMatrixMode(Gl.GL_PROJECTION);
                Gl.glLoadIdentity();
                Gl.glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
            }
            if (radioButton11.Checked && w2_fractal)
            {
                Spiral.Tick(iterations);

                // Fractal_GL_window.Refresh();
                Fractal_GL_window.SwapBuffers();
                Gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
                Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);
                Gl.glShadeModel(Gl.GL_SMOOTH);
                Gl.glMatrixMode(Gl.GL_PROJECTION);
                Gl.glLoadIdentity();
                Gl.glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
            }
        }
Esempio n. 6
0
 private void Form1_FormClosed(object sender, FormClosedEventArgs e)
 {
     Fractal_GL_window.DestroyContexts();
     VectorFields.DestroyContexts();
     Fractal_GL_window.Dispose();
     VectorFields.Dispose();
 }
Esempio n. 7
0
 private void SFractal_Render_button_Click(object sender, EventArgs e)
 {
     w_fractal  = false;
     w2_fractal = false;
     i_fractal  = false;
     j_fractal  = false;
     m_fractal  = false;
     s_fractal  = true;
     Fractal_GL_window.Refresh();
 }
Esempio n. 8
0
        private void IFSFractal_render_button_Click(object sender, EventArgs e)
        {
            s_fractal = false;
            m_fractal = false;
            j_fractal = false;
            try
            {
                iterations = int.Parse(textBox1.Text);
            }
            catch (Exception ex)
            {
            }
            if (!radioButton11.Checked)
            {
                w2_fractal = false;
            }
            if (!radioButton7.Checked)
            {
                w_fractal = false;
            }
            i_fractal = true;

            Fractal_GL_window.Refresh();
        }
Esempio n. 9
0
        public Form1()
        {
            InitializeComponent();

            #region Fractal classes constructors
            HarterDragon    = new Harter_Dragon();
            MinkovskySquare = new Minkovsky_Square();
            SquareCutted    = new Square_Hole();
            KochCurve       = new Koch_Curve();
            SerpinskyCarpet = new Serpinsky_Carpet();
            Fern            = new ISF_Fern();
            Cobweb          = new ISF_Cobweb();
            Dragon          = new ISF_Dragon();
            Star            = new ISF_Star();
            Spiral          = new ISF_Spiral();
            WindFern        = new ISF_WindFern();

            JuliaSet = new Julia();
            ManSet   = new Mandelbrot();
            #endregion


            #region Image Processing init
            Gray                   = new Grayscale();
            BlurPicture            = new Blur();
            Border                 = new Borders();
            openFileDialog1        = new OpenFileDialog();
            openFileDialog1.Filter = "Images (*.bmp;*.jpg;*.gif)|*.bmp;*.jpg;*.gif|All files(*.*)|*.*";
            loadf                  = false;
            #endregion


            #region Fractal variables init
            loaded        = false;
            depth_counter = 0;
            iterations    = 1000;

            jmiterations = 100;
            rec          = 0.11;
            imc          = -0.66;

            minx = -1.5; maxx = 1.5;
            miny = -1.5; maxy = 1.5;

            s_fractal  = false;
            i_fractal  = false;
            j_fractal  = false;
            m_fractal  = false;
            w_fractal  = false;
            w2_fractal = false;

            details = 800;
            scale   = 1;
            #endregion


            #region Vector Fields init
            Surface = new Grid();

            openFileDialog2        = new OpenFileDialog();
            openFileDialog2.Filter = "(*.txt; *.res)|*.txt;*.res|All files(*.*)|*.*";
            drawv = false;


            y_offset = 0;
            z_offset = 0;

            x_rotated = 0;
            y_rotated = 0;

            constant  = 1;
            timevalue = 0;
            LightONF  = true;
            InvNorm   = false;
            #endregion


            Fractal_GL_window.InitializeContexts();
            VectorFields.InitializeContexts();
        }