diff --git a/FieldVisualizer/Entities/ColorMaps/Factories/ColorMapFactory.cs b/FieldVisualizer/Entities/ColorMaps/Factories/ColorMapFactory.cs index b5c0010..e259a79 100644 --- a/FieldVisualizer/Entities/ColorMaps/Factories/ColorMapFactory.cs +++ b/FieldVisualizer/Entities/ColorMaps/Factories/ColorMapFactory.cs @@ -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, + } /// /// Factory for creating of different color maps /// @@ -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 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 colors = new List(); 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(); diff --git a/FieldVisualizer/Entities/ColorMaps/IValueColorArray.cs b/FieldVisualizer/Entities/ColorMaps/IValueColorArray.cs new file mode 100644 index 0000000..1bed0b5 --- /dev/null +++ b/FieldVisualizer/Entities/ColorMaps/IValueColorArray.cs @@ -0,0 +1,13 @@ +using System.Windows.Media; + +namespace FieldVisualizer.Entities.ColorMaps +{ + public interface IValueColorArray + { + double AverageValue { get; set; } + Color BottomColor { get; set; } + double BottomValue { get; set; } + Color TopColor { get; set; } + double TopValue { get; set; } + } +} \ No newline at end of file diff --git a/FieldVisualizer/Entities/ColorMaps/IValueColorRange.cs b/FieldVisualizer/Entities/ColorMaps/IValueColorRange.cs index d4da2bc..85063a2 100644 --- a/FieldVisualizer/Entities/ColorMaps/IValueColorRange.cs +++ b/FieldVisualizer/Entities/ColorMaps/IValueColorRange.cs @@ -1,19 +1,18 @@ -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 { + /// + /// Colored range for building color legend + /// public interface IValueColorRange { + /// + /// Flag of activity + /// bool IsActive { get; set; } - double BottomValue { get; set; } - double AverageValue { get; set; } - double TopValue {get;set;} - Color BottomColor { get; set; } - Color TopColor { get; set; } + IValueColorArray ExactValues { get; } + IValueColorArray RoundedValues { get; } + } } diff --git a/FieldVisualizer/Entities/ColorMaps/ValueColorArray.cs b/FieldVisualizer/Entities/ColorMaps/ValueColorArray.cs new file mode 100644 index 0000000..66cd001 --- /dev/null +++ b/FieldVisualizer/Entities/ColorMaps/ValueColorArray.cs @@ -0,0 +1,33 @@ +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 ValueColorArray : IValueColorArray + { + /// + /// Minimum value of range + /// + public double BottomValue { get; set; } + /// + /// Average value of range + /// + public double AverageValue { get; set; } + /// + /// Maximum value of range + /// + public double TopValue { get; set; } + /// + /// Color correspondent to minimum value + /// + public Color BottomColor { get; set; } + /// + /// Color correspondent to maximum value + /// + public Color TopColor { get; set; } + } +} diff --git a/FieldVisualizer/Entities/ColorMaps/ValueColorRange.cs b/FieldVisualizer/Entities/ColorMaps/ValueColorRange.cs index 92eaff5..6813268 100644 --- a/FieldVisualizer/Entities/ColorMaps/ValueColorRange.cs +++ b/FieldVisualizer/Entities/ColorMaps/ValueColorRange.cs @@ -1,19 +1,16 @@ -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 { + /// 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; } + + public IValueColorArray ExactValues { get; private set; } = new ValueColorArray(); + + public IValueColorArray RoundedValues { get; private set; } = new ValueColorArray(); + } } diff --git a/FieldVisualizer/FieldVisualizer.csproj b/FieldVisualizer/FieldVisualizer.csproj index 0a3b622..dc9183b 100644 --- a/FieldVisualizer/FieldVisualizer.csproj +++ b/FieldVisualizer/FieldVisualizer.csproj @@ -8,4 +8,12 @@ 7.0 + + + + + + + + diff --git a/FieldVisualizer/InfraStructures/Enums/ColorMapsTypes.cs b/FieldVisualizer/InfraStructures/Enums/ColorMapsTypes.cs deleted file mode 100644 index 5be9d8c..0000000 --- a/FieldVisualizer/InfraStructures/Enums/ColorMapsTypes.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace FieldVisualizer.InfraStructures.Enums -{ - public enum ColorMapsTypes - { - FullSpectrum = 0, - RedToWhite = 1, - RedToBlue = 2, - BlueToWhite = 3 - } -} diff --git a/FieldVisualizer/Services/ColorServices/ColorOperations.cs b/FieldVisualizer/Services/ColorServices/ColorOperations.cs index dd4c7c7..412f247 100644 --- a/FieldVisualizer/Services/ColorServices/ColorOperations.cs +++ b/FieldVisualizer/Services/ColorServices/ColorOperations.cs @@ -1,5 +1,7 @@ using FieldVisualizer.Entities.ColorMaps; using FieldVisualizer.Entities.Values; +using StructureHelperCommon.Infrastructures.Exceptions; +using StructureHelperCommon.Services; using System; using System.Collections.Generic; using System.Text; @@ -10,54 +12,132 @@ namespace FieldVisualizer.Services.ColorServices public static class ColorOperations { const byte Alpha = 0xff; - public static Color GetColorByValue(IValueRange range, IColorMap map, double val) - { - if (range.TopValue == range.BottomValue || map.Colors.Count == 0) { return map.Colors[0]; } - double minVal = range.BottomValue - 1e-15d*(Math.Abs(range.BottomValue)); - double maxVal = range.TopValue + 1e-15d * (Math.Abs(range.TopValue)); - if (val > maxVal || val < minVal) { return Colors.Gray; } - if (val == minVal) { return map.Colors[0]; } - if (val == maxVal) { return map.Colors[map.Colors.Count - 1]; } - - double valPerc = (val - minVal) / (maxVal - minVal);// value% - if (valPerc >= 1d) - { return map.Colors[map.Colors.Count - 1]; } - double colorPerc = 1d / (map.Colors.Count - 1d); // % of each block of color. the last is the "100% Color" - double blockOfColor = valPerc / colorPerc;// the integer part repersents how many block to skip - int blockIdx = (int)Math.Truncate(blockOfColor);// Idx of - double valPercResidual = valPerc - (blockIdx * colorPerc);//remove the part represented of block - double percOfColor = valPercResidual / colorPerc;// % of color of this block that will be filled - - Color cTarget = map.Colors[blockIdx]; - Color cNext = map.Colors[blockIdx + 1]; - - var deltaR = cNext.R - cTarget.R; - var deltaG = cNext.G - cTarget.G; - var deltaB = cNext.B - cTarget.B; - - var R = cTarget.R + (deltaR * percOfColor); - var G = cTarget.G + (deltaG * percOfColor); - var B = cTarget.B + (deltaB * percOfColor); - - Color c = map.Colors[0]; - c = Color.FromArgb(Alpha, (byte)R, (byte)G, (byte)B); - return c; - } + static IMathRoundLogic roundLogic = new SmartRoundLogic(); + /// + /// + /// + /// + /// + /// + /// public static IEnumerable GetValueColorRanges(IValueRange fullRange, IEnumerable valueRanges, IColorMap colorMap) { var colorRanges = new List(); foreach (var valueRange in valueRanges) { - IValueColorRange valueColorRange = new ValueColorRange(); - valueColorRange.IsActive = true; - valueColorRange.BottomValue = valueRange.BottomValue; - valueColorRange.AverageValue = (valueRange.BottomValue + valueRange.TopValue) / 2; - valueColorRange.TopValue = valueRange.TopValue; - valueColorRange.BottomColor = GetColorByValue(fullRange, colorMap, valueColorRange.BottomValue); - valueColorRange.TopColor = GetColorByValue(fullRange, colorMap, valueColorRange.TopValue); + var valueColorRange = new ValueColorRange + { + IsActive = true, + }; + valueColorRange.ExactValues.BottomValue = valueRange.BottomValue; + valueColorRange.ExactValues.AverageValue = (valueRange.BottomValue + valueRange.TopValue) / 2; + valueColorRange.ExactValues.TopValue = valueRange.TopValue; + valueColorRange.ExactValues.BottomColor = GetColorByValue(fullRange, colorMap, valueColorRange.ExactValues.BottomValue); + valueColorRange.ExactValues.TopColor = GetColorByValue(fullRange, colorMap, valueColorRange.ExactValues.TopValue); + valueColorRange.RoundedValues.BottomValue = roundLogic.RoundValue(valueColorRange.ExactValues.BottomValue); + valueColorRange.RoundedValues.AverageValue = roundLogic.RoundValue(valueColorRange.ExactValues.AverageValue); + valueColorRange.RoundedValues.TopValue = roundLogic.RoundValue(valueColorRange.ExactValues.TopValue); colorRanges.Add(valueColorRange); } return colorRanges; } + /// + /// Returns color by value, range of value an color map + /// + /// Range of valoue + /// Color map + /// Value + /// + public static Color GetColorByValue(IValueRange range, IColorMap map, double val) + { + CheckColorMap(map); + if (range.TopValue == range.BottomValue || map.Colors.Count == 1) //if range width is zero or map contain just 1 color + { + return map.Colors[0]; + } + var valueRange = GetExtendedRange(range); + if (val >= valueRange.TopValue || val <= valueRange.BottomValue) + { + return GetColorValueIsOutOfRange(valueRange, map, val); + } + return GetColorValueIsInRange(valueRange, map, val); + } + + private static Color GetColorValueIsOutOfRange(IValueRange range, IColorMap map, double val) + { + if (val > range.TopValue || val < range.BottomValue) + { + return Colors.Gray; + } + if (val == range.BottomValue) + { + return map.Colors[0]; + } + if (val == range.TopValue) + { + return map.Colors[^1]; + } + throw new StructureHelperException(ErrorStrings.DataIsInCorrect); + } + + private static Color GetColorValueIsInRange(IValueRange range, IColorMap map, double val) + { + var deltaVal = val - range.BottomValue; + var rangeWidth = range.TopValue - range.BottomValue; + var valPerc = deltaVal / rangeWidth; // percent of value on the distance from minValue to maxValue + if (valPerc >= 1d) + { + return map.Colors[^1]; + } + double colorPerc = 1d / (map.Colors.Count - 1d); // % of each block of color. the last is the "100% Color" + double blockOfColor = valPerc / colorPerc;// the integer part represents how many block to skip + int blockIdx = (int)Math.Truncate(blockOfColor);// Idx of + double valPercResidual = valPerc - (blockIdx * colorPerc);//remove the part represented of block + double percOfColor = valPercResidual / colorPerc;// % of color of this block that will be filled + + //in some cases due to accuracy of double type percent of color may be less than zero + if (percOfColor <= 0d) + { + return map.Colors[blockIdx]; + } + Color c = GetColorByColorMap(map, blockIdx, percOfColor); + return c; + } + + private static IValueRange GetExtendedRange(IValueRange range) + { + var minVal = range.BottomValue - 1e-15d * Math.Abs(range.BottomValue); + var maxVal = range.TopValue + 1e-15d * Math.Abs(range.TopValue); + return new ValueRange() + { + BottomValue = minVal, + TopValue = maxVal + }; + } + + private static Color GetColorByColorMap(IColorMap map, int blockIdx, double percOfColor) + { + Color cTarget = map.Colors[blockIdx]; + Color cNext = map.Colors[blockIdx + 1]; + + var deltaRed = cNext.R - cTarget.R; + var deltaGreen = cNext.G - cTarget.G; + var deltaBlue = cNext.B - cTarget.B; + + var Red = cTarget.R + (deltaRed * percOfColor); + var Green = cTarget.G + (deltaGreen * percOfColor); + var Blue = cTarget.B + (deltaBlue * percOfColor); + + Color c = Color.FromArgb(Alpha, (byte)Red, (byte)Green, (byte)Blue); + return c; + } + + private static void CheckColorMap(IColorMap map) + { + if (map.Colors.Count == 0) + { + throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": Color map is empty"); + } + } } } diff --git a/FieldVisualizer/ViewModels/FieldViewerViewModels/FieldViewerViewModel.cs b/FieldVisualizer/ViewModels/FieldViewerViewModels/FieldViewerViewModel.cs index 4f16ce6..ca3b3a0 100644 --- a/FieldVisualizer/ViewModels/FieldViewerViewModels/FieldViewerViewModel.cs +++ b/FieldVisualizer/ViewModels/FieldViewerViewModels/FieldViewerViewModel.cs @@ -1,32 +1,29 @@ -using FieldVisualizer.Entities.ColorMaps.Factories; -using FieldVisualizer.Entities.ColorMaps; -using FieldVisualizer.Entities.Values.Primitives; +using FieldVisualizer.Entities.ColorMaps; +using FieldVisualizer.Entities.ColorMaps.Factories; using FieldVisualizer.Entities.Values; +using FieldVisualizer.Entities.Values.Primitives; using FieldVisualizer.Infrastructure.Commands; -using FieldVisualizer.InfraStructures.Enums; using FieldVisualizer.InfraStructures.Exceptions; using FieldVisualizer.InfraStructures.Strings; using FieldVisualizer.Services.ColorServices; using FieldVisualizer.Services.PrimitiveServices; using FieldVisualizer.Services.ValueRanges; +using FieldVisualizer.Windows.UserControls; +using StructureHelperCommon.Services; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; using System.Windows.Shapes; -using FieldVisualizer.Windows.UserControls; -using System.ComponentModel; -using System.Xml.Serialization; namespace FieldVisualizer.ViewModels.FieldViewerViewModels { public class FieldViewerViewModel : ViewModelBase, IDataErrorInfo { + private IMathRoundLogic roundLogic = new SmartRoundLogic() { DigitQuant = 3 }; public ICommand RebuildCommand { get; } public ICommand ZoomInCommand { get; } public ICommand ZoomOutCommand { get; } @@ -164,8 +161,8 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels private ColorMapsTypes _ColorMapType; private IColorMap _ColorMap; private IValueRange valueRange; - private IEnumerable _ValueRanges; - private IEnumerable _ValueColorRanges; + private IEnumerable valueRanges; + private IEnumerable valueColorRanges; private bool setMinValue; private bool setMaxValue; private double crossLineX; @@ -177,7 +174,7 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels public FieldViewerViewModel() { - _ColorMapType = ColorMapsTypes.FullSpectrum; + _ColorMapType = ColorMapsTypes.LiraSpectrum; RebuildCommand = new RelayCommand(o => ProcessPrimitives(), o => PrimitiveValidation()); ZoomInCommand = new RelayCommand(o => Zoom(1.2), o => PrimitiveValidation()); ZoomOutCommand = new RelayCommand(o => Zoom(0.8), o => PrimitiveValidation()); @@ -195,7 +192,7 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels if ((PrimitiveSet is null) == false) { ProcessPrimitives(); - Legend.ValueColorRanges = _ValueColorRanges; + Legend.ValueColorRanges = valueColorRanges; Legend.Refresh(); } } @@ -262,14 +259,14 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels { SolidColorBrush brush = new SolidColorBrush(); brush.Color = ColorOperations.GetColorByValue(valueRange, _ColorMap, valuePrimitive.Value); - foreach (var valueRange in _ValueColorRanges) + foreach (var valueRange in valueColorRanges) { - if (valuePrimitive.Value >= valueRange.BottomValue & valuePrimitive.Value <= valueRange.TopValue & (!valueRange.IsActive)) + if (valuePrimitive.Value >= valueRange.ExactValues.BottomValue & valuePrimitive.Value <= valueRange.ExactValues.TopValue & (!valueRange.IsActive)) { brush.Color = Colors.Gray; } } - shape.ToolTip = valuePrimitive.Value; + shape.ToolTip = roundLogic.RoundValue(valuePrimitive.Value); shape.Tag = valuePrimitive; shape.Fill = brush; Canvas.SetLeft(shape, valuePrimitive.CenterX - addX - dX); @@ -306,10 +303,24 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels { UserValueRange.TopValue = UserValueRange.BottomValue; } - if (SetMinValue) { valueRange.BottomValue = UserValueRange.BottomValue; } else { UserValueRange.BottomValue = valueRange.BottomValue; } - if (SetMaxValue) { valueRange.TopValue = UserValueRange.TopValue; } else { UserValueRange.TopValue = valueRange.TopValue; } - _ValueRanges = ValueRangeOperations.DivideValueRange(valueRange, RangeNumber); - _ValueColorRanges = ColorOperations.GetValueColorRanges(valueRange, _ValueRanges, _ColorMap); + if (SetMinValue == true) + { + valueRange.BottomValue = UserValueRange.BottomValue; + } + else + { + UserValueRange.BottomValue = valueRange.BottomValue; + } + if (SetMaxValue == true) + { + valueRange.TopValue = UserValueRange.TopValue; + } + else + { + UserValueRange.TopValue = valueRange.TopValue; + } + valueRanges = ValueRangeOperations.DivideValueRange(valueRange, RangeNumber); + valueColorRanges = ColorOperations.GetValueColorRanges(valueRange, valueRanges, _ColorMap); } private void SetCrossLine(object commandParameter) { diff --git a/FieldVisualizer/Windows/UserControls/FieldViewer.xaml.cs b/FieldVisualizer/Windows/UserControls/FieldViewer.xaml.cs index 1166be2..96e6753 100644 --- a/FieldVisualizer/Windows/UserControls/FieldViewer.xaml.cs +++ b/FieldVisualizer/Windows/UserControls/FieldViewer.xaml.cs @@ -1,23 +1,7 @@ -using FieldVisualizer.Entities.ColorMaps; -using FieldVisualizer.Entities.ColorMaps.Factories; -using FieldVisualizer.Entities.Values; -using FieldVisualizer.Entities.Values.Primitives; -using FieldVisualizer.Infrastructure.Commands; -using FieldVisualizer.InfraStructures.Enums; -using FieldVisualizer.InfraStructures.Exceptions; -using FieldVisualizer.InfraStructures.Strings; -using FieldVisualizer.Services.ColorServices; -using FieldVisualizer.Services.PrimitiveServices; -using FieldVisualizer.Services.ValueRanges; +using FieldVisualizer.Entities.Values.Primitives; using FieldVisualizer.ViewModels.FieldViewerViewModels; -using System; -using System.Collections.Generic; -using System.Linq; using System.Windows; using System.Windows.Controls; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Shapes; namespace FieldVisualizer.Windows.UserControls { @@ -39,17 +23,6 @@ namespace FieldVisualizer.Windows.UserControls viewModel.Legend = LegendViewer; } - //public FieldViewer(FieldViewerViewModel vm) - //{ - // InitializeComponent(); - // viewModel = vm; - // this.DataContext = viewModel; - // PrimitiveSet = viewModel.PrimitiveSet; - // viewModel.WorkPlaneBox = WorkPlaneBox; - // viewModel.WorkPlaneCanvas = WorkPlaneCanvas; - // viewModel.Legend = LegendViewer; - //} - public IPrimitiveSet PrimitiveSet { get => viewModel.PrimitiveSet; set { viewModel.PrimitiveSet = value; } } internal void Refresh() diff --git a/FieldVisualizer/Windows/UserControls/VerticalLegend.xaml b/FieldVisualizer/Windows/UserControls/VerticalLegend.xaml index 5116791..58c8315 100644 --- a/FieldVisualizer/Windows/UserControls/VerticalLegend.xaml +++ b/FieldVisualizer/Windows/UserControls/VerticalLegend.xaml @@ -20,23 +20,23 @@ - + - + - - + + - - + + - + diff --git a/FieldVisualizer/Windows/WndFieldViewer.xaml b/FieldVisualizer/Windows/WndFieldViewer.xaml index 7362c15..7a290d6 100644 --- a/FieldVisualizer/Windows/WndFieldViewer.xaml +++ b/FieldVisualizer/Windows/WndFieldViewer.xaml @@ -6,7 +6,7 @@ xmlns:FieldViewerControl="clr-namespace:FieldVisualizer.Windows.UserControls" xmlns:local="clr-namespace:FieldVisualizer.Windows" mc:Ignorable="d" - Title="FieldViewer" Height="800" Width="1200" WindowStartupLocation="CenterOwner"> + Title="FieldViewer" Height="800" Width="1200" MinHeight="400" MinWidth="800" MaxHeight="1000" MaxWidth="1500" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"> diff --git a/StructureHelper.sln b/StructureHelper.sln index 10d38cf..7bf9930 100644 --- a/StructureHelper.sln +++ b/StructureHelper.sln @@ -14,6 +14,9 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StructureHelperLogics", "StructureHelperLogics\StructureHelperLogics.csproj", "{C9192AE7-EE6D-409C-A05C-3549D78CBB34}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FieldVisualizer", "FieldVisualizer\FieldVisualizer.csproj", "{6CAC5B83-81F3-47C2-92A1-0F94A58491C2}" + ProjectSection(ProjectDependencies) = postProject + {F1548BD2-7FE8-46C2-9BC4-9BA813A5C59A} = {F1548BD2-7FE8-46C2-9BC4-9BA813A5C59A} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/StructureHelper/App.xaml b/StructureHelper/App.xaml index 9d626e4..70db8cc 100644 --- a/StructureHelper/App.xaml +++ b/StructureHelper/App.xaml @@ -15,6 +15,11 @@ + + + + + diff --git a/StructureHelper/App.xaml.cs b/StructureHelper/App.xaml.cs index 0f7f3b1..86d7f43 100644 --- a/StructureHelper/App.xaml.cs +++ b/StructureHelper/App.xaml.cs @@ -22,15 +22,15 @@ namespace StructureHelper builder.RegisterType().As().SingleInstance(); builder.RegisterType().AsSelf().SingleInstance(); builder.RegisterType().AsSelf().SingleInstance(); - builder.RegisterType().AsSelf().SingleInstance(); - builder.RegisterType().AsSelf().SingleInstance(); + builder.RegisterType().AsSelf().SingleInstance(); + builder.RegisterType().AsSelf().SingleInstance(); - builder.RegisterType().AsSelf(); + builder.RegisterType().AsSelf(); Container = builder.Build(); Scope = Container.Resolve(); - var window = Scope.Resolve(); + var window = Scope.Resolve(); window.Show(); } diff --git a/StructureHelper/Documentation/License.txt b/StructureHelper/Documentation/License.txt new file mode 100644 index 0000000..31bf5cc --- /dev/null +++ b/StructureHelper/Documentation/License.txt @@ -0,0 +1,7 @@ +Copyright (c) 2023 Redikultsev Evgeny, Ekaterinburg, Russia + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/StructureHelper/Documentation/LicenseRus.txt b/StructureHelper/Documentation/LicenseRus.txt new file mode 100644 index 0000000..bdc1a69 --- /dev/null +++ b/StructureHelper/Documentation/LicenseRus.txt @@ -0,0 +1,7 @@ +Copyright (c) 2023 , , + + , ( ), , , , , , , , / , , , : + + . + + ܻ, - , , , , . - , , , , , - . \ No newline at end of file diff --git a/StructureHelper/Documentation/Manuals/UserManual.docx b/StructureHelper/Documentation/Manuals/UserManual.docx new file mode 100644 index 0000000..13c1427 Binary files /dev/null and b/StructureHelper/Documentation/Manuals/UserManual.docx differ diff --git a/StructureHelper/Documentation/Manuals/UserManual.pdf b/StructureHelper/Documentation/Manuals/UserManual.pdf new file mode 100644 index 0000000..5dca716 Binary files /dev/null and b/StructureHelper/Documentation/Manuals/UserManual.pdf differ diff --git a/StructureHelper/Infrastructure/Enums/ActionType.cs b/StructureHelper/Infrastructure/Enums/ActionType.cs new file mode 100644 index 0000000..3a81918 --- /dev/null +++ b/StructureHelper/Infrastructure/Enums/ActionType.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StructureHelper.Infrastructure.Enums +{ + public enum ActionType + { + ForceCombination, + ForceCombinationByFactor + } +} diff --git a/StructureHelper/Infrastructure/Enums/CalculatorTypes.cs b/StructureHelper/Infrastructure/Enums/CalculatorTypes.cs new file mode 100644 index 0000000..fd4e157 --- /dev/null +++ b/StructureHelper/Infrastructure/Enums/CalculatorTypes.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StructureHelper.Infrastructure.Enums +{ + public enum CalculatorTypes + { + ForceCalculator, + LimitCurveCalculator, + CrackCalculator, + FireCalculator + } +} diff --git a/StructureHelper/Infrastructure/Enums/MaterialType.cs b/StructureHelper/Infrastructure/Enums/MaterialType.cs new file mode 100644 index 0000000..19b6550 --- /dev/null +++ b/StructureHelper/Infrastructure/Enums/MaterialType.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StructureHelper.Infrastructure.Enums +{ + internal enum MaterialType + { + Concrete, + Reinforcement, + Elastic, + CarbonFiber, + GlassFiber + } +} diff --git a/StructureHelper/Infrastructure/Enums/PrimitiveType.cs b/StructureHelper/Infrastructure/Enums/PrimitiveType.cs index 7cf1ab0..fd86219 100644 --- a/StructureHelper/Infrastructure/Enums/PrimitiveType.cs +++ b/StructureHelper/Infrastructure/Enums/PrimitiveType.cs @@ -3,6 +3,8 @@ public enum PrimitiveType { Point, - Rectangle + Rectangle, + Circle, + Reinforcement } } \ No newline at end of file diff --git a/StructureHelper/Infrastructure/UI/Converters/CommonOperation.cs b/StructureHelper/Infrastructure/UI/Converters/CommonOperation.cs deleted file mode 100644 index ccad02e..0000000 --- a/StructureHelper/Infrastructure/UI/Converters/CommonOperation.cs +++ /dev/null @@ -1,100 +0,0 @@ -using Newtonsoft.Json.Linq; -using StructureHelper.Infrastructure.UI.Converters.Units; -using StructureHelperCommon.Infrastructures.Enums; -using StructureHelperCommon.Infrastructures.Exceptions; -using StructureHelperCommon.Infrastructures.Strings; -using StructureHelperCommon.Services.Units; -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -namespace StructureHelper.Infrastructure.UI.Converters -{ - internal static class CommonOperation - { - private static IEnumerable units = UnitsFactory.GetUnitCollection(); - - public static double ConvertToDoubleChangeComma(string s) - { - double result; - if (!double.TryParse(s, NumberStyles.Any, CultureInfo.CurrentCulture, out result) && - !double.TryParse(s, NumberStyles.Any, CultureInfo.GetCultureInfo("en-US"), out result) && - !double.TryParse(s, NumberStyles.Any, CultureInfo.InvariantCulture, out result)) - { - throw new StructureHelperException($"{ErrorStrings.IncorrectValue}: {s}"); - } - return result; - } - - public static IStringDoublePair DivideIntoStringDoublePair(string s) - { - s = s.Replace(" ", ""); - string digitPattern = @"^[-]?[+]?\d+(\.?|\,?)\d*"; - string textPattern = @"[0-9]|\.|\,"; - string caracterPattern = "[a-z]+$"; - string target = ""; - Regex regexText = new Regex(textPattern); - string textString = regexText.Replace(s, target); - var textMatch = Regex.Match(textString, caracterPattern, RegexOptions.IgnoreCase); - if (textMatch.Success) {textString = textMatch.Value.ToLower();} - var match = Regex.Match(s, digitPattern); - if (match.Success) - { - string digitString = match.Value; - double digit = ConvertToDoubleChangeComma(digitString); - return new StringDoublePair() { Digit = digit, Text = textString }; - } - throw new StructureHelperException(ErrorStrings.DataIsInCorrect); - } - - public static IUnit GetUnit(UnitTypes unitType, string unitName) - { - return units.Where(u => u.UnitType == unitType & u.Name == unitName).Single(); - } - - public static string Convert(IUnit unit, string unitName, object value) - { - double val; - if (value != null) { val = (double)value; } - else { throw new Exception($"{unitName} value is null"); } - val *= unit.Multiplyer; - string strValue = $"{val} {unit.Name}"; - return strValue; - } - - public static double ConvertBack(UnitTypes unitType, IUnit unit, object value) - { - double val; - double multy; - double coefficient = unit.Multiplyer; - var strVal = value as string; - IStringDoublePair pair = DivideIntoStringDoublePair(strVal); - try - { - multy = GetMultiplyer(unitType, pair.Text); - } - catch (Exception ex) - { - multy = coefficient; - } - val = pair.Digit / multy; - return val; - } - - private static double GetMultiplyer(UnitTypes unitType, string unitName) - { - try - { - return units.Where(u => u.UnitType == unitType & u.Name == unitName).Single().Multiplyer; - } - catch (Exception ex) - { - throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ex); - } - } - } -} diff --git a/StructureHelper/Infrastructure/UI/Converters/IStringDoublePair.cs b/StructureHelper/Infrastructure/UI/Converters/IStringDoublePair.cs deleted file mode 100644 index 83de3b6..0000000 --- a/StructureHelper/Infrastructure/UI/Converters/IStringDoublePair.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StructureHelper.Infrastructure.UI.Converters -{ - internal interface IStringDoublePair - { - double Digit { get; } - string Text { get; } - } -} diff --git a/StructureHelper/Infrastructure/UI/Converters/Units/Area.cs b/StructureHelper/Infrastructure/UI/Converters/Units/Area.cs index 383fb7f..74a112d 100644 --- a/StructureHelper/Infrastructure/UI/Converters/Units/Area.cs +++ b/StructureHelper/Infrastructure/UI/Converters/Units/Area.cs @@ -14,7 +14,7 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units internal class Area : UnitBase { public override UnitTypes UnitType { get => UnitTypes.Area; } - public override IUnit CurrentUnit { get => CommonOperation.GetUnit(UnitType, "mm2"); } + public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "mm2"); } public override string UnitName { get => "Area"; } } } diff --git a/StructureHelper/Infrastructure/UI/Converters/Units/CrackWidth.cs b/StructureHelper/Infrastructure/UI/Converters/Units/CrackWidth.cs new file mode 100644 index 0000000..e520311 --- /dev/null +++ b/StructureHelper/Infrastructure/UI/Converters/Units/CrackWidth.cs @@ -0,0 +1,28 @@ +using StructureHelperCommon.Infrastructures.Enums; +using StructureHelperCommon.Services; +using StructureHelperCommon.Services.Units; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StructureHelper.Infrastructure.UI.Converters.Units +{ + internal class CrackWidth : UnitBase + { + public CrackWidth() + { + OperationLogic = new ConvertUnitLogic() + { + MathRoundLogic = new FixedRoundLogic() + { + DigitQuant = 3 + } + }; + } + public override UnitTypes UnitType { get => UnitTypes.Length; } + public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "mm"); } + public override string UnitName { get => "Length"; } + } +} diff --git a/StructureHelper/Infrastructure/UI/Converters/Units/Curvature.cs b/StructureHelper/Infrastructure/UI/Converters/Units/Curvature.cs index ec5a34b..1a34053 100644 --- a/StructureHelper/Infrastructure/UI/Converters/Units/Curvature.cs +++ b/StructureHelper/Infrastructure/UI/Converters/Units/Curvature.cs @@ -11,7 +11,7 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units internal class Curvature : UnitBase { public override UnitTypes UnitType { get => UnitTypes.Curvature; } - public override IUnit CurrentUnit { get => CommonOperation.GetUnit(UnitType, "1/mm"); } + public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "1/mm"); } public override string UnitName { get => "Curvature"; } } } diff --git a/StructureHelper/Infrastructure/UI/Converters/Units/Force.cs b/StructureHelper/Infrastructure/UI/Converters/Units/Force.cs index 408660d..941f47d 100644 --- a/StructureHelper/Infrastructure/UI/Converters/Units/Force.cs +++ b/StructureHelper/Infrastructure/UI/Converters/Units/Force.cs @@ -13,7 +13,7 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units internal class Force : UnitBase { public override UnitTypes UnitType { get => UnitTypes.Force; } - public override IUnit CurrentUnit { get => CommonOperation.GetUnit(UnitType, "kN"); } + public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "kN"); } public override string UnitName { get => "Force"; } } } diff --git a/StructureHelper/Infrastructure/UI/Converters/Units/Length.cs b/StructureHelper/Infrastructure/UI/Converters/Units/Length.cs index e991a30..e4a01e1 100644 --- a/StructureHelper/Infrastructure/UI/Converters/Units/Length.cs +++ b/StructureHelper/Infrastructure/UI/Converters/Units/Length.cs @@ -1,22 +1,13 @@ using StructureHelperCommon.Infrastructures.Enums; -using StructureHelperCommon.Infrastructures.Exceptions; -using StructureHelperCommon.Infrastructures.Strings; using StructureHelperCommon.Services.Units; -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Data; namespace StructureHelper.Infrastructure.UI.Converters.Units { internal class Length : UnitBase { + public override UnitTypes UnitType { get => UnitTypes.Length; } - public override IUnit CurrentUnit { get => CommonOperation.GetUnit(UnitType, "mm"); } + public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "mm"); } public override string UnitName { get => "Length"; } } } diff --git a/StructureHelper/Infrastructure/UI/Converters/Units/Moment.cs b/StructureHelper/Infrastructure/UI/Converters/Units/Moment.cs index 76f8d6d..f260d7a 100644 --- a/StructureHelper/Infrastructure/UI/Converters/Units/Moment.cs +++ b/StructureHelper/Infrastructure/UI/Converters/Units/Moment.cs @@ -11,7 +11,7 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units internal class Moment : UnitBase { public override UnitTypes UnitType { get => UnitTypes.Moment; } - public override IUnit CurrentUnit { get => CommonOperation.GetUnit(UnitType, "kNm"); } + public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "kNm"); } public override string UnitName { get => "Moment"; } } } diff --git a/StructureHelper/Infrastructure/UI/Converters/Units/PlainDouble.cs b/StructureHelper/Infrastructure/UI/Converters/Units/PlainDouble.cs index 6ab470e..48cd0ac 100644 --- a/StructureHelper/Infrastructure/UI/Converters/Units/PlainDouble.cs +++ b/StructureHelper/Infrastructure/UI/Converters/Units/PlainDouble.cs @@ -1,5 +1,5 @@ using StructureHelperCommon.Infrastructures.Exceptions; -using StructureHelperCommon.Infrastructures.Strings; +using StructureHelperCommon.Services.Units; using System; using System.Collections.Generic; using System.Globalization; @@ -12,6 +12,8 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units { internal class PlainDouble : IValueConverter { + IConvertUnitLogic operationLogic = new ConvertUnitLogic(); + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { try @@ -28,7 +30,7 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units { try { - return CommonOperation.ConvertToDoubleChangeComma((string)value); + return ProcessString.ConvertCommaToCultureSettings((string)value); } catch (Exception) { diff --git a/StructureHelper/Infrastructure/UI/Converters/Units/Stress.cs b/StructureHelper/Infrastructure/UI/Converters/Units/Stress.cs index eec20ab..f07de25 100644 --- a/StructureHelper/Infrastructure/UI/Converters/Units/Stress.cs +++ b/StructureHelper/Infrastructure/UI/Converters/Units/Stress.cs @@ -1,4 +1,5 @@ using StructureHelperCommon.Infrastructures.Enums; +using StructureHelperCommon.Services; using StructureHelperCommon.Services.Units; using System; using System.Collections.Generic; @@ -12,8 +13,19 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units { internal class Stress : UnitBase { + public override UnitTypes UnitType { get => UnitTypes.Stress; } - public override IUnit CurrentUnit { get => CommonOperation.GetUnit(UnitType, "MPa"); } + public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "MPa"); } public override string UnitName { get => "Stress"; } + public Stress() + { + OperationLogic = new ConvertUnitLogic() + { + MathRoundLogic = new SmartRoundLogic() + { + DigitQuant = 3 + } + }; + } } } diff --git a/StructureHelper/Infrastructure/UI/Converters/Units/UnitBase.cs b/StructureHelper/Infrastructure/UI/Converters/Units/UnitBase.cs index ef778b0..4955cf1 100644 --- a/StructureHelper/Infrastructure/UI/Converters/Units/UnitBase.cs +++ b/StructureHelper/Infrastructure/UI/Converters/Units/UnitBase.cs @@ -1,4 +1,7 @@ using StructureHelperCommon.Infrastructures.Enums; +using StructureHelperCommon.Models.Calculators; +using StructureHelperCommon.Models.Parameters; +using StructureHelperCommon.Services; using StructureHelperCommon.Services.Units; using System; using System.Collections.Generic; @@ -14,19 +17,61 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units { internal abstract class UnitBase : IValueConverter { + IMathRoundLogic roundLogic = new DirectRoundLogic(); + public IConvertUnitLogic OperationLogic { get; set; } = new ConvertUnitLogic(); + public IGetUnitLogic UnitLogic { get; set; } = new GetUnitLogic(); public abstract UnitTypes UnitType { get; } public abstract IUnit CurrentUnit { get; } public abstract string UnitName { get;} + /// + /// From variable to user + /// + /// + /// + /// + /// + /// public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return CommonOperation.Convert(CurrentUnit, UnitName, value); + var pair = OperationLogic.Convert(CurrentUnit, UnitName, value); + var result = pair.Value; + if (parameter is not null) + { + if (parameter is string paramString) + { + var logic = new ProcessDoublePairLogic() { DigitPlace = DigitPlace.Any }; + var paramPair = logic.GetValuePairByString(paramString); + string paramTextPart = paramPair.Text.ToLower(); + int paramValuePart = (int)paramPair.Value; + if (paramTextPart == "smart") + { + roundLogic = new SmartRoundLogic() { DigitQuant = paramValuePart }; + } + else if (paramTextPart == "fixed") + { + roundLogic = new FixedRoundLogic() { DigitQuant = paramValuePart }; + } + result = roundLogic.RoundValue(result); + } + } + string strValue = $"{result} {pair.Text}"; + return strValue; } - + /// + /// From user to variable + /// + /// + /// + /// + /// + /// public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { try { - return CommonOperation.ConvertBack(UnitType, CurrentUnit, value); + double result = OperationLogic.ConvertBack(UnitType, CurrentUnit, value); + + return result; } catch (Exception) { diff --git a/StructureHelper/Infrastructure/UI/Converters/Units/UnitConstatnts.cs b/StructureHelper/Infrastructure/UI/Converters/Units/UnitConstants.cs similarity index 88% rename from StructureHelper/Infrastructure/UI/Converters/Units/UnitConstatnts.cs rename to StructureHelper/Infrastructure/UI/Converters/Units/UnitConstants.cs index 26e085b..420de44 100644 --- a/StructureHelper/Infrastructure/UI/Converters/Units/UnitConstatnts.cs +++ b/StructureHelper/Infrastructure/UI/Converters/Units/UnitConstants.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace StructureHelper.Infrastructure.UI.Converters.Units { - internal static class UnitConstatnts + internal static class UnitConstants { public static double Length = 1e3d; public static double Force = 1e-3d; diff --git a/StructureHelper/Infrastructure/UI/DataContexts/CircleViewPrimitive.cs b/StructureHelper/Infrastructure/UI/DataContexts/CircleViewPrimitive.cs new file mode 100644 index 0000000..748b9ed --- /dev/null +++ b/StructureHelper/Infrastructure/UI/DataContexts/CircleViewPrimitive.cs @@ -0,0 +1,64 @@ +using StructureHelper.Infrastructure.UI.Converters.Units; +using StructureHelper.Windows.ViewModels.NdmCrossSections; +using StructureHelperCommon.Infrastructures.Exceptions; +using StructureHelperLogics.NdmCalculations.Primitives; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StructureHelper.Infrastructure.UI.DataContexts +{ + public class CircleViewPrimitive : PrimitiveBase, IHasCenter + { + ICirclePrimitive primitive; + public double Diameter + { + get + { + return primitive.Diameter; + } + set + { + primitive.Diameter = value; + RefreshPlacement(); + } + } + + public double PrimitiveLeft => DeltaX - Diameter / 2d; + public double PrimitiveTop => DeltaY - Diameter / 2d; + + public CircleViewPrimitive(INdmPrimitive primitive) : base(primitive) + { + if (primitive is not ICirclePrimitive) + { + throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $"\nExpected: {nameof(ICirclePrimitive)}, But was: {nameof(primitive)}"); + } + var circle = primitive as ICirclePrimitive; + this.primitive = circle; + DivisionViewModel = new HasDivisionViewModel(circle); + } + + public override INdmPrimitive GetNdmPrimitive() + { + return primitive; + } + + private void RefreshPlacement() + { + OnPropertyChanged(nameof(Diameter)); + OnPropertyChanged(nameof(CenterX)); + OnPropertyChanged(nameof(CenterY)); + OnPropertyChanged(nameof(PrimitiveLeft)); + OnPropertyChanged(nameof(PrimitiveTop)); + } + public override void Refresh() + { + OnPropertyChanged(nameof(Diameter)); + OnPropertyChanged(nameof(PrimitiveLeft)); + OnPropertyChanged(nameof(PrimitiveTop)); + base.Refresh(); + } + } +} diff --git a/StructureHelper/Infrastructure/UI/DataContexts/Factories/ViewPrimitiveFactory.cs b/StructureHelper/Infrastructure/UI/DataContexts/Factories/ViewPrimitiveFactory.cs new file mode 100644 index 0000000..82d9ada --- /dev/null +++ b/StructureHelper/Infrastructure/UI/DataContexts/Factories/ViewPrimitiveFactory.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StructureHelper.Infrastructure.UI.DataContexts +{ + internal static class ViewPrimitiveFactory + { + // to do public static PrimitiveBase GetViewPrimitive() { } + } +} diff --git a/StructureHelper/Infrastructure/UI/DataContexts/IHasDivision.cs b/StructureHelper/Infrastructure/UI/DataContexts/IHasDivision.cs index 463022d..e6353db 100644 --- a/StructureHelper/Infrastructure/UI/DataContexts/IHasDivision.cs +++ b/StructureHelper/Infrastructure/UI/DataContexts/IHasDivision.cs @@ -1,4 +1,5 @@ -using System; +using StructureHelper.Windows.ViewModels.NdmCrossSections; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,7 +9,6 @@ namespace StructureHelper.Infrastructure.UI.DataContexts { internal interface IHasDivision { - int NdmMinDivision { get; set; } - double NdmMaxSize { get; set; } + HasDivisionViewModel HasDivisionViewModel { get; } } } diff --git a/StructureHelper/Infrastructure/UI/DataContexts/LineViewPrimitive.cs b/StructureHelper/Infrastructure/UI/DataContexts/LineViewPrimitive.cs deleted file mode 100644 index d9df827..0000000 --- a/StructureHelper/Infrastructure/UI/DataContexts/LineViewPrimitive.cs +++ /dev/null @@ -1,27 +0,0 @@ -using StructureHelper.Infrastructure.Enums; -using StructureHelper.Services.Primitives; -using StructureHelper.UnitSystem.Systems; -using StructureHelper.Windows.MainWindow; -using StructureHelperCommon.Models.Shapes; -using StructureHelperLogics.Models.Primitives; -using StructureHelperLogics.NdmCalculations.Primitives; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StructureHelper.Infrastructure.UI.DataContexts -{ - internal class LineViewPrimitive : PrimitiveBase - { - public LineViewPrimitive(ILinePrimitive primitive) : base(primitive) - { - - } - - //public LineViewPrimitive(double x, double y, MainViewModel ownerVM) : base(x, y, ownerVM) - //{ - //} - } -} diff --git a/StructureHelper/Infrastructure/UI/DataContexts/PointViewPrimitive.cs b/StructureHelper/Infrastructure/UI/DataContexts/PointViewPrimitive.cs index cff5884..bc5d969 100644 --- a/StructureHelper/Infrastructure/UI/DataContexts/PointViewPrimitive.cs +++ b/StructureHelper/Infrastructure/UI/DataContexts/PointViewPrimitive.cs @@ -42,7 +42,11 @@ namespace StructureHelper.Infrastructure.UI.DataContexts { return primitive; } - + public override void Refresh() + { + RefreshPlacement(); + base.Refresh(); + } private void RefreshPlacement() { OnPropertyChanged(nameof(Area)); diff --git a/StructureHelper/Infrastructure/UI/DataContexts/PrimitiveBase.cs b/StructureHelper/Infrastructure/UI/DataContexts/PrimitiveBase.cs index 65f7625..47bfe52 100644 --- a/StructureHelper/Infrastructure/UI/DataContexts/PrimitiveBase.cs +++ b/StructureHelper/Infrastructure/UI/DataContexts/PrimitiveBase.cs @@ -1,27 +1,16 @@ -using System; -using System.Collections.Generic; -using System.Windows; -using System.Windows.Documents; +using StructureHelper.Models.Materials; +using StructureHelper.Services.Primitives; +using StructureHelper.Windows.MainWindow; +using StructureHelper.Windows.ViewModels.NdmCrossSections; +using StructureHelperCommon.Models.Shapes; +using StructureHelperLogics.NdmCalculations.Primitives; +using System; using System.Windows.Input; using System.Windows.Media; -using StructureHelper.Infrastructure.Enums; -using StructureHelper.Infrastructure.UI.Converters.Units; -using StructureHelper.Models.Materials; -using StructureHelper.Services.Primitives; -using StructureHelper.UnitSystem.Systems; -using StructureHelper.Windows.MainWindow; -using StructureHelperCommon.Infrastructures.Enums; -using StructureHelperCommon.Infrastructures.Exceptions; -using StructureHelperCommon.Infrastructures.Strings; -using StructureHelperLogics.Models.Materials; -using StructureHelperCommon.Services.ColorServices; -using StructureHelperLogics.Models.Primitives; -using System.Windows.Controls; -using StructureHelperLogics.NdmCalculations.Primitives; namespace StructureHelper.Infrastructure.UI.DataContexts { - public abstract class PrimitiveBase : ViewModelBase + public abstract class PrimitiveBase : ViewModelBase, IObserver { #region Поля private IPrimitiveRepository primitiveRepository; @@ -34,6 +23,7 @@ namespace StructureHelper.Infrastructure.UI.DataContexts #endregion #region Свойства + public HasDivisionViewModel DivisionViewModel { get; set; } public INdmPrimitive NdmPrimitive { get => primitive; @@ -51,52 +41,61 @@ namespace StructureHelper.Infrastructure.UI.DataContexts } public double CenterX { - get => primitive.CenterX; + get => primitive.Center.X; set { - primitive.CenterX = value; + primitive.Center.X = value; OnPropertyChanged(nameof(CenterX)); } } public double CenterY { - get => primitive.CenterY; + get => primitive.Center.Y; set { - primitive.CenterY = value; + primitive.Center.Y = value; OnPropertyChanged(nameof(CenterY)); OnPropertyChanged(nameof(InvertedCenterY)); } } - public double InvertedCenterY => - CenterY; - public double PrestrainKx - { get => primitive.UsersPrestrain.Kx; + public bool Triangulate + { + get => primitive.Triangulate; set { - primitive.UsersPrestrain.Kx = value; + primitive.Triangulate = value; + OnPropertyChanged(nameof(Triangulate)); + } + } + public double InvertedCenterY => - CenterY; + public double PrestrainKx + { get => primitive.UsersPrestrain.Mx; + set + { + primitive.UsersPrestrain.Mx = value; OnPropertyChanged(nameof(PrestrainKx)); } } public double PrestrainKy - { get => primitive.UsersPrestrain.Ky; + { get => primitive.UsersPrestrain.My; set { - primitive.UsersPrestrain.Ky = value; + primitive.UsersPrestrain.My = value; OnPropertyChanged(nameof(PrestrainKy)); } } public double PrestrainEpsZ - { get => primitive.UsersPrestrain.EpsZ; + { get => primitive.UsersPrestrain.Nz; set { - primitive.UsersPrestrain.EpsZ = value; + primitive.UsersPrestrain.Nz = value; OnPropertyChanged(nameof(PrestrainEpsZ)); } } - public double AutoPrestrainKx => primitive.AutoPrestrain.Kx; - public double AutoPrestrainKy => primitive.AutoPrestrain.Ky; - public double AutoPrestrainEpsZ => primitive.AutoPrestrain.EpsZ; + public double AutoPrestrainKx => primitive.AutoPrestrain.Mx; + public double AutoPrestrainKy => primitive.AutoPrestrain.My; + public double AutoPrestrainEpsZ => primitive.AutoPrestrain.Nz; public IHeadMaterial HeadMaterial { @@ -239,30 +238,45 @@ namespace StructureHelper.Infrastructure.UI.DataContexts this.primitive = primitive; } - public void RegisterDeltas(double dx, double dy) - { - DeltaX = dx; - DeltaY = dy; - } - - public MainViewModel OwnerVM { get; private set; } + public CrossSectionViewModel OwnerVM { get; private set; } public double DeltaX { get; private set; } public double DeltaY { get; private set; } public virtual INdmPrimitive GetNdmPrimitive() { - RefreshNdmPrimitive(); + //RefreshNdmPrimitive(); return primitive; } - public virtual void RefreshNdmPrimitive() + public virtual void Refresh() { + OnPropertyChanged(nameof(Name)); + OnPropertyChanged(nameof(Color)); + OnPropertyChanged(nameof(CenterX)); + OnPropertyChanged(nameof(CenterY)); + OnPropertyChanged(nameof(InvertedCenterY)); + OnPropertyChanged(nameof(SetMaterialColor)); + OnPropertyChanged(nameof(Triangulate)); + OnPropertyChanged(nameof(PrimitiveWidth)); + OnPropertyChanged(nameof(PrimitiveHeight)); } - public void RefreshColor() + public void OnCompleted() { - OnPropertyChanged(nameof(Color)); + throw new NotImplementedException(); + } + + public void OnError(Exception error) + { + throw new NotImplementedException(); + } + + public void OnNext(IRectangleShape value) + { + DeltaX = value.Width / 2d; + DeltaY = value.Height / 2d; + Refresh(); } } } diff --git a/StructureHelper/Infrastructure/UI/DataContexts/PrimitiveOperations.cs b/StructureHelper/Infrastructure/UI/DataContexts/PrimitiveOperations.cs index 7e3c315..1f963a0 100644 --- a/StructureHelper/Infrastructure/UI/DataContexts/PrimitiveOperations.cs +++ b/StructureHelper/Infrastructure/UI/DataContexts/PrimitiveOperations.cs @@ -1,5 +1,4 @@ using StructureHelperCommon.Infrastructures.Exceptions; -using StructureHelperCommon.Infrastructures.Strings; using StructureHelperLogics.Models.Primitives; using StructureHelperLogics.NdmCalculations.Primitives; using System; @@ -17,21 +16,37 @@ namespace StructureHelper.Infrastructure.UI.DataContexts public static ObservableCollection ConvertNdmPrimitivesToPrimitiveBase(IEnumerable primitives) { ObservableCollection viewItems = new ObservableCollection(); - foreach (var item in primitives) + foreach (var primitive in primitives) { - if (item is IPointPrimitive) - { - var point = item as IPointPrimitive; - viewItems.Add(new PointViewPrimitive(point)); - } - else if (item is IRectanglePrimitive) - { - var rect = item as IRectanglePrimitive; - viewItems.Add(new RectangleViewPrimitive(rect)); - } - else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown); + viewItems.Add(ConvertNdmPrimitiveToPrimitiveBase(primitive)); } return viewItems; } + public static PrimitiveBase ConvertNdmPrimitiveToPrimitiveBase(INdmPrimitive primitive) + { + PrimitiveBase viewItem; + if (primitive is IRectanglePrimitive) + { + var rect = primitive as IRectanglePrimitive; + viewItem = new RectangleViewPrimitive(rect); + } + else if (primitive is ICirclePrimitive) + { + var circle = primitive as ICirclePrimitive; + viewItem = new CircleViewPrimitive(circle); + } + else if (primitive is IPointPrimitive & primitive is not RebarPrimitive) + { + var point = primitive as IPointPrimitive; + viewItem = new PointViewPrimitive(point); + } + else if (primitive is RebarPrimitive) + { + var point = primitive as RebarPrimitive; + viewItem = new ReinforcementViewPrimitive(point); + } + else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + $". Actual type: {primitive.GetType()}"); + return viewItem; + } } } diff --git a/StructureHelper/Infrastructure/UI/DataContexts/RectangleViewPrimitive.cs b/StructureHelper/Infrastructure/UI/DataContexts/RectangleViewPrimitive.cs index 58697f1..f286553 100644 --- a/StructureHelper/Infrastructure/UI/DataContexts/RectangleViewPrimitive.cs +++ b/StructureHelper/Infrastructure/UI/DataContexts/RectangleViewPrimitive.cs @@ -1,15 +1,9 @@ -using StructureHelper.Infrastructure.Enums; -using StructureHelper.UnitSystem.Systems; -using StructureHelper.Windows.MainWindow; -using StructureHelperLogics.Models.Materials; -using StructureHelperCommon.Models.Shapes; -using System; -using StructureHelperLogics.Models.Primitives; +using StructureHelper.Windows.ViewModels.NdmCrossSections; using StructureHelperLogics.NdmCalculations.Primitives; namespace StructureHelper.Infrastructure.UI.DataContexts { - public class RectangleViewPrimitive : PrimitiveBase, IHasDivision, IHasCenter + public class RectangleViewPrimitive : PrimitiveBase, IHasCenter { private IRectanglePrimitive primitive; @@ -42,30 +36,18 @@ namespace StructureHelper.Infrastructure.UI.DataContexts { get => DeltaY - primitive.Height / 2d; } - public int NdmMinDivision - { - get => primitive.NdmMinDivision; - set - { - primitive.NdmMinDivision = value; - OnPropertyChanged(nameof(NdmMinDivision)); - } - } - public double NdmMaxSize - { - get => primitive.NdmMaxSize; - set - { - primitive.NdmMaxSize = value; - OnPropertyChanged(nameof(NdmMaxSize)); - } - } public RectangleViewPrimitive(IRectanglePrimitive _primitive) : base(_primitive) { primitive = _primitive; + DivisionViewModel = new HasDivisionViewModel(primitive); + } + public override void Refresh() + { + OnPropertyChanged(nameof(PrimitiveLeft)); + OnPropertyChanged(nameof(PrimitiveTop)); + base.Refresh(); } - public override INdmPrimitive GetNdmPrimitive() { return primitive; diff --git a/StructureHelper/Infrastructure/UI/DataContexts/ReinforcementViewPrimitive.cs b/StructureHelper/Infrastructure/UI/DataContexts/ReinforcementViewPrimitive.cs new file mode 100644 index 0000000..e644160 --- /dev/null +++ b/StructureHelper/Infrastructure/UI/DataContexts/ReinforcementViewPrimitive.cs @@ -0,0 +1,34 @@ +using StructureHelperLogics.NdmCalculations.Primitives; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StructureHelper.Infrastructure.UI.DataContexts +{ + public class ReinforcementViewPrimitive : PointViewPrimitive, IHasHostPrimitive + { + RebarPrimitive primitive; + + public INdmPrimitive HostPrimitive + { + get => primitive.HostPrimitive; + set + { + primitive.HostPrimitive = value; + OnPropertyChanged(nameof(HostPrimitive)); + } + } + + public ReinforcementViewPrimitive(RebarPrimitive _primitive) : base(_primitive) + { + primitive = _primitive; + } + public override void Refresh() + { + OnPropertyChanged(nameof(HostPrimitive)); + base.Refresh(); + } + } +} diff --git a/StructureHelper/Infrastructure/UI/DataTemplates/EllipseTemplate.xaml b/StructureHelper/Infrastructure/UI/DataTemplates/EllipseTemplate.xaml index d974201..c4de6d7 100644 --- a/StructureHelper/Infrastructure/UI/DataTemplates/EllipseTemplate.xaml +++ b/StructureHelper/Infrastructure/UI/DataTemplates/EllipseTemplate.xaml @@ -7,10 +7,9 @@ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:mouseEventTriggers="clr-namespace:StructureHelper.Infrastructure.UI.Triggers.MouseEventTriggers" xmlns:dataContexts="clr-namespace:StructureHelper.Infrastructure.UI.DataContexts" - xmlns:userControls="clr-namespace:StructureHelper.Infrastructure.UI.UserControls" mc:Ignorable="d"> - + @@ -43,6 +42,5 @@ - diff --git a/StructureHelper/Infrastructure/UI/DataTemplates/RectangleTemplate.xaml b/StructureHelper/Infrastructure/UI/DataTemplates/RectangleTemplate.xaml index dc410d2..0985cfe 100644 --- a/StructureHelper/Infrastructure/UI/DataTemplates/RectangleTemplate.xaml +++ b/StructureHelper/Infrastructure/UI/DataTemplates/RectangleTemplate.xaml @@ -7,7 +7,6 @@ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:infrastructure="clr-namespace:StructureHelper.Infrastructure" xmlns:mouseEventTriggers="clr-namespace:StructureHelper.Infrastructure.UI.Triggers.MouseEventTriggers" - xmlns:userControls="clr-namespace:StructureHelper.Infrastructure.UI.UserControls" xmlns:dataContexts="clr-namespace:StructureHelper.Infrastructure.UI.DataContexts" mc:Ignorable="d" d:DataContext="{d:DesignInstance dataContexts:RectangleViewPrimitive}"> @@ -52,6 +51,5 @@ - diff --git a/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_crack.png b/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_crack.png new file mode 100644 index 0000000..a2b453b Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_crack.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_fire.png b/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_fire.png new file mode 100644 index 0000000..fbfba9c Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_fire.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_graph_1.png b/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_graph_1.png new file mode 100644 index 0000000..568ed9e Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_graph_1.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_graph_2.png b/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_graph_2.png new file mode 100644 index 0000000..bd0a5bc Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_graph_2.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_interpolation_1_1.png b/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_interpolation_1_1.png new file mode 100644 index 0000000..0134af1 Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_interpolation_1_1.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_interpolation_2_1.png b/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_interpolation_2_1.png new file mode 100644 index 0000000..de1e60f Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_interpolation_2_1.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_interpolation_3_1.png b/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_interpolation_3_1.png new file mode 100644 index 0000000..e3426e2 Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/Graphs/32px_interpolation_3_1.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/Objects/Beam32.png b/StructureHelper/Infrastructure/UI/Icons/Objects/Beam32.png new file mode 100644 index 0000000..151fd5f Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/Objects/Beam32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/Objects/CircleColumn32.png b/StructureHelper/Infrastructure/UI/Icons/Objects/CircleColumn32.png new file mode 100644 index 0000000..aab72db Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/Objects/CircleColumn32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/Objects/RectangleColumn32.png b/StructureHelper/Infrastructure/UI/Icons/Objects/RectangleColumn32.png new file mode 100644 index 0000000..cdbd253 Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/Objects/RectangleColumn32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/Objects/Slab32.png b/StructureHelper/Infrastructure/UI/Icons/Objects/Slab32.png new file mode 100644 index 0000000..be1aa1e Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/Objects/Slab32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/actions/32px_delete.png b/StructureHelper/Infrastructure/UI/Icons/actions/32px_delete.png new file mode 100644 index 0000000..3f5bdd7 Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/actions/32px_delete.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/actions/32px_edit.png b/StructureHelper/Infrastructure/UI/Icons/actions/32px_edit.png new file mode 100644 index 0000000..2e582bb Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/actions/32px_edit.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/actions/32px_move to the center.png b/StructureHelper/Infrastructure/UI/Icons/actions/32px_move to the center.png new file mode 100644 index 0000000..9789578 Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/actions/32px_move to the center.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/analysis/Analysis32.png b/StructureHelper/Infrastructure/UI/Icons/analysis/Analysis32.png new file mode 100644 index 0000000..9d479ae Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/analysis/Analysis32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/analysis/Calculator32.png b/StructureHelper/Infrastructure/UI/Icons/analysis/Calculator32.png new file mode 100644 index 0000000..ffcb39a Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/analysis/Calculator32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/combination/32px_factored combination.png b/StructureHelper/Infrastructure/UI/Icons/combination/32px_factored combination.png new file mode 100644 index 0000000..123c4ee Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/combination/32px_factored combination.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/combination/32px_full combination.png b/StructureHelper/Infrastructure/UI/Icons/combination/32px_full combination.png new file mode 100644 index 0000000..28bcf81 Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/combination/32px_full combination.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/geometry/Circle32.png b/StructureHelper/Infrastructure/UI/Icons/geometry/Circle32.png new file mode 100644 index 0000000..0a5eb2e Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/geometry/Circle32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/geometry/Point32.png b/StructureHelper/Infrastructure/UI/Icons/geometry/Point32.png new file mode 100644 index 0000000..523a79a Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/geometry/Point32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/geometry/Rebar32.png b/StructureHelper/Infrastructure/UI/Icons/geometry/Rebar32.png new file mode 100644 index 0000000..fe44fad Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/geometry/Rebar32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/geometry/Rectangle32.png b/StructureHelper/Infrastructure/UI/Icons/geometry/Rectangle32.png new file mode 100644 index 0000000..f32c3ae Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/geometry/Rectangle32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/materials/ConMaterial32.png b/StructureHelper/Infrastructure/UI/Icons/materials/ConMaterial32.png new file mode 100644 index 0000000..d5fcce3 Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/materials/ConMaterial32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/materials/ElasticMaterial32.png b/StructureHelper/Infrastructure/UI/Icons/materials/ElasticMaterial32.png new file mode 100644 index 0000000..e32435d Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/materials/ElasticMaterial32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/materials/GlassMaterial32.png b/StructureHelper/Infrastructure/UI/Icons/materials/GlassMaterial32.png new file mode 100644 index 0000000..70e2773 Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/materials/GlassMaterial32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/materials/Materials32.png b/StructureHelper/Infrastructure/UI/Icons/materials/Materials32.png new file mode 100644 index 0000000..67b64bf Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/materials/Materials32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/materials/RFMaterial32.png b/StructureHelper/Infrastructure/UI/Icons/materials/RFMaterial32.png new file mode 100644 index 0000000..bd3b7c7 Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/materials/RFMaterial32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/materials/СarbonMaterial32.png b/StructureHelper/Infrastructure/UI/Icons/materials/СarbonMaterial32.png new file mode 100644 index 0000000..726db7c Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/materials/СarbonMaterial32.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/settings/32px_tools.png b/StructureHelper/Infrastructure/UI/Icons/settings/32px_tools.png new file mode 100644 index 0000000..e5dd0d7 Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/settings/32px_tools.png differ diff --git a/StructureHelper/Infrastructure/UI/Icons/settings/32px_visual settings.png b/StructureHelper/Infrastructure/UI/Icons/settings/32px_visual settings.png new file mode 100644 index 0000000..25a94c5 Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Icons/settings/32px_visual settings.png differ diff --git a/StructureHelper/Infrastructure/UI/Resources/32px_add beam.png b/StructureHelper/Infrastructure/UI/Resources/32px_add beam.png new file mode 100644 index 0000000..151fd5f Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Resources/32px_add beam.png differ diff --git a/StructureHelper/Infrastructure/UI/Resources/32px_add circle column.png b/StructureHelper/Infrastructure/UI/Resources/32px_add circle column.png new file mode 100644 index 0000000..aab72db Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Resources/32px_add circle column.png differ diff --git a/StructureHelper/Infrastructure/UI/Resources/32px_edit.png b/StructureHelper/Infrastructure/UI/Resources/32px_edit.png new file mode 100644 index 0000000..2e582bb Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Resources/32px_edit.png differ diff --git a/StructureHelper/Infrastructure/UI/Resources/Beam32.png b/StructureHelper/Infrastructure/UI/Resources/Beam32.png new file mode 100644 index 0000000..151fd5f Binary files /dev/null and b/StructureHelper/Infrastructure/UI/Resources/Beam32.png differ diff --git a/StructureHelper/Infrastructure/UI/Resources/ButtonStyles.xaml b/StructureHelper/Infrastructure/UI/Resources/ButtonStyles.xaml index c3744c2..7e48c6e 100644 --- a/StructureHelper/Infrastructure/UI/Resources/ButtonStyles.xaml +++ b/StructureHelper/Infrastructure/UI/Resources/ButtonStyles.xaml @@ -1,8 +1,8 @@  - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +