using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using Microsoft.Research.DynamicDataDisplay.Common.Auxiliary; namespace Microsoft.Research.DynamicDataDisplay.DataSources.MultiDimensional { /// /// Defines warped two-dimensional data source. /// /// Data piece type public sealed class WarpedDataSource2D : IDataSource2D where T : struct { /// /// Initializes a new instance of the class. /// /// Data. /// Grid. public WarpedDataSource2D(T[,] data, Point[,] grid) { if (data == null) throw new ArgumentNullException("data"); if (grid == null) throw new ArgumentNullException("grid"); Verify.IsTrue(data.GetLength(0) == grid.GetLength(0)); Verify.IsTrue(data.GetLength(1) == grid.GetLength(1)); this.data = data; this.grid = grid; width = data.GetLength(0); height = data.GetLength(1); } #region DataSource Members private readonly T[,] data; /// /// Gets two-dimensional data array. /// /// The data. public T[,] Data { get { return data; } } private readonly Point[,] grid; /// /// Gets the grid of data source. /// /// The grid. public Point[,] Grid { get { return grid; } } private readonly int width; /// /// Gets data grid width. /// /// The width. public int Width { get { return width; } } private readonly int height; /// /// Gets data grid height. /// /// The height. public int Height { get { return height; } } public IDataSource2D GetSubset(int x0, int y0, int countX, int countY, int stepX, int stepY) { throw new NotImplementedException(); } private void RaiseChanged() { if (Changed != null) { Changed(this, EventArgs.Empty); } } /// /// Occurs when data source changes. /// public event EventHandler Changed; #endregion #region IDataSource2D Members public Microsoft.Research.DynamicDataDisplay.Charts.Range? Range { get { throw new NotImplementedException(); } } public T? MissingValue { get { throw new NotImplementedException(); } } #endregion } }