Newer
Older
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WindStressPRM
{
/// <summary>
/// Cell Sizes
/// Параметры ячейки (регулярной сетки)
/// </summary>
public class CellSize
{
/// <summary>
/// ширина ячейки (расстояние между соседними по X центрами ячеек, в размерности координат)
/// </summary>
public double Width { get; set; }
/// <summary>
/// высота ячейки (расстояние между соседними по Y центрами ячеек, в размерности координат)
/// </summary>
public double Height { get; set; }
/// <summary>
/// designated constructor
/// </summary>
/// <param name="wdh">Cell Width, ширина ячейки (расстояние между соседними по X центрами ячеек, в размерности координат)</param>
/// <param name="hgh">Cell Height, высота ячейки (расстояние между соседними по Y центрами ячеек, в размерности координат)</param>
public CellSize(double width, double height)
this.Width = width;
this.Height = height;
if (!(this.CheckValue()))
{
throw new System.ArgumentException("Cell width or height values are incorrect!");
}
}
/// <summary>
/// Проверка валидности полей
/// </summary>
/// <returns></returns>
public bool CheckValue()
{
return Width > 0 && Height > 0;
}
}
}