Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Windows;
|
---|
6 |
|
---|
7 | namespace 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.