private void DrawFDEBBeziers2(float width, float height, float[,,] _pt) { List <tempEvents> tes = new List <tempEvents>(); float[] t; //foreach (Story s in _st) //{ // t = s.GetLocationLines(); // //this.RenderTarget.DrawRectangle(new D2D.RectF(0.0f, t[0], width, t[1]), neutralBrush, 1.0f, null); // this.RenderTarget.DrawLine(new D2D.Point2F(0.0f, t[0]), new D2D.Point2F(width, t[1]), alternativeBrush, 0.8f); //} for (int i = 0; i < _pt.GetLength(0); i++) { PathGeometry pLinesGeometry = this.Factory.CreatePathGeometry(); GeometrySink gs = pLinesGeometry.Open(); gs.SetFillMode(FillMode.Winding); gs.BeginFigure(new D2D.Point2F(_pt[i, 0, 0], _pt[i, 0, 1]), FigureBegin.Hollow); for (int j = 1; j < _pt.GetLength(1); j += 3) { gs.AddBezier( new BezierSegment( new Point2F(_pt[i, j, 0], _pt[i, j, 1]), new Point2F(_pt[i, j + 1, 0], _pt[i, j + 1, 1]), new Point2F(_pt[i, j + 2, 0], _pt[i, j + 2, 1]) ) ); } gs.EndFigure(FigureEnd.Open); gs.Close(); neutralBrush.Opacity = 0.8f + _kp[i]; if (_showLocationLines) { this.RenderTarget.DrawGeometry(pLinesGeometry, neutralBrush, 0.8f); } foreach (Story s in _st) { t = s.GetLocationLines(); if ((int)_pt[i, 0, 1] == (int)t[0] && (int)_pt[i, (int)(_pt.GetLength(1) - 1), 1] == (int)t[1]) { PointAndTangent pt = pLinesGeometry.ComputePointAtLength((pLinesGeometry.ComputeLength() * s.GetEventLocation()[0]) / width); RectangleGeometry pEventsGeometry = this.Factory.CreateRectangleGeometry( new D2D.RectF(pt.Point.X - RECTSIZE, pt.Point.Y - RECTSIZE, pt.Point.X + RECTSIZE, pt.Point.Y + RECTSIZE) ); tes.Add(new tempEvents(pEventsGeometry, brushes[s.GetLabel()], 0.8f)); } } } //foreach (tempEvents te in tes) // this.RenderTarget.DrawGeometry(te.pEventsGeometry, te.solidColorBrush, te.p); }
private void DrawFDEBBeziers2(float width, float height) { te = new List <tempEvents>(); float[] t; for (int i = 0; i < _pt.GetLength(0); i++) { PathGeometry pLinesGeometry = this.Factory.CreatePathGeometry(); GeometrySink gs = pLinesGeometry.Open(); gs.SetFillMode(FillMode.Winding); gs.BeginFigure(new D2D.Point2F(_pt[i, 0, 0], _pt[i, 0, 1]), FigureBegin.Hollow); for (int j = 1; j < _pt.GetLength(1); j += 3) { gs.AddBezier( new BezierSegment( new Point2F(_pt[i, j, 0], _pt[i, j, 1]), new Point2F(_pt[i, j + 1, 0], _pt[i, j + 1, 1]), new Point2F(_pt[i, j + 2, 0], _pt[i, j + 2, 1]) ) ); } gs.EndFigure(FigureEnd.Open); gs.Close(); neutralBrush.Opacity = 0.8f + _normalizedFrequency[i]; this.RenderTarget.DrawGeometry(pLinesGeometry, neutralBrush, 0.8f); foreach (Story s in _st) { t = s.GetLocationLines(); if ((int)_pt[i, 0, 1] == (int)t[0] && (int)_pt[i, (int)(_pt.GetLength(1) - 1), 1] == (int)t[1]) { PointAndTangent pt = pLinesGeometry.ComputePointAtLength((pLinesGeometry.ComputeLength() * s.GetEventLocation()[0]) / width); RectangleGeometry pEventsGeometry = this.Factory.CreateRectangleGeometry( new D2D.RectF(pt.Point.X - RECTSIZE, pt.Point.Y - RECTSIZE, pt.Point.X + RECTSIZE, pt.Point.Y + RECTSIZE) ); te.Add(new tempEvents(pEventsGeometry, brushes[s.GetLabel()], 0.8f)); } } } }