Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/Transforms/SwapTransform.cs @ 12747

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

#2283 added GUI and charts; fixed MCTS

File size: 1.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows;
6
7namespace Microsoft.Research.DynamicDataDisplay
8{
9  /// <summary>
10  /// Represents a DataTransform that simply swaps points' coefficitiens from x to y and vice verca.
11  /// </summary>
12  public sealed class SwapTransform : DataTransform
13  {
14    /// <summary>
15    /// Initializes a new instance of the <see cref="SwapTransform"/> class.
16    /// </summary>
17    public SwapTransform() { }
18
19    /// <summary>
20    /// Transforms the point in data coordinates to viewport coordinates.
21    /// </summary>
22    /// <param name="pt">The point in data coordinates.</param>
23    /// <returns>
24    /// Transformed point in viewport coordinates.
25    /// </returns>
26    public override Point DataToViewport(Point pt)
27    {
28      return new Point(pt.Y, pt.X);
29    }
30
31    /// <summary>
32    /// Transforms the point in viewport coordinates to data coordinates.
33    /// </summary>
34    /// <param name="pt">The point in viewport coordinates.</param>
35    /// <returns>Transformed point in data coordinates.</returns>
36    public override Point ViewportToData(Point pt)
37    {
38      return new Point(pt.Y, pt.X);
39    }
40  }
41}
Note: See TracBrowser for help on using the repository browser.