Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/PointMarkers/TrianglePointMarker.cs @ 12503

Last change on this file since 12503 was 12503, checked in by aballeit, 9 years ago

#2283 added GUI and charts; fixed MCTS

File size: 836 bytes
Line 
1using System.Windows;
2using System.Windows.Media;
3
4namespace Microsoft.Research.DynamicDataDisplay.PointMarkers
5{
6    /// <summary>Class that renders triangular marker at every point of graph</summary>
7  public class TrianglePointMarker : ShapePointMarker {
8    public override void Render(DrawingContext dc, Point screenPoint) {
9      Point pt0 = Point.Add(screenPoint, new Vector(-Size / 2, -Size / 2));
10      Point pt1 = Point.Add(screenPoint, new Vector(0, Size / 2));
11      Point pt2 = Point.Add(screenPoint, new Vector(Size / 2, -Size / 2));
12     
13      StreamGeometry streamGeom = new StreamGeometry();
14      using (var context = streamGeom.Open()) {
15        context.BeginFigure(pt0, true, true);
16        context.LineTo(pt1, true, true);
17        context.LineTo(pt2, true, true);
18      }
19      dc.DrawGeometry(Fill, Pen, streamGeom);
20    }
21  }
22}
Note: See TracBrowser for help on using the repository browser.