Добавил примитив для точки
This commit is contained in:
15
StructureHelperLogics/Models/NdmPrimitives/IPrimitive.cs
Normal file
15
StructureHelperLogics/Models/NdmPrimitives/IPrimitive.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using StructureHelperLogics.Data.Shapes;
|
||||
using StructureHelperLogics.NdmCalculations.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StructureHelperLogics.Models.NdmPrimitives
|
||||
{
|
||||
public interface IPrimitive
|
||||
{
|
||||
ICenter Center { get;}
|
||||
IShape Shape { get;}
|
||||
INdmPrimitive GetNdmPrimitive();
|
||||
}
|
||||
}
|
||||
50
StructureHelperLogics/Models/NdmPrimitives/PointPrimitive.cs
Normal file
50
StructureHelperLogics/Models/NdmPrimitives/PointPrimitive.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using StructureHelperLogics.Data.Shapes;
|
||||
using StructureHelperLogics.NdmCalculations.Entities;
|
||||
using StructureHelperLogics.NdmCalculations.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StructureHelperLogics.Models.NdmPrimitives
|
||||
{
|
||||
public class PointPrimitive : IPrimitive
|
||||
{
|
||||
ICenter _center;
|
||||
IShape _shape;
|
||||
|
||||
public ICenter Center => _center;
|
||||
public IShape Shape => _shape;
|
||||
public double Area
|
||||
{
|
||||
get
|
||||
{
|
||||
IPoint point = _shape as IPoint;
|
||||
return point.Area;
|
||||
}
|
||||
set
|
||||
{
|
||||
IPoint point = _shape as IPoint;
|
||||
point.Area = value;
|
||||
}
|
||||
}
|
||||
|
||||
public PointPrimitive(ICenter center, IShape shape)
|
||||
{
|
||||
_center = center;
|
||||
_shape = shape;
|
||||
}
|
||||
public INdmPrimitive GetNdmPrimitive()
|
||||
{
|
||||
double strength = 400;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user