Viewer of IsoFields is added

This commit is contained in:
Evgeny Redikultsev
2022-09-04 19:47:09 +05:00
parent cf0392ad6f
commit c12e9f70f9
43 changed files with 1550 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Windows.Media;
using System.Text;
namespace FieldVisualizer.Entities.ColorMaps
{
public class ColorMap : IColorMap
{
public string Name { get; set; }
public List<Color> Colors { get; set; }
}
}

View File

@@ -0,0 +1,86 @@
using FieldVisualizer.InfraStructures.Enums;
using FieldVisualizer.InfraStructures.Exceptions;
using FieldVisualizer.InfraStructures.Strings;
using System;
using System.Collections.Generic;
using System.Windows.Media;
namespace FieldVisualizer.Entities.ColorMaps.Factories
{
public static class ColorMapFactory
{
public static IColorMap GetColorMap(ColorMapsTypes mapsTypes)
{
if (mapsTypes == ColorMapsTypes.FullSpectrum) { return GetFullSpectrum(); }
if (mapsTypes == ColorMapsTypes.RedToWhite) { return GetRedToWhite(); }
if (mapsTypes == ColorMapsTypes.RedToBlue) { return GetRedToBlue(); }
if (mapsTypes == ColorMapsTypes.BlueToWhite) { return GetBlueToWhite(); }
else { throw new FieldVisulizerException(ErrorStrings.ColorMapTypeIsUnknown); }
}
private static IColorMap GetFullSpectrum()
{
ColorMap colorMap = new ColorMap();
colorMap.Name = "FullSpectrumColorMap";
List<Color> colors = new List<Color>();
byte Alpha = 0xff;
colors.AddRange(new Color[]{
Color.FromArgb(Alpha, 0xFF, 0x80, 0x80) ,//
Color.FromArgb(Alpha, 0xFF, 0, 0x80) ,//
Color.FromArgb(Alpha, 0xFF, 0, 0) ,//Red
Color.FromArgb(Alpha, 0xFF, 0x45, 0) ,//Orange Red
Color.FromArgb(Alpha, 0xFF, 0xD7, 0) ,//Gold
Color.FromArgb(Alpha, 0xFF, 0xFF, 0) ,//Yellow
Color.FromArgb(Alpha, 0x9A, 0xCD, 0x32) ,//Yellow Green
Color.FromArgb(Alpha, 0, 0x80, 0) ,//Green
Color.FromArgb(Alpha, 0, 0x64, 0) ,//Dark Green
Color.FromArgb(Alpha, 0x2F, 0x4F, 0x4F) ,//Dark Slate Gray
Color.FromArgb(Alpha, 0, 0, 0xFF) ,//Blue
});
colorMap.Colors = colors;
return colorMap;
}
private static IColorMap GetRedToWhite()
{
ColorMap colorMap = new ColorMap();
colorMap.Name = "FullSpectrumColorMap";
List<Color> colors = new List<Color>();
byte Alpha = 0xff;
colors.AddRange(new Color[]{
Color.FromArgb(Alpha, 0xFF, 0, 0) ,//Red
Color.FromArgb(Alpha, 0xFF, 0xFF, 0xFF) ,//White
});
colorMap.Colors = colors;
return colorMap;
}
private static IColorMap GetRedToBlue()
{
ColorMap colorMap = new ColorMap();
colorMap.Name = "FullSpectrumColorMap";
List<Color> colors = new List<Color>();
byte Alpha = 0xff;
colors.AddRange(new Color[]{
Color.FromArgb(Alpha, 0xFF, 0, 0) ,//Red
Color.FromArgb(Alpha, 0, 0, 0xFF) ,//Blue
});
colorMap.Colors = colors;
return colorMap;
}
private static IColorMap GetBlueToWhite()
{
ColorMap colorMap = new ColorMap();
colorMap.Name = "FullSpectrumColorMap";
List<Color> colors = new List<Color>();
byte Alpha = 0xff;
colors.AddRange(new Color[]{
Color.FromArgb(Alpha, 0, 0, 0xFF) ,//Blue
Color.FromArgb(Alpha, 0xFF, 0xFF, 0xFF) ,//White
});
colorMap.Colors = colors;
return colorMap;
}
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Windows.Media;
using System.Text;
namespace FieldVisualizer.Entities.ColorMaps
{
public interface IColorMap
{
string Name { get;}
List<Color> Colors { get; }
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace FieldVisualizer.Entities.ColorMaps
{
public interface IValueColorRange
{
bool IsActive { get; set; }
double BottomValue { get; set; }
double AverageValue { get; set; }
double TopValue {get;set;}
Color BottomColor { get; set; }
Color TopColor { get; set; }
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace FieldVisualizer.Entities.ColorMaps
{
public class ValueColorRange : IValueColorRange
{
public bool IsActive { get; set; }
public double BottomValue { get; set; }
public double AverageValue { get; set; }
public double TopValue { get; set; }
public Color BottomColor { get; set; }
public Color TopColor { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace FieldVisualizer.Entities.Values
{
public interface IValueRange
{
double TopValue { get; set; }
double BottomValue { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FieldVisualizer.Entities.Values.Primitives
{
public interface ICenter
{
double CenterX { get;}
double CenterY { get;}
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FieldVisualizer.Entities.Values.Primitives
{
public interface IPrimitiveSet
{
string Name { get; }
IEnumerable<IValuePrimitive> ValuePrimitives { get; }
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FieldVisualizer.Entities.Values.Primitives
{
internal interface IRectanglePrimitive : IValuePrimitive
{
double Height { get; set; }
double Width { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FieldVisualizer.Entities.Values.Primitives
{
public interface IValuePrimitive
{
double Value { get; }
double CenterX { get; }
double CenterY { get; }
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FieldVisualizer.Entities.Values.Primitives
{
public class PrimitiveSet : IPrimitiveSet
{
public string Name { get; set; }
public IEnumerable<IValuePrimitive> ValuePrimitives { get; set;}
public PrimitiveSet()
{
Name = "New set of primitives";
ValuePrimitives = new List<IValuePrimitive>();
}
}
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FieldVisualizer.Entities.Values.Primitives
{
public class RectanglePrimitive : IRectanglePrimitive
{
public double Height { get; set; }
public double Width { get; set; }
public double Value { get; set; }
public double CenterX { get; set; }
public double CenterY { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace FieldVisualizer.Entities.Values
{
public class ValueRange : IValueRange
{
public double TopValue { get; set; }
public double BottomValue { get; set; }
}
}