diff --git a/StructureHelperLogics/Data/Shapes/IPoint.cs b/StructureHelperLogics/Data/Shapes/IPoint.cs index 998be59..fe39f04 100644 --- a/StructureHelperLogics/Data/Shapes/IPoint.cs +++ b/StructureHelperLogics/Data/Shapes/IPoint.cs @@ -6,6 +6,6 @@ namespace StructureHelperLogics.Data.Shapes { public interface IPoint : IShape { - double Area { get; } + double Area { get; set; } } } diff --git a/StructureHelperLogics/Models/NdmPrimitives/IPrimitive.cs b/StructureHelperLogics/Models/NdmPrimitives/IPrimitive.cs new file mode 100644 index 0000000..0ed9ac9 --- /dev/null +++ b/StructureHelperLogics/Models/NdmPrimitives/IPrimitive.cs @@ -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(); + } +} diff --git a/StructureHelperLogics/Models/NdmPrimitives/PointPrimitive.cs b/StructureHelperLogics/Models/NdmPrimitives/PointPrimitive.cs new file mode 100644 index 0000000..e824ed9 --- /dev/null +++ b/StructureHelperLogics/Models/NdmPrimitives/PointPrimitive.cs @@ -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; + } + } +}