public MakeTriangulation(List <Diagrams.Point> points, IShapeComposite composite, Dispatcher dispatcher, ILog log) { this.Points = points; this.Dispatcher = dispatcher; this.Composite = composite; this.Log = log; }
private async Task AddLines(Dispatcher dispatcher, IShapeComposite composite, Brush brush, double[,] lines) { await dispatcher.BeginInvoke(new Action(() => { for (int i = lines.GetLength(0) - 1; i >= 0; i--) { composite.AddLine(brush, lines[i, 0], lines[i, 1], lines[i, 2], lines[i, 3]); } }), DispatcherPriority.ContextIdle); }
public DrawPoints(Dictionary <Brush, List <Diagrams.Point> > points, IShapeComposite composite) { if (composite == null) { throw new ArgumentNullException(nameof(composite)); } this.Points = points; this.Composite = composite; }
public DrawEdges(List <Diagrams.GraphEdge> edges, IShapeComposite composite) { if (composite == null) { throw new ArgumentNullException(nameof(composite)); } this.Edges = edges; this.Composite = composite; }
public DrawPolygon(Brush brush, Polygon polygon, IShapeComposite composite) { if (composite == null) { throw new ArgumentNullException(nameof(composite)); } this.Brush = brush; this.Polygon = polygon; this.Composite = composite; }
private async Task DrawLevel(NeuronLevel level, IShapeComposite composite) { // Draw outer hull await Bus.Send(new DrawPolygon(Brushes.DodgerBlue, level.Include, composite)); // Draw cut outs foreach (var cutOut in level.Excludes) { await this.DrawLevel(cutOut, composite); } }
private async Task DrawEdge(Dispatcher dispatcher, IShapeComposite composite, Brush b1, Diagrams.Point p1, Brush b2, Diagrams.Point p2) { if (b1 == b2) { await this.AddLine(dispatcher, composite, b1, p1.X, p1.Y, p2.X, p2.Y); } else { var xmidpoint = (p1.X + p2.X) / 2; var ymidpoint = (p1.Y + p2.Y) / 2; await this.AddLine(dispatcher, composite, b1, p1.X, p1.Y, xmidpoint, ymidpoint); await this.AddLine(dispatcher, composite, b2, xmidpoint, ymidpoint, p2.X, p2.Y); } }
public MakeMultiColorTriangulation(Dictionary <Brush, List <Diagrams.Point> > categories, IShapeComposite composite, Dispatcher dispatcher, ILog log) { this.Categories = categories; this.Composite = composite; this.Dispatcher = dispatcher; this.Log = log; }
private async Task AddLine(Dispatcher dispatcher, IShapeComposite composite, Brush brush, double ax, double ay, double bx, double by) { await dispatcher.BeginInvoke(new Action(() => { composite.AddLine(brush, ax, ay, bx, by); }), DispatcherPriority.ContextIdle); }