/// <summary> /// Convert the given enum value to a colormap brush. /// </summary> /// <param name="value">.</param> /// <param name="targetType">.</param> /// <param name="parameter">.</param> /// <param name="culture">.</param> /// <returns>Colormap brush with the correct brush type.</returns> public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { ColormapBrush brush = new ColormapBrush(); if (targetType != typeof(Brush)) { return(null); } if (!(value is ColormapBrush.ColormapBrushEnum)) { return(null); } Brush scb = ColormapBrush.GetBrush((ColormapBrush.ColormapBrushEnum)value); return(scb); }
///// <summary> ///// Bitmap to store the scale based off ///// the current options. ///// </summary> //private SimpleBitmap _scaleBitmap; ///// <summary> ///// Use this as the image source for the ///// view. This will be the base of the ///// _scaleBitmap SimpleBitmap. ///// </summary> //public WriteableBitmap ScaleImage //{ // get // { // if (_scaleBitmap != null) // { // return _scaleBitmap.BaseBitmap; // } // else // { // // Create the legend // CreateLegend(); // return _scaleBitmap.BaseBitmap; // } // } //} ///// <summary> ///// Used for scale to display the minimum velocity. ///// </summary> //public string MinVelocityScale //{ // get { return _minVelocity.ToString("0.00") + ScaleLabel; } //} ///// <summary> ///// Used for scale to display the velocity between center and minimum. ///// </summary> //public string HalfMinVelocityScale //{ // get { return (_minVelocity + ((_maxVelocity - _minVelocity) * 0.25)).ToString("0.00") + ScaleLabel; } //} ///// <summary> ///// Used for scale to display the center velocity. ///// </summary> //public string HalfVelocityScale //{ // get { return (_minVelocity + ((_maxVelocity - _minVelocity) * 0.50)).ToString("0.00") + ScaleLabel; } //} ///// <summary> ///// Used for scale to display the velocity between center and maximum. ///// </summary> //public string HalfMaxVelocityScale //{ // get { return (_minVelocity + ((_maxVelocity - _minVelocity) * 0.75)).ToString("0.00") + ScaleLabel; } //} ///// <summary> ///// Used for scale to display the velocity the maximum velocity. ///// </summary> //public string MaxVelocityScale //{ // get { return _maxVelocity.ToString("0.00") + ScaleLabel; } //} #endregion #endregion /// <summary> /// Initialize the values. /// </summary> public VelocityPlotSurface() { // Intialize values MaxEnsembles = DEFAULT_MAX_ENSEMBLES; _minBin = 0; _maxBin = -1; // Set the color brush _colormap = new ColormapBrush(); _colormapBrushSelection = DEFAULT_BRUSH; _surfaceBrush = ColormapBrush.GetBrush(_colormapBrushSelection); _colormap.ColormapBrushType = _colormapBrushSelection; _emptyColor = DEFAULT_EMPTY_COLOR; ResetMinMaxVelocity(); ScaleLabel = DEFAULT_SCALE_LABEL; // Create a list to hold the vectors _vectors = new List <DataSet.EnsembleVelocityVectors>(); }