IsoFieldViewer was changed
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
using FieldVisualizer.InfraStructures.Enums;
|
||||
using FieldVisualizer.InfraStructures.Exceptions;
|
||||
using FieldVisualizer.InfraStructures.Exceptions;
|
||||
using FieldVisualizer.InfraStructures.Strings;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace FieldVisualizer.Entities.ColorMaps.Factories
|
||||
{
|
||||
public enum ColorMapsTypes
|
||||
{
|
||||
LiraSpectrum = 0, //Lira
|
||||
FullSpectrum = 1, //StaDiCon
|
||||
RedToWhite = 2,
|
||||
RedToBlue = 3,
|
||||
BlueToWhite = 4,
|
||||
}
|
||||
/// <summary>
|
||||
/// Factory for creating of different color maps
|
||||
/// </summary>
|
||||
@@ -18,13 +24,39 @@ namespace FieldVisualizer.Entities.ColorMaps.Factories
|
||||
if (mapsTypes == ColorMapsTypes.RedToWhite) { return GetRedToWhite(); }
|
||||
if (mapsTypes == ColorMapsTypes.RedToBlue) { return GetRedToBlue(); }
|
||||
if (mapsTypes == ColorMapsTypes.BlueToWhite) { return GetBlueToWhite(); }
|
||||
if (mapsTypes == ColorMapsTypes.LiraSpectrum) { return GetLiraSpectrum(); }
|
||||
else { throw new FieldVisulizerException(ErrorStrings.ColorMapTypeIsUnknown); }
|
||||
}
|
||||
|
||||
private static IColorMap GetLiraSpectrum()
|
||||
{
|
||||
ColorMap colorMap = new()
|
||||
{
|
||||
Name = "LiraSpectrumColorMap"
|
||||
};
|
||||
List<Color> colors = new();
|
||||
byte Alpha = 0xff;
|
||||
colors.AddRange(new Color[]{
|
||||
Color.FromArgb(Alpha, 0, 0, 128) ,//Dark Blue
|
||||
Color.FromArgb(Alpha, 0, 0, 255) ,//Blue
|
||||
Color.FromArgb(Alpha, 0, 128, 255) ,//Blue
|
||||
Color.FromArgb(Alpha, 0, 200, 255) ,//Blue
|
||||
Color.FromArgb(Alpha, 60, 255, 255) ,//Light Blue
|
||||
Color.FromArgb(Alpha, 255, 255, 128) ,//Light Yellow
|
||||
Color.FromArgb(Alpha, 255, 255, 0) ,//Yellow
|
||||
Color.FromArgb(Alpha, 255, 215, 0) ,//Gold
|
||||
Color.FromArgb(Alpha, 255, 128, 0) ,//Orange Red
|
||||
Color.FromArgb(Alpha, 255, 0, 0) ,//Red
|
||||
});
|
||||
colorMap.Colors = colors;
|
||||
return colorMap;
|
||||
}
|
||||
private static IColorMap GetFullSpectrum()
|
||||
{
|
||||
ColorMap colorMap = new ColorMap();
|
||||
colorMap.Name = "FullSpectrumColorMap";
|
||||
ColorMap colorMap = new()
|
||||
{
|
||||
Name = "FullSpectrumColorMap"
|
||||
};
|
||||
List<Color> colors = new List<Color>();
|
||||
byte Alpha = 0xff;
|
||||
colors.AddRange(new Color[]{
|
||||
@@ -43,7 +75,6 @@ namespace FieldVisualizer.Entities.ColorMaps.Factories
|
||||
colorMap.Colors = colors;
|
||||
return colorMap;
|
||||
}
|
||||
|
||||
private static IColorMap GetRedToWhite()
|
||||
{
|
||||
ColorMap colorMap = new ColorMap();
|
||||
@@ -57,7 +88,6 @@ namespace FieldVisualizer.Entities.ColorMaps.Factories
|
||||
colorMap.Colors = colors;
|
||||
return colorMap;
|
||||
}
|
||||
|
||||
private static IColorMap GetRedToBlue()
|
||||
{
|
||||
ColorMap colorMap = new ColorMap();
|
||||
@@ -71,7 +101,6 @@ namespace FieldVisualizer.Entities.ColorMaps.Factories
|
||||
colorMap.Colors = colors;
|
||||
return colorMap;
|
||||
}
|
||||
|
||||
private static IColorMap GetBlueToWhite()
|
||||
{
|
||||
ColorMap colorMap = new ColorMap();
|
||||
|
||||
@@ -1,19 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace FieldVisualizer.Entities.ColorMaps
|
||||
{
|
||||
/// <summary>
|
||||
/// Colored range for building color legend
|
||||
/// </summary>
|
||||
public interface IValueColorRange
|
||||
{
|
||||
/// <summary>
|
||||
/// Flag of activity
|
||||
/// </summary>
|
||||
bool IsActive { get; set; }
|
||||
/// <summary>
|
||||
/// Minimum value of range
|
||||
/// </summary>
|
||||
double BottomValue { get; set; }
|
||||
/// <summary>
|
||||
/// Average value of range
|
||||
/// </summary>
|
||||
double AverageValue { get; set; }
|
||||
/// <summary>
|
||||
/// Maximum value of range
|
||||
/// </summary>
|
||||
double TopValue {get;set;}
|
||||
/// <summary>
|
||||
/// Color correspondent to minimum value
|
||||
/// </summary>
|
||||
Color BottomColor { get; set; }
|
||||
/// <summary>
|
||||
/// Color correspondent to maximum value
|
||||
/// </summary>
|
||||
Color TopColor { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace FieldVisualizer.Entities.ColorMaps
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class ValueColorRange : IValueColorRange
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool IsActive { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public double BottomValue { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public double AverageValue { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public double TopValue { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public Color BottomColor { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public Color TopColor { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user