Example #1
0
        public void SetPoints()
        {
            if (Constants.Initalising)
            {
                return;
            }
            PlotForm.SetEnabled(false);
            PlotFunction();

            if (doFillXvalues)
            {
                List <decimal> furcationPoints = new List <decimal>();
                foreach (DiagramSet p in CurrentFunction.furcationPoints)
                {
                    furcationPoints.Add(p.X);
                }
                List <PointD> setpoints = CurrentFunction.furcationPoints[CurrentFunction.furcationPoints.Count - 1].setPoints;
                if (setpoints.Count > 1)
                {
                    for (int i = setpoints.Count - 1; i >= 0; i--)
                    {
                        PointD p = setpoints[i];
                        furcationPoints.Add(p.X);
                    }
                }
                PlotForm.FillXValues(furcationPoints);
            }
            PlotForm.SetEnabled(true);
        }
Example #2
0
        public virtual async void SimulateTask()
        {
            PlotForm.SetProgressBar(pictBoxSize.Width);
            PlotForm.SetEnabled(false);
            InitTaskHandles();
            await Task.Run(() => { doTaskWork(); });

            PlotForm.SetEnabled(true);
            PlotForm.EndGenerate();
        }
Example #3
0
 private void FractalCompletedGIF()
 {
     fractalPlotter.CreateGif = false;
     gifCreater.Create(1, gifFilename);
     xMin = currXmin;
     xMax = currXmax;
     yMin = currYmin;
     yMax = currYmax;
     PlotForm.SetEnabled(true);
     PlotForm.EndGenerate();
     Reset();//includes  SimulateTask();
 }
Example #4
0
        public async void CreateGif(PointD current, string numGif, string fName)
        {
            m_StartX    = (float)current.X;
            m_StartY    = (float)current.Y;
            gifFilename = fractalPlotter.Title + fName + numGif;
            Int32.TryParse(numGif, out nGif);
            gifFilename = string.Concat(gifFilename.Split(Path.GetInvalidFileNameChars()));

            gifFilename = gifFilename.Replace("^", "");
            gifFilename = gifFilename.Replace("/", "");
            currXmin    = xMin;
            currXmax    = xMax;
            currYmin    = yMin;
            currYmax    = yMax;
            fractalPlotter.CreateGif = true;
            gifCreater.images.Clear();
            //zoom in to the largest square around current x,y
            if (Math.Abs(m_StartY) < 0.05)
            {
                m_StartY = 0;
            }
            if (Math.Abs(m_StartX) < 0.05)
            {
                m_StartX = 0;
            }
            double minX  = Math.Min(Math.Abs((float)xMax - m_StartX), Math.Abs((float)xMin - m_StartX));
            double minY  = Math.Min(Math.Abs((float)yMax - m_StartY), Math.Abs((float)yMin - m_StartY));
            double delta = Math.Min(minX, minY);

            xMin = (decimal)(m_StartX - delta);
            xMax = (decimal)(m_StartX + delta);
            yMin = (decimal)(m_StartY - delta);
            yMax = (decimal)(m_StartY + delta);

            centerX = xMin + (xMax - xMin) / 2;
            centerY = yMin + (yMax - yMin) / 2;
            dx      = (xMax - xMin) / (2 * nGif);
            dy      = (yMax - yMin) / (2 * nGif);
            xMax   -= dx * (nGif - 1);
            xMin   += dx * (nGif - 1);
            yMax   -= dy * (nGif - 1);
            yMin   += dy * (nGif - 1);

            plotForm.Params2Form();

            PlotForm.SetProgressBar(pictBoxSize.Width);
            PlotForm.SetEnabled(false);
            InitTaskHandlesGif();
            await Task.Run(() => { DoGif(); });

            FractalCompletedGIF();
        }