diff --git a/Pores/MainWindow.xaml b/Pores/MainWindow.xaml index 6c10687..a27ee6d 100644 --- a/Pores/MainWindow.xaml +++ b/Pores/MainWindow.xaml @@ -76,8 +76,8 @@ - - - + + + diff --git a/Pores/Models/Localizations/NormalLocalization.cs b/Pores/Models/Localizations/NormalLocalization.cs index 1e82d19..e4fda74 100644 --- a/Pores/Models/Localizations/NormalLocalization.cs +++ b/Pores/Models/Localizations/NormalLocalization.cs @@ -27,7 +27,7 @@ namespace Pores.Models.Localizations public override ObservableCollection GetLocalization() { var r = new Random(); - maxR = Math.Sqrt(Material.NumberOfPores / (Material.Height * Material.Width * Material.Depth) / 3.14); + GetMaxRadius(); var result = new ObservableCollection(); for (int i = 0; i <= Material.NumberOfPores; i++) for (int j = 0; j <= Material.NumberOfPores; j++) @@ -47,12 +47,18 @@ namespace Pores.Models.Localizations return result; } + private void GetMaxRadius() + { + var m = Material; + var volume = m.Height * m.Width * m.Depth; + maxR = Math.Round(Math.Pow((3.0 / 4.0) * volume / (3.14 * Math.Pow(m.NumberOfPores, 3)), 1.0 / 3.0), 3); + } + public NormalLocalization(Material material) { Material = material; sigma = 4; mu = Material.Height - Material.Height / 4; - } } } diff --git a/Pores/Models/Point.cs b/Pores/Models/Point.cs index 809572c..0c330dc 100644 --- a/Pores/Models/Point.cs +++ b/Pores/Models/Point.cs @@ -4,6 +4,6 @@ namespace Pores.Models { public class Point : PropertyChangedClass { - public double X { get; set; } + public virtual double X { get; set; } } } \ No newline at end of file diff --git a/Pores/Models/Point2D.cs b/Pores/Models/Point2D.cs index 161ac46..2115ea5 100644 --- a/Pores/Models/Point2D.cs +++ b/Pores/Models/Point2D.cs @@ -1,7 +1,10 @@ -namespace Pores.Models +using Pores.Helpers; + +namespace Pores.Models { public class Point2D : Point { - public double Y { get; set; } + public override double X { get; set; } + public virtual double Y { get; set; } } } diff --git a/Pores/Models/Point3D.cs b/Pores/Models/Point3D.cs index 557b6ed..46740b0 100644 --- a/Pores/Models/Point3D.cs +++ b/Pores/Models/Point3D.cs @@ -1,4 +1,5 @@ -using System; +using Pores.Helpers; +using System; using System.Collections.Generic; namespace Pores.Models @@ -6,7 +7,9 @@ namespace Pores.Models [Serializable] public class Point3D : Point2D { - public double Z { get; set; } + public override double X { get; set; } + public override double Y { get; set; } + public virtual double Z { get; set; } public List ToList() {