Z-Index was added
This commit is contained in:
@@ -2,15 +2,24 @@
|
|||||||
using StructureHelper.Infrastructure.Enums;
|
using StructureHelper.Infrastructure.Enums;
|
||||||
using StructureHelper.UnitSystem.Systems;
|
using StructureHelper.UnitSystem.Systems;
|
||||||
using StructureHelper.Windows.MainWindow;
|
using StructureHelper.Windows.MainWindow;
|
||||||
using StructureHelperCommon.Models.Entities;
|
using StructureHelperLogics.Models.Primitives;
|
||||||
using StructureHelperCommon.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
|
|
||||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||||
{
|
{
|
||||||
public class Point : PrimitiveBase
|
public class Point : PrimitiveBase
|
||||||
{
|
{
|
||||||
public double Area { get; set; }
|
private double area;
|
||||||
|
public double Area
|
||||||
|
{ get => area;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
area = value;
|
||||||
|
OnPropertyChanged(nameof(Area));
|
||||||
|
OnPropertyChanged(nameof(Diameter));
|
||||||
|
}
|
||||||
|
}
|
||||||
public Point(double area, double x, double y, MainViewModel ownerVm) : base(PrimitiveType.Point, x, y, ownerVm)
|
public Point(double area, double x, double y, MainViewModel ownerVm) : base(PrimitiveType.Point, x, y, ownerVm)
|
||||||
{
|
{
|
||||||
Name = "New point";
|
Name = "New point";
|
||||||
@@ -37,7 +46,7 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
|||||||
CenterY = y;
|
CenterY = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double Diameter { get => Math.Sqrt(Area / Math.PI) * 2; }
|
public double Diameter { get => Math.Sqrt(area / Math.PI) * 2; }
|
||||||
|
|
||||||
public override INdmPrimitive GetNdmPrimitive(IUnitSystem unitSystem)
|
public override INdmPrimitive GetNdmPrimitive(IUnitSystem unitSystem)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ using StructureHelper.Windows.MainWindow;
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
using StructureHelperCommon.Infrastructures.Strings;
|
||||||
using StructureHelperCommon.Models.Entities;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Materials;
|
|
||||||
using StructureHelperCommon.Services.ColorServices;
|
using StructureHelperCommon.Services.ColorServices;
|
||||||
|
using StructureHelperLogics.Models.Primitives;
|
||||||
|
|
||||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||||
{
|
{
|
||||||
@@ -37,6 +37,8 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
|||||||
private double prestrainKx, prestrainKy, prestrainEpsZ;
|
private double prestrainKx, prestrainKy, prestrainEpsZ;
|
||||||
private double opacity = 1, showedOpacity = 0, x, y, xY1, yX1, primitiveWidth, primitiveHeight, showedX, showedY;
|
private double opacity = 1, showedOpacity = 0, x, y, xY1, yX1, primitiveWidth, primitiveHeight, showedX, showedY;
|
||||||
protected double delta = 0.5;
|
protected double delta = 0.5;
|
||||||
|
private double stressValue;
|
||||||
|
private double strainValue;
|
||||||
private int showedZIndex = 1, zIndex;
|
private int showedZIndex = 1, zIndex;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -249,6 +251,22 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
|||||||
get => primitiveHeight;
|
get => primitiveHeight;
|
||||||
set => OnPropertyChanged(value, ref primitiveHeight);
|
set => OnPropertyChanged(value, ref primitiveHeight);
|
||||||
}
|
}
|
||||||
|
public double StressValue
|
||||||
|
{
|
||||||
|
get { return stressValue; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
OnPropertyChanged(value, ref stressValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public double StrainValue
|
||||||
|
{
|
||||||
|
get { return strainValue; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
OnPropertyChanged(value, ref strainValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
public double ShowedX
|
public double ShowedX
|
||||||
{
|
{
|
||||||
get => showedX;
|
get => showedX;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using StructureHelper.Infrastructure.Enums;
|
using StructureHelper.Infrastructure.Enums;
|
||||||
using StructureHelper.UnitSystem.Systems;
|
using StructureHelper.UnitSystem.Systems;
|
||||||
using StructureHelper.Windows.MainWindow;
|
using StructureHelper.Windows.MainWindow;
|
||||||
using StructureHelperCommon.Models.Entities;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Materials;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using System;
|
using System;
|
||||||
|
using StructureHelperLogics.Models.Primitives;
|
||||||
|
|
||||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||||
{
|
{
|
||||||
|
|||||||
Binary file not shown.
@@ -4,7 +4,6 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||||
using StructureHelperCommon.Models.NdmPrimitives;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using Point = StructureHelper.Infrastructure.UI.DataContexts.Point;
|
using Point = StructureHelper.Infrastructure.UI.DataContexts.Point;
|
||||||
using Rectangle = StructureHelper.Infrastructure.UI.DataContexts.Rectangle;
|
using Rectangle = StructureHelper.Infrastructure.UI.DataContexts.Rectangle;
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
using StructureHelperCommon.Models.Entities;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.NdmPrimitives
|
|
||||||
{
|
|
||||||
public interface IPrimitive : ICenterShape
|
|
||||||
{
|
|
||||||
INdmPrimitive GetNdmPrimitive();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
|
||||||
using StructureHelperCommon.Models.Entities;
|
|
||||||
using StructureHelperCommon.Models.Materials;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.NdmPrimitives
|
|
||||||
{
|
|
||||||
public class PointPrimitive : PrimitiveBase<IPoint>, IPoint
|
|
||||||
{
|
|
||||||
public double Area
|
|
||||||
{
|
|
||||||
get => _shape.Area;
|
|
||||||
set => _shape.Area = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PointPrimitive(ICenter center, IPoint shape) : base(center, shape) { }
|
|
||||||
public override INdmPrimitive GetNdmPrimitive()
|
|
||||||
{
|
|
||||||
double strength = 400e6d;
|
|
||||||
string materialName = "s400";
|
|
||||||
IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial { MaterialType = GetMaterialTypes(), ClassName = materialName, Strength = strength }; ;
|
|
||||||
INdmPrimitive ndmPrimitive = new NdmPrimitive { Center = _center, Shape = _shape, PrimitiveMaterial = primitiveMaterial };
|
|
||||||
return ndmPrimitive;
|
|
||||||
}
|
|
||||||
|
|
||||||
private MaterialTypes GetMaterialTypes()
|
|
||||||
{
|
|
||||||
return MaterialTypes.Reinforcement;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
using StructureHelperCommon.Models.Entities;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.NdmPrimitives
|
|
||||||
{
|
|
||||||
public abstract class PrimitiveBase<T> : IPrimitive where T : IShape
|
|
||||||
{
|
|
||||||
protected ICenter _center;
|
|
||||||
protected T _shape;
|
|
||||||
|
|
||||||
public ICenter Center => _center;
|
|
||||||
public IShape Shape => _shape;
|
|
||||||
|
|
||||||
protected PrimitiveBase(ICenter center, T shape)
|
|
||||||
{
|
|
||||||
_center = center;
|
|
||||||
_shape = shape;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract INdmPrimitive GetNdmPrimitive();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
|
||||||
using StructureHelperCommon.Models.Entities;
|
|
||||||
using StructureHelperCommon.Models.Materials;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.NdmPrimitives
|
|
||||||
{
|
|
||||||
public class RectanglePrimitive : PrimitiveBase<IRectangle>, IRectangle
|
|
||||||
{
|
|
||||||
public RectanglePrimitive(ICenter center, IRectangle shape) : base(center, shape) { }
|
|
||||||
|
|
||||||
public double Width => _shape.Width;
|
|
||||||
|
|
||||||
public double Height => _shape.Height;
|
|
||||||
|
|
||||||
public double Angle => _shape.Angle;
|
|
||||||
|
|
||||||
public override INdmPrimitive GetNdmPrimitive()
|
|
||||||
{
|
|
||||||
double strength = 40e6d;
|
|
||||||
string materialName = "C40/45";
|
|
||||||
IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial { MaterialType = GetMaterialTypes(), ClassName = materialName, Strength = strength }; ;
|
|
||||||
INdmPrimitive ndmPrimitive = new NdmPrimitive { Center = _center, Shape = _shape, PrimitiveMaterial = primitiveMaterial, NdmMaxSize = 1, NdmMinDivision = 20 };
|
|
||||||
return ndmPrimitive;
|
|
||||||
}
|
|
||||||
|
|
||||||
private MaterialTypes GetMaterialTypes()
|
|
||||||
{
|
|
||||||
return MaterialTypes.Concrete;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -50,15 +50,7 @@
|
|||||||
<Compile Include="Infrastructures\Exceptions\StructureHelperException.cs" />
|
<Compile Include="Infrastructures\Exceptions\StructureHelperException.cs" />
|
||||||
<Compile Include="Infrastructures\Interfaces\IHasParent.cs" />
|
<Compile Include="Infrastructures\Interfaces\IHasParent.cs" />
|
||||||
<Compile Include="Infrastructures\Strings\ErrorString.cs" />
|
<Compile Include="Infrastructures\Strings\ErrorString.cs" />
|
||||||
<Compile Include="Models\Entities\INdmPrimitive.cs" />
|
|
||||||
<Compile Include="Models\Entities\NdmPrimitive.cs" />
|
|
||||||
<Compile Include="Models\Materials\IPrimitiveMaterial.cs" />
|
|
||||||
<Compile Include="Infrastructures\Enums\MaterialTypes.cs" />
|
<Compile Include="Infrastructures\Enums\MaterialTypes.cs" />
|
||||||
<Compile Include="Models\Materials\PrimitiveMaterial.cs" />
|
|
||||||
<Compile Include="Models\NdmPrimitives\IPrimitive.cs" />
|
|
||||||
<Compile Include="Models\NdmPrimitives\PointPrimitive.cs" />
|
|
||||||
<Compile Include="Models\NdmPrimitives\PrimitiveBase.cs" />
|
|
||||||
<Compile Include="Models\NdmPrimitives\RectanglePrimitive.cs" />
|
|
||||||
<Compile Include="Models\Shapes\Center.cs" />
|
<Compile Include="Models\Shapes\Center.cs" />
|
||||||
<Compile Include="Models\Shapes\ICenter.cs" />
|
<Compile Include="Models\Shapes\ICenter.cs" />
|
||||||
<Compile Include="Models\Shapes\ICenterShape.cs" />
|
<Compile Include="Models\Shapes\ICenterShape.cs" />
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using StructureHelperCommon.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using LoaderCalculator.Data.Materials;
|
using LoaderCalculator.Data.Materials;
|
||||||
using StructureHelperCommon.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using StructureHelperLogics.Infrastructures.CommonEnums;
|
using StructureHelperLogics.Infrastructures.CommonEnums;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.Materials
|
namespace StructureHelperLogics.Models.Materials
|
||||||
{
|
{
|
||||||
public interface IPrimitiveMaterial
|
public interface IPrimitiveMaterial
|
||||||
{
|
{
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
using StructureHelperCommon.Infrastructures.Strings;
|
||||||
using StructureHelperCommon.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelper.Models.Materials;
|
||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.Materials
|
namespace StructureHelperLogics.Models.Materials
|
||||||
{
|
{
|
||||||
public class PrimitiveMaterial : IPrimitiveMaterial
|
public class PrimitiveMaterial : IPrimitiveMaterial
|
||||||
{
|
{
|
||||||
public string Id { get; }
|
public string Id { get; }
|
||||||
public MaterialTypes MaterialType { get; set; }
|
public MaterialTypes MaterialType { get; set; }
|
||||||
public CodeTypes CodeType { get; set; }
|
public CodeTypes CodeType { get; set; }
|
||||||
|
IHeadMaterial HeadMaterial { get; set; }
|
||||||
public string ClassName { get; set; }
|
public string ClassName { get; set; }
|
||||||
public double Strength { get; set; }
|
public double Strength { get; set; }
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using StructureHelperCommon.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.Entities
|
namespace StructureHelperLogics.Models.Primitives
|
||||||
{
|
{
|
||||||
public interface INdmPrimitive
|
public interface INdmPrimitive
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using StructureHelperCommon.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.Entities
|
namespace StructureHelperLogics.Models.Primitives
|
||||||
{
|
{
|
||||||
public class NdmPrimitive : INdmPrimitive
|
public class NdmPrimitive : INdmPrimitive
|
||||||
{
|
{
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
using StructureHelperCommon.Infrastructures.Strings;
|
||||||
using StructureHelperCommon.Models.Entities;
|
|
||||||
using StructureHelperCommon.Models.NdmPrimitives;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
|
using StructureHelperLogics.Models.Primitives;
|
||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
using StructureHelperCommon.Infrastructures.Strings;
|
||||||
using StructureHelperCommon.Models.Entities;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
|
using StructureHelperLogics.Models.Primitives;
|
||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ using LoaderCalculator.Data.Ndms;
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Strings;
|
using StructureHelperCommon.Infrastructures.Strings;
|
||||||
using StructureHelperCommon.Models.Entities;
|
using StructureHelperLogics.Models.Materials;
|
||||||
using StructureHelperCommon.Models.Materials;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
|
using StructureHelperLogics.Models.Primitives;
|
||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||||
{
|
{
|
||||||
@@ -29,7 +29,11 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
|||||||
}
|
}
|
||||||
return ndms;
|
return ndms;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Returns dictionary of unique materials by collection of primitives
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ndmPrimitives"></param>
|
||||||
|
/// <returns></returns>
|
||||||
private static Dictionary<string, IPrimitiveMaterial> GetPrimitiveMaterials(IEnumerable<INdmPrimitive> ndmPrimitives)
|
private static Dictionary<string, IPrimitiveMaterial> GetPrimitiveMaterials(IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||||
{
|
{
|
||||||
Dictionary<string, IPrimitiveMaterial> primitiveMaterials = new Dictionary<string, IPrimitiveMaterial>();
|
Dictionary<string, IPrimitiveMaterial> primitiveMaterials = new Dictionary<string, IPrimitiveMaterial>();
|
||||||
@@ -40,7 +44,13 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
|||||||
}
|
}
|
||||||
return primitiveMaterials;
|
return primitiveMaterials;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Return dictionary of ndm-materials by dictionary of primirive materials
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="PrimitiveMaterials"></param>
|
||||||
|
/// <param name="options"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="StructureHelperException"></exception>
|
||||||
private static Dictionary<string, IMaterial> GetMaterials(Dictionary<string, IPrimitiveMaterial> PrimitiveMaterials, ITriangulationOptions options)
|
private static Dictionary<string, IMaterial> GetMaterials(Dictionary<string, IPrimitiveMaterial> PrimitiveMaterials, ITriangulationOptions options)
|
||||||
{
|
{
|
||||||
Dictionary<string, IMaterial> materials = new Dictionary<string, IMaterial>();
|
Dictionary<string, IMaterial> materials = new Dictionary<string, IMaterial>();
|
||||||
@@ -49,7 +59,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
|||||||
foreach (string id in keyCollection)
|
foreach (string id in keyCollection)
|
||||||
{
|
{
|
||||||
IPrimitiveMaterial primitiveMaterial;
|
IPrimitiveMaterial primitiveMaterial;
|
||||||
if (PrimitiveMaterials.TryGetValue(id, out primitiveMaterial) == false) { throw new Exception("Material dictionary is not valid"); }
|
if (PrimitiveMaterials.TryGetValue(id, out primitiveMaterial) == false) { throw new StructureHelperException("Material dictionary is not valid"); }
|
||||||
material = GetMaterial(primitiveMaterial, options);
|
material = GetMaterial(primitiveMaterial, options);
|
||||||
materials.Add(id, material);
|
materials.Add(id, material);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ using LoaderCalculator;
|
|||||||
using LoaderCalculator.Data.Matrix;
|
using LoaderCalculator.Data.Matrix;
|
||||||
using LoaderCalculator.Data.Ndms;
|
using LoaderCalculator.Data.Ndms;
|
||||||
using LoaderCalculator.Data.SourceData;
|
using LoaderCalculator.Data.SourceData;
|
||||||
using StructureHelperCommon.Models.Entities;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||||
using StructureHelperLogics.Infrastructures.CommonEnums;
|
using StructureHelperLogics.Infrastructures.CommonEnums;
|
||||||
using StructureHelperLogics.Models.Calculations.CalculationsResults;
|
using StructureHelperLogics.Models.Calculations.CalculationsResults;
|
||||||
using StructureHelperLogics.Models.Calculations.CalculationProperties;
|
using StructureHelperLogics.Models.Calculations.CalculationProperties;
|
||||||
using System;
|
using System;
|
||||||
|
using StructureHelperLogics.Models.Primitives;
|
||||||
|
|
||||||
namespace StructureHelperLogics.Services
|
namespace StructureHelperLogics.Services
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,9 +7,10 @@ using NUnit.Framework;
|
|||||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using StructureHelperCommon.Models.Entities;
|
|
||||||
using StructureHelperCommon.Models.NdmPrimitives;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
|
using StructureHelperLogics.Models.Primitives;
|
||||||
|
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||||
|
using dContext = StructureHelper.Infrastructure.UI.DataContexts;
|
||||||
|
|
||||||
namespace StructureHelperTests.FunctionalTests.Ndms.RCSections
|
namespace StructureHelperTests.FunctionalTests.Ndms.RCSections
|
||||||
{
|
{
|
||||||
@@ -40,19 +41,19 @@ namespace StructureHelperTests.FunctionalTests.Ndms.RCSections
|
|||||||
ITriangulationOptions options = new TriangulationOptions { LimiteState = StructureHelperLogics.Infrastructures.CommonEnums.LimitStates.Collapse, CalcTerm = StructureHelperLogics.Infrastructures.CommonEnums.CalcTerms.ShortTerm };
|
ITriangulationOptions options = new TriangulationOptions { LimiteState = StructureHelperLogics.Infrastructures.CommonEnums.LimitStates.Collapse, CalcTerm = StructureHelperLogics.Infrastructures.CommonEnums.CalcTerms.ShortTerm };
|
||||||
var ndmPrimitives = new List<INdmPrimitive>();
|
var ndmPrimitives = new List<INdmPrimitive>();
|
||||||
//Добавляем прямоугольник бетонного сечения
|
//Добавляем прямоугольник бетонного сечения
|
||||||
var concreteRectangle = new RectanglePrimitive(new Center { X = 0, Y = 0 }, new Rectangle { Width = width, Height = height, Angle = 0 });
|
var concreteRectangle = new dContext.Rectangle(new Center { X = 0, Y = 0 }, new Rectangle { Width = width, Height = height, Angle = 0 });
|
||||||
ndmPrimitives.Add(concreteRectangle.GetNdmPrimitive());
|
ndmPrimitives.Add(concreteRectangle.GetNdmPrimitive());
|
||||||
//Добавляем 4 точки для арматуры
|
//Добавляем 4 точки для арматуры
|
||||||
// 0.05 - величина защитного слоя (расстояние от грани прямоугольника до центра арматуры
|
// 0.05 - величина защитного слоя (расстояние от грани прямоугольника до центра арматуры
|
||||||
//С площадью нижней арматуры
|
//С площадью нижней арматуры
|
||||||
var leftBottomReinforcementPoint = new PointPrimitive(new Center { X = -width / 2 + 0.05d, Y = -height / 2 + 0.05 }, new Point { Area = bottomArea });
|
var leftBottomReinforcementPoint = new dContext.Point(new Center { X = -width / 2 + 0.05d, Y = -height / 2 + 0.05 }, new Point { Area = bottomArea });
|
||||||
ndmPrimitives.Add(leftBottomReinforcementPoint.GetNdmPrimitive());
|
ndmPrimitives.Add(leftBottomReinforcementPoint.GetNdmPrimitive());
|
||||||
var rightBottomReinforcementPoint = new PointPrimitive(new Center { X = width / 2 - 0.05d, Y = -height / 2 + 0.05 }, new Point { Area = bottomArea });
|
var rightBottomReinforcementPoint = new Point(new Center { X = width / 2 - 0.05d, Y = -height / 2 + 0.05 }, new Point { Area = bottomArea });
|
||||||
ndmPrimitives.Add(rightBottomReinforcementPoint.GetNdmPrimitive());
|
ndmPrimitives.Add(rightBottomReinforcementPoint.GetNdmPrimitive());
|
||||||
//С площадью верхней арматуры
|
//С площадью верхней арматуры
|
||||||
var leftTopReinforcementPoint = new PointPrimitive(new Center { X = -width / 2 + 0.05d, Y = height / 2 - 0.05 }, new Point { Area = topArea });
|
var leftTopReinforcementPoint = new dContext.Point(new Center { X = -width / 2 + 0.05d, Y = height / 2 - 0.05 }, new Point { Area = topArea });
|
||||||
ndmPrimitives.Add(leftTopReinforcementPoint.GetNdmPrimitive());
|
ndmPrimitives.Add(leftTopReinforcementPoint.GetNdmPrimitive());
|
||||||
var rightTopReinforcementPoint = new PointPrimitive(new Center { X = width / 2 - 0.05d, Y = height / 2 - 0.05 }, new Point { Area = topArea });
|
var rightTopReinforcementPoint = new dContext.Point(new Center { X = width / 2 - 0.05d, Y = height / 2 - 0.05 }, new Point { Area = topArea });
|
||||||
ndmPrimitives.Add(rightTopReinforcementPoint.GetNdmPrimitive());
|
ndmPrimitives.Add(rightTopReinforcementPoint.GetNdmPrimitive());
|
||||||
//Формируем коллекцию элементарных участков для расчета в библитеке (т.е. выполняем триангуляцию)
|
//Формируем коллекцию элементарных участков для расчета в библитеке (т.е. выполняем триангуляцию)
|
||||||
ndmCollection.AddRange(Triangulation.GetNdms(ndmPrimitives, options));
|
ndmCollection.AddRange(Triangulation.GetNdms(ndmPrimitives, options));
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ using NUnit.Framework;
|
|||||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using StructureHelperCommon.Models.Entities;
|
|
||||||
using StructureHelperCommon.Models.Materials;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperLogics.Models.Calculations;
|
||||||
|
using StructureHelperLogics.Models.Primitives;
|
||||||
|
|
||||||
namespace StructureHelperTests.FunctionalTests.Ndms.RCSections
|
namespace StructureHelperTests.FunctionalTests.Ndms.RCSections
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,10 +6,9 @@ using NUnit.Framework;
|
|||||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using StructureHelperCommon.Models.Entities;
|
|
||||||
using StructureHelperCommon.Models.Materials;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperLogics.Models.Materials;
|
||||||
|
|
||||||
namespace StructureHelperTests.FunctionalTests.Ndms.SteelSections
|
namespace StructureHelperTests.FunctionalTests.Ndms.SteelSections
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
}
|
}
|
||||||
else if (primitiveType == PrimitiveType.Point)
|
else if (primitiveType == PrimitiveType.Point)
|
||||||
{
|
{
|
||||||
primitive = new Point(0.50, 0, 0, this);
|
primitive = new Point(0.0005d, 0d, 0d, this);
|
||||||
}
|
}
|
||||||
else { throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + nameof(primitiveType)); }
|
else { throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + nameof(primitiveType)); }
|
||||||
Primitives.Add(primitive);
|
Primitives.Add(primitive);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
</Expander>
|
</Expander>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate x:Key="TriangulationProperties">
|
<DataTemplate x:Key="TriangulationProperties">
|
||||||
<Expander Header="Triangulation" IsExpanded="True">
|
<Expander Header="Triangulation" IsExpanded="False">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="22"/>
|
<RowDefinition Height="22"/>
|
||||||
@@ -76,6 +76,7 @@
|
|||||||
<RowDefinition Height="22"/>
|
<RowDefinition Height="22"/>
|
||||||
<RowDefinition Height="22"/>
|
<RowDefinition Height="22"/>
|
||||||
<RowDefinition Height="22"/>
|
<RowDefinition Height="22"/>
|
||||||
|
<RowDefinition Height="22"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="100"/>
|
<ColumnDefinition Width="100"/>
|
||||||
@@ -86,6 +87,7 @@
|
|||||||
<TextBlock Grid.Row="2" Text="Center X"/>
|
<TextBlock Grid.Row="2" Text="Center X"/>
|
||||||
<TextBlock Grid.Row="3" Text="Center Y"/>
|
<TextBlock Grid.Row="3" Text="Center Y"/>
|
||||||
<TextBlock Grid.Row="4" Text="Material color"/>
|
<TextBlock Grid.Row="4" Text="Material color"/>
|
||||||
|
<TextBlock Grid.Row="5" Text="Z-index (integer)"/>
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Margin="1" Text="{Binding Name}"/>
|
<TextBox Grid.Row="0" Grid.Column="1" Margin="1" Text="{Binding Name}"/>
|
||||||
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left">
|
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left">
|
||||||
<ComboBox Width="120" ItemsSource="{Binding HeadMaterials}" SelectedItem="{Binding PrimitiveMaterial}">
|
<ComboBox Width="120" ItemsSource="{Binding HeadMaterials}" SelectedItem="{Binding PrimitiveMaterial}">
|
||||||
@@ -111,6 +113,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
<TextBox Grid.Row="2" Grid.Column="1" Margin="1" Text="{Binding CenterX, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
<TextBox Grid.Row="2" Grid.Column="1" Margin="1" Text="{Binding CenterX, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
||||||
<TextBox Grid.Row="3" Grid.Column="1" Margin="1" Text="{Binding CenterY, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
<TextBox Grid.Row="3" Grid.Column="1" Margin="1" Text="{Binding CenterY, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
||||||
|
<TextBox Grid.Row="5" Grid.Column="1" Margin="1" Text="{Binding ZIndex}"/>
|
||||||
<StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
<CheckBox IsChecked="{Binding SetMaterialColor}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,20,0"/>
|
<CheckBox IsChecked="{Binding SetMaterialColor}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,20,0"/>
|
||||||
<Rectangle Width="50" Margin="5,0,10,0">
|
<Rectangle Width="50" Margin="5,0,10,0">
|
||||||
@@ -122,7 +125,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Expander>
|
</Expander>
|
||||||
<Expander Header="Prestrain" IsExpanded="True">
|
<Expander Header="Prestrain" IsExpanded="False">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="22"/>
|
<RowDefinition Height="22"/>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using StructureHelper.Infrastructure.UI.DataContexts;
|
|||||||
using StructureHelper.Models.Materials;
|
using StructureHelper.Models.Materials;
|
||||||
using StructureHelper.Windows.ColorPickerWindow;
|
using StructureHelper.Windows.ColorPickerWindow;
|
||||||
using StructureHelper.Windows.MainWindow.Materials;
|
using StructureHelper.Windows.MainWindow.Materials;
|
||||||
using StructureHelperCommon.Models.NdmPrimitives;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using StructureHelperCommon.Services.ColorServices;
|
using StructureHelperCommon.Services.ColorServices;
|
||||||
using StructureHelperLogics.Models.Materials;
|
using StructureHelperLogics.Models.Materials;
|
||||||
@@ -181,6 +180,8 @@ namespace StructureHelper.Windows.ViewModels.PrimitiveProperties
|
|||||||
{
|
{
|
||||||
var shape = primitive as Point;
|
var shape = primitive as Point;
|
||||||
shape.Area = value;
|
shape.Area = value;
|
||||||
|
OnPropertyChanged(nameof(Area));
|
||||||
|
OnPropertyChanged(nameof(shape.Diameter));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -206,6 +207,14 @@ namespace StructureHelper.Windows.ViewModels.PrimitiveProperties
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int ZIndex
|
||||||
|
{ get => primitive.ZIndex;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
primitive.ZIndex = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string this[string columnName]
|
public string this[string columnName]
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
Reference in New Issue
Block a user