Viewer of IsoFields is added
This commit is contained in:
13
FieldVisualizer/Entities/ColorMaps/ColorMap.cs
Normal file
13
FieldVisualizer/Entities/ColorMaps/ColorMap.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
FieldVisualizer/Entities/ColorMaps/IColorMap.cs
Normal file
13
FieldVisualizer/Entities/ColorMaps/IColorMap.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
19
FieldVisualizer/Entities/ColorMaps/IValueColorRange.cs
Normal file
19
FieldVisualizer/Entities/ColorMaps/IValueColorRange.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
19
FieldVisualizer/Entities/ColorMaps/ValueColorRange.cs
Normal file
19
FieldVisualizer/Entities/ColorMaps/ValueColorRange.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
12
FieldVisualizer/Entities/Values/IValueRange.cs
Normal file
12
FieldVisualizer/Entities/Values/IValueRange.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
14
FieldVisualizer/Entities/Values/Primitives/ICenter.cs
Normal file
14
FieldVisualizer/Entities/Values/Primitives/ICenter.cs
Normal 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;}
|
||||
}
|
||||
}
|
||||
15
FieldVisualizer/Entities/Values/Primitives/IPrimitiveSet.cs
Normal file
15
FieldVisualizer/Entities/Values/Primitives/IPrimitiveSet.cs
Normal 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; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
20
FieldVisualizer/Entities/Values/Primitives/PrimitiveSet.cs
Normal file
20
FieldVisualizer/Entities/Values/Primitives/PrimitiveSet.cs
Normal 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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
12
FieldVisualizer/Entities/Values/ValueRange.cs
Normal file
12
FieldVisualizer/Entities/Values/ValueRange.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user