Ejemplo n.º 1
0
 /// <summary>
 /// Compute part of animation.
 /// </summary>
 private void ComputeAnimationPart(int from, int to, int steps, ParameterHistory animationHistory, int historyIndex)
 {
     lblAnimationProgress.Text = "compute: " + from.ToString() + " " + to.ToString();
     for (int i = 0; i < steps && !_animationAbort; i++)
     {
         lblAnimationProgress.Text = "compute: " + from.ToString() + " " + to.ToString() + " Step " + i.ToString() + " (from " + steps.ToString() + ")";
         double r = 1.0 / steps * (double)i;
         Application.DoEvents();
         if (_animationSmooth)
         {
             animationHistory.LoadSmoothed(r + historyIndex);
         }
         else
         {
             animationHistory.Load(r + historyIndex);
         }
         int updateSteps = ParameterDict.Current.GetInt("View.UpdateSteps");
         if (updateSteps <= 0)
         {
             updateSteps = 0;
         }
         if (updateSteps > 1)
         {
             ParameterDict.Current.SetInt("View.UpdateSteps", updateSteps - 1);
         }
         ResultImageView.PublicForm.SetPictureBoxSize();
         Fractrace.Scheduler.PaintJob paintJob = new Scheduler.PaintJob(ResultImageView.PublicForm, ResultImageView.PublicForm.GestaltPicture);
         _currentPaintJob = paintJob;
         paintJob.Run(updateSteps);
         ResultImageView.PublicForm.CallDrawImage();
         if (_stepPreviewControls.ContainsKey(from))
         {
             _stepPreviewControls[from].UpdateComputedStep(i);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Compute part of animation.
 /// </summary>
 private void ComputeAnimationPart(int from, int to, int steps, ParameterHistory animationHistory, int historyIndex)
 {
     lblAnimationProgress.Text = "compute: " + from.ToString() + " " + to.ToString();
     for (int i = 0; i < steps && !_animationAbort; i++)
     {
         lblAnimationProgress.Text = "compute: " + from.ToString() + " " + to.ToString() + " Step " + i.ToString() + " (from " + steps.ToString() + ")";
         double r = 1.0 / steps * (double)i;
         Application.DoEvents();
         if (_animationSmooth)
             animationHistory.LoadSmoothed(r + historyIndex);
         else
             animationHistory.Load(r + historyIndex);
         int updateSteps = ParameterDict.Current.GetInt("View.UpdateSteps");
         if (updateSteps <= 0)
             updateSteps = 0;
         if (updateSteps > 1)
             ParameterDict.Current.SetInt("View.UpdateSteps", updateSteps - 1);
         ResultImageView.PublicForm.SetPictureBoxSize();
         Fractrace.Scheduler.PaintJob paintJob = new Scheduler.PaintJob(ResultImageView.PublicForm, ResultImageView.PublicForm.GestaltPicture);
         _currentPaintJob = paintJob;
         paintJob.Run(updateSteps);
         ResultImageView.PublicForm.CallDrawImage();
         if (_stepPreviewControls.ContainsKey(from))
             _stepPreviewControls[from].UpdateComputedStep(i);
     }
 }