Example #1
0
        private void button2_Click_1(object sender, RoutedEventArgs e)
        {
            FractalSettings fractalSettings = new FractalSettings();

            // load fractal
            string store = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\WooScripter\\Scripts\\fractal";

            // Configure open file dialog box
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
            dlg.FileName         = "fractal";                  // Default file name
            dlg.DefaultExt       = ".wfd";                     // Default file extension
            dlg.Filter           = "Fractal Descriptor|*.wfd"; // Filter files by extension
            dlg.InitialDirectory = store;

            // Show open file dialog box
            Nullable <bool> result = dlg.ShowDialog();

            // get name of file
            if (result == true)
            {
                string       filename = dlg.FileName;
                StreamReader sr       = new StreamReader(filename);
                string       fractal  = sr.ReadToEnd();
                fractalSettings.Load(fractal);
                sr.Close();
                _RenderOptions     = fractalSettings._RenderOptions;
                _FractalColours    = fractalSettings._FractalColours;
                _FractalIterations = fractalSettings._FractalIterations;
            }
        }
Example #2
0
        public FractalColourControl(FractalColours fractalColours)
        {
            InitializeComponent();

            _FractalColours     = fractalColours;
            checkBox1.IsChecked = _FractalColours._XOrbitEnabled;
            orbitColourControl1.SetOrbitColours(_FractalColours._OrbitColoursX, this);
            checkBox2.IsChecked = _FractalColours._YOrbitEnabled;
            orbitColourControl2.SetOrbitColours(_FractalColours._OrbitColoursY, this);
            checkBox3.IsChecked = _FractalColours._ZOrbitEnabled;
            orbitColourControl3.SetOrbitColours(_FractalColours._OrbitColoursZ, this);
        }
        public FractalColourControl(FractalColours fractalColours)
        {
            InitializeComponent();

            _FractalColours = fractalColours;
            checkBox1.IsChecked = _FractalColours._XOrbitEnabled;
            orbitColourControl1.SetOrbitColours(_FractalColours._OrbitColoursX, this);
            checkBox2.IsChecked = _FractalColours._YOrbitEnabled;
            orbitColourControl2.SetOrbitColours(_FractalColours._OrbitColoursY, this);
            checkBox3.IsChecked = _FractalColours._ZOrbitEnabled;
            orbitColourControl3.SetOrbitColours(_FractalColours._OrbitColoursZ, this);
        }
Example #4
0
        private FractalSettings LoadFractal(string name)
        {
            FractalSettings fractalSettings = new FractalSettings();
            string          filename        = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\WooFractal\\Scripts\\fractal\\" + name + ".wfd";

            if (System.IO.File.Exists(filename))
            {
                StreamReader sr      = new StreamReader(filename);
                string       fractal = sr.ReadToEnd();
                fractalSettings.Load(fractal);
                sr.Close();
                _RenderOptions     = fractalSettings._RenderOptions;
                _FractalColours    = fractalSettings._FractalColours;
                _FractalIterations = fractalSettings._FractalIterations;
            }
            return(fractalSettings);
        }
Example #5
0
 public void Load(string xml)
 {
     _FractalIterations = new List <WooFractalIteration>();
     using (XmlReader reader = XmlReader.Create(new StringReader(xml)))
     {
         while (reader.NodeType != XmlNodeType.EndElement && reader.Read())
         {
             if (reader.NodeType == XmlNodeType.Element && reader.Name == "RENDEROPTIONS")
             {
                 _RenderOptions = new RenderOptions();
                 _RenderOptions.LoadXML(reader);
             }
             if (reader.NodeType == XmlNodeType.Element && reader.Name == "FRACTALCOLOURS")
             {
                 _FractalColours = new FractalColours();
                 _FractalColours.LoadXML(reader);
             }
             if (reader.NodeType == XmlNodeType.Element && reader.Name == "KIFSFRACTAL")
             {
                 KIFSIteration fractalIteration = new KIFSIteration();
                 fractalIteration.LoadXML(reader);
                 _FractalIterations.Add(fractalIteration);
             }
             if (reader.NodeType == XmlNodeType.Element && reader.Name == "BULBFRACTAL")
             {
                 MandelbulbIteration fractalIteration = new MandelbulbIteration();
                 fractalIteration.LoadXML(reader);
                 _FractalIterations.Add(fractalIteration);
             }
             if (reader.NodeType == XmlNodeType.Element && reader.Name == "BOXFRACTAL")
             {
                 MandelboxIteration fractalIteration = new MandelboxIteration();
                 fractalIteration.LoadXML(reader);
                 _FractalIterations.Add(fractalIteration);
             }
         }
     }
 }
Example #6
0
        private void button2_Click_1(object sender, RoutedEventArgs e)
        {
            FractalSettings fractalSettings = new FractalSettings();
            
            // load fractal
            string store = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\WooScripter\\Scripts\\fractal";

            // Configure open file dialog box
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
            dlg.FileName = "fractal"; // Default file name
            dlg.DefaultExt = ".wfd"; // Default file extension
            dlg.Filter = "Fractal Descriptor|*.wfd"; // Filter files by extension
            dlg.InitialDirectory = store;

            // Show open file dialog box
            Nullable<bool> result = dlg.ShowDialog();

            // get name of file
            if (result == true)
            {
                string filename = dlg.FileName;
                StreamReader sr = new StreamReader(filename);
                string fractal = sr.ReadToEnd();
                fractalSettings.Load(fractal);
                sr.Close();
                _RenderOptions = fractalSettings._RenderOptions;
                _FractalColours = fractalSettings._FractalColours;
                _FractalIterations = fractalSettings._FractalIterations;
            }
        }
Example #7
0
 private FractalSettings LoadFractal(string name)
 {
     FractalSettings fractalSettings = new FractalSettings();
     string filename = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\WooFractal\\Scripts\\fractal\\" + name + ".wfd";
     if (System.IO.File.Exists(filename))
     {
         StreamReader sr = new StreamReader(filename);
         string fractal = sr.ReadToEnd();
         fractalSettings.Load(fractal);
         sr.Close();
         _RenderOptions = fractalSettings._RenderOptions;
         _FractalColours = fractalSettings._FractalColours;
         _FractalIterations = fractalSettings._FractalIterations;
     }
     return fractalSettings;
 }
Example #8
0
 public void Load(string xml)
 {
     _FractalIterations = new List<WooFractalIteration>();
     using (XmlReader reader = XmlReader.Create(new StringReader(xml)))
     {
         while (reader.NodeType != XmlNodeType.EndElement && reader.Read())
         {
             if (reader.NodeType == XmlNodeType.Element && reader.Name == "RENDEROPTIONS")
             {
                 _RenderOptions = new RenderOptions();
                 _RenderOptions.LoadXML(reader);
             }
             if (reader.NodeType == XmlNodeType.Element && reader.Name == "FRACTALCOLOURS")
             {
                 _FractalColours = new FractalColours();
                 _FractalColours.LoadXML(reader);
             }
             if (reader.NodeType == XmlNodeType.Element && reader.Name == "KIFSFRACTAL")
             {
                 KIFSIteration fractalIteration = new KIFSIteration();
                 fractalIteration.LoadXML(reader);
                 _FractalIterations.Add(fractalIteration);
             }
             if (reader.NodeType == XmlNodeType.Element && reader.Name == "BULBFRACTAL")
             {
                 MandelbulbIteration fractalIteration = new MandelbulbIteration();
                 fractalIteration.LoadXML(reader);
                 _FractalIterations.Add(fractalIteration);
             }
             if (reader.NodeType == XmlNodeType.Element && reader.Name == "BOXFRACTAL")
             {
                 MandelboxIteration fractalIteration = new MandelboxIteration();
                 fractalIteration.LoadXML(reader);
                 _FractalIterations.Add(fractalIteration);
             }
         }
     }
 }
Example #9
0
 public void Set(RenderOptions renderOptions, FractalColours fractalColours, List<WooFractalIteration> fractalIterations)
 {
     _RenderOptions = renderOptions;
     _FractalColours = fractalColours;
     _FractalIterations = fractalIterations;
 }
Example #10
0
 public void Set(RenderOptions renderOptions, FractalColours fractalColours, List <WooFractalIteration> fractalIterations)
 {
     _RenderOptions     = renderOptions;
     _FractalColours    = fractalColours;
     _FractalIterations = fractalIterations;
 }