Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/Charts/Shapes/VerticalLine.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: 1.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows;
6using System.Windows.Media;
7using System.Diagnostics;
8
9namespace Microsoft.Research.DynamicDataDisplay.Charts
10{
11  /// <summary>
12  /// Represents an infinite vertical line with x viewport coordinate.
13  /// </summary>
14  public sealed class VerticalLine : SimpleLine
15  {
16    /// <summary>
17    /// Initializes a new instance of the <see cref="VerticalLine"/> class.
18    /// </summary>
19    public VerticalLine() { }
20
21    /// <summary>
22    /// Initializes a new instance of the <see cref="VerticalLine"/> class with specified x coordinate.
23    /// </summary>
24    /// <param name="xCoordinate">The x coordinate.</param>
25    public VerticalLine(double xCoordinate)
26    {
27      Value = xCoordinate;
28    }
29
30    protected override void UpdateUIRepresentationCore()
31    {
32      var transform = Plotter.Viewport.Transform;
33
34      Point p1 = new Point(Value, Plotter.Viewport.Visible.YMin).DataToScreen(transform);
35      Point p2 = new Point(Value, Plotter.Viewport.Visible.YMax).DataToScreen(transform);
36
37      LineGeometry.StartPoint = p1;
38      LineGeometry.EndPoint = p2;
39    }
40  }
41}
Note: See TracBrowser for help on using the repository browser.