Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/Charts/Shapes/HorizontalRange.cs @ 13398

Last change on this file since 13398 was 12503, checked in by aballeit, 10 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.Media;
6using System.Windows;
7using Microsoft.Research.DynamicDataDisplay;
8
9namespace Microsoft.Research.DynamicDataDisplay.Charts
10{
11  /// <summary>
12  /// Paints horizontal filled and outlined range in viewport coordinates.
13  /// </summary>
14  public sealed class HorizontalRange : RangeHighlight
15  {
16    protected override void UpdateUIRepresentationCore()
17    {
18      var transform = Plotter.Viewport.Transform;
19      DataRect visible = Plotter.Viewport.Visible;
20
21      Point p1_left = new Point(visible.XMin, Value1).DataToScreen(transform);
22      Point p1_right = new Point(visible.XMax, Value1).DataToScreen(transform);
23      Point p2_left = new Point(visible.XMin, Value2).DataToScreen(transform);
24      Point p2_right = new Point(visible.XMax, Value2).DataToScreen(transform);
25
26      LineGeometry1.StartPoint = p1_left;
27      LineGeometry1.EndPoint = p1_right;
28
29      LineGeometry2.StartPoint = p2_left;
30      LineGeometry2.EndPoint = p2_right;
31
32      RectGeometry.Rect = new Rect(p1_left, p2_right);
33    }
34  }
35}
Note: See TracBrowser for help on using the repository browser.