public IEnumerable <FractalPath> CalculatePaths(FractalPath initialPath, IFractalSettings settings, CancellationToken cancellationToken)
        {
            var paths = new List <FractalPath>();

            this.CalculatePaths(initialPath, paths, settings, cancellationToken);
            return(paths);
        }
Esempio n. 2
0
 protected override void CalculatePaths(
     FractalPath initialPath,
     IList <FractalPath> paths,
     IFractalSettings settings,
     CancellationToken cancellationToken)
 {
     this.AddBranches(
         paths,
         initialPath.GetFirstPoint(),
         initialPath.GetSecondPoint(),
         (int)initialPath.Value,
         settings.MaxIterations,
         cancellationToken);
 }
Esempio n. 3
0
 protected override void CalculatePaths(
     FractalPath initialPath,
     IList <FractalPath> paths,
     IFractalSettings settings,
     CancellationToken cancellationToken)
 {
     this.AddTriangles(
         paths,
         initialPath.Points[0],
         initialPath.Points[1],
         initialPath.Points[2],
         (int)initialPath.Value,
         settings.MaxIterations,
         cancellationToken);
 }
Esempio n. 4
0
        private static void DrawPath(FractalPath path, Color color, FastBitmap fastBitmap, PenCache pens, LazyGraphics lazyGraphics)
        {
            if (path.IsPixel)
            {
                var point = path.GetFirstPoint();
                fastBitmap.SetPixel((int)point.X, (int)point.Y, color);
                return;
            }

            var pen = pens.GetOrCreatePen(color);

            if (path.IsLine)
            {
                lazyGraphics.Value.DrawLine(pen, path.GetFirstPoint().ToDrawingPoint(), path.GetSecondPoint().ToDrawingPoint());
                return;
            }

            for (var i = 0; i < path.Points.Length - 1; i++)
            {
                lazyGraphics.Value.DrawLine(pen, path.Points[i].ToDrawingPoint(), path.Points[i + 1].ToDrawingPoint());
            }
        }
 protected abstract void CalculatePaths(
     FractalPath initialPath,
     IList <FractalPath> paths,
     IFractalSettings settings,
     CancellationToken cancellationToken);
Esempio n. 6
0
 public PathBasedCalculationSpecification(FractalPath initialPath)
 {
     this.InitialPath = initialPath;
 }
Esempio n. 7
0
 public void AddAdditionalOutput(FractalPath path)
 {
     this.additionalOutput.Add(path);
 }
 public static Point <double> GetSecondPoint(this FractalPath path)
 {
     return(path.Points[1]);
 }
 public static Point <double> GetFirstPoint(this FractalPath path)
 {
     return(path.Points[0]);
 }