Добавил методы для формирования исходных примитивов для триангуляции
This commit is contained in:
@@ -1,7 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using StructureHelper.Infrastructure.Enums;
|
using StructureHelper.Infrastructure.Enums;
|
||||||
|
using StructureHelper.Models.Materials;
|
||||||
using StructureHelper.Windows.MainWindow;
|
using StructureHelper.Windows.MainWindow;
|
||||||
|
using StructureHelperLogics.Data.Shapes;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Entities;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Materials;
|
||||||
|
|
||||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||||
{
|
{
|
||||||
@@ -26,5 +30,19 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
|||||||
ShowedX = 0;
|
ShowedX = 0;
|
||||||
ShowedY = 0;
|
ShowedY = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override INdmPrimitive GetNdmPrimitive()
|
||||||
|
{
|
||||||
|
double strength = 0;
|
||||||
|
double centerX = 0;
|
||||||
|
double centerY = 0;
|
||||||
|
double area = 0;
|
||||||
|
string materialName = "s400";
|
||||||
|
ICenter center = new Center() { X = centerX, Y = centerY };
|
||||||
|
IShape shape = new Point() { Area = area };
|
||||||
|
IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial() { MaterialType = GetMaterialTypes(), ClassName = materialName, Strength = strength }; ;
|
||||||
|
INdmPrimitive ndmPrimitive = new NdmPrimitive() { Center = center, Shape = shape, PrimitiveMaterial = primitiveMaterial };
|
||||||
|
return ndmPrimitive;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ using System.Windows.Media;
|
|||||||
using StructureHelper.Infrastructure.Enums;
|
using StructureHelper.Infrastructure.Enums;
|
||||||
using StructureHelper.Models.Materials;
|
using StructureHelper.Models.Materials;
|
||||||
using StructureHelper.Windows.MainWindow;
|
using StructureHelper.Windows.MainWindow;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Entities;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Materials;
|
||||||
|
|
||||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||||
{
|
{
|
||||||
@@ -254,5 +256,15 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
|||||||
if (Type == PrimitiveType.Rectangle) Y = -showedY + Xy1 - PrimitiveHeight;
|
if (Type == PrimitiveType.Rectangle) Y = -showedY + Xy1 - PrimitiveHeight;
|
||||||
if (Type == PrimitiveType.Ellipse) Y = -showedY + Xy1 - PrimitiveWidth / 2;
|
if (Type == PrimitiveType.Ellipse) Y = -showedY + Xy1 - PrimitiveWidth / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract INdmPrimitive GetNdmPrimitive();
|
||||||
|
public MaterialTypes GetMaterialTypes()
|
||||||
|
{
|
||||||
|
MaterialTypes materialTypes;
|
||||||
|
if (Material is ConcreteDefinition) { materialTypes = MaterialTypes.Concrete; }
|
||||||
|
else if (Material is RebarDefinition) { materialTypes = MaterialTypes.Reinforcement; }
|
||||||
|
else { throw new Exception("MaterialType is unknown"); }
|
||||||
|
return materialTypes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ using System.Windows.Input;
|
|||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using StructureHelper.Infrastructure.Enums;
|
using StructureHelper.Infrastructure.Enums;
|
||||||
using StructureHelper.Windows.MainWindow;
|
using StructureHelper.Windows.MainWindow;
|
||||||
|
using StructureHelperLogics.Data.Shapes;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Entities;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Materials;
|
||||||
|
|
||||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||||
{
|
{
|
||||||
@@ -15,5 +18,20 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
|||||||
ShowedX = 0;
|
ShowedX = 0;
|
||||||
ShowedY = 0;
|
ShowedY = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override INdmPrimitive GetNdmPrimitive()
|
||||||
|
{
|
||||||
|
double strength = 0;
|
||||||
|
double centerX = 0;
|
||||||
|
double centerY = 0;
|
||||||
|
string materialName = "C20";
|
||||||
|
ICenter center = new Center() { X = centerX, Y = centerY };
|
||||||
|
double height = 0;
|
||||||
|
double width = 0;
|
||||||
|
IShape shape = new StructureHelperLogics.Data.Shapes.Rectangle() { Height = height, Width = width, Angle = 0 };
|
||||||
|
IPrimitiveMaterial primitiveMaterial = new PrimitiveMaterial() { MaterialType = GetMaterialTypes(), ClassName = materialName, Strength = strength }; ;
|
||||||
|
INdmPrimitive ndmPrimitive = new NdmPrimitive() { Center = center, Shape = shape, PrimitiveMaterial = primitiveMaterial };
|
||||||
|
return ndmPrimitive;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,5 +157,11 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Logics\" />
|
<Folder Include="Logics\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="StructureHelperLogics\StructureHelperLogics.csproj">
|
||||||
|
<Project>{330BEF5B-15BE-4D2C-A750-B1AE50FB2BE3}</Project>
|
||||||
|
<Name>StructureHelperLogics</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
Reference in New Issue
Block a user