LinePrimitive and RectanglePrimitive was added
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
internal interface IHasDivisionSize
|
||||
{
|
||||
double NdmMaxSize { get; set; }
|
||||
int NdmMinDivision { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,23 @@
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelper.Models.Materials;
|
||||
using System.Collections;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StructureHelperLogics.Models.Primitives
|
||||
{
|
||||
public interface INdmPrimitive
|
||||
{
|
||||
string Name { get; set; }
|
||||
ICenter Center { get; set; }
|
||||
IShape Shape { get; set; }
|
||||
IHeadMaterial HeadMaterial { get; }
|
||||
double NdmMaxSize { get; set; }
|
||||
int NdmMinDivision { get; set; }
|
||||
IHeadMaterial HeadMaterial { get; set; }
|
||||
double PrestrainKx { get; set; }
|
||||
double PrestrainKy { get; set; }
|
||||
double PrestrainEpsZ { get; set; }
|
||||
|
||||
IEnumerable<INdm> GetNdms(IMaterial material);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.ShapeServices;
|
||||
using StructureHelperLogics.Models.Primitives;
|
||||
using StructureHelperLogics.Services.NdmPrimitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
public class LinePrimitive : INdmPrimitive, ILineShape, IHasDivisionSize, ISaveable, ICloneable
|
||||
{
|
||||
public ICenter Center { get; set; }
|
||||
public IShape Shape { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public double NdmMaxSize { get; set; }
|
||||
public int NdmMinDivision { get; set; }
|
||||
public IHeadMaterial HeadMaterial { get; set; }
|
||||
public double PrestrainKx { get; set; }
|
||||
public double PrestrainKy { get; set; }
|
||||
public double PrestrainEpsZ { get; set; }
|
||||
|
||||
public ICenter StartPoint { get; set; }
|
||||
public ICenter EndPoint { get; set; }
|
||||
public double Thickness { get; set; }
|
||||
|
||||
public LinePrimitive()
|
||||
{
|
||||
StartPoint = new Center();
|
||||
EndPoint = new Center();
|
||||
|
||||
Name = "New Line";
|
||||
NdmMaxSize = 0.01d;
|
||||
NdmMinDivision = 10;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
LinePrimitive primitive = new LinePrimitive();
|
||||
NdmPrimitivesService.CopyNdmProperties(this, primitive);
|
||||
NdmPrimitivesService.CopyDivisionProperties(this, primitive);
|
||||
ShapeService.CopyLineProperties(this, primitive);
|
||||
return primitive;
|
||||
}
|
||||
|
||||
public IEnumerable<INdm> GetNdms(IMaterial material)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,47 @@
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelper.Models.Materials;
|
||||
using System.Collections.Generic;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
|
||||
namespace StructureHelperLogics.Models.Primitives
|
||||
{
|
||||
public class NdmPrimitive : INdmPrimitive
|
||||
public class NdmPrimitive : INdmPrimitive, ISaveable, ICloneable
|
||||
{
|
||||
private IHeadMaterial headMaterial;
|
||||
|
||||
public ICenter Center { get; set; }
|
||||
public IShape Shape { get; set; }
|
||||
public IHeadMaterial HeadMaterial { get => headMaterial; }
|
||||
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public IHeadMaterial HeadMaterial { get; private set; }
|
||||
public double NdmMaxSize { get; set; }
|
||||
public int NdmMinDivision { get; set; }
|
||||
public double PrestrainKx { get; set; }
|
||||
public double PrestrainKy { get; set; }
|
||||
public double PrestrainEpsZ { get; set; }
|
||||
|
||||
|
||||
public NdmPrimitive(IHeadMaterial material)
|
||||
{
|
||||
headMaterial = material;
|
||||
HeadMaterial = material;
|
||||
}
|
||||
|
||||
public IEnumerable<INdm> GetNdms(IMaterial material)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.ShapeServices;
|
||||
using StructureHelperLogics.Models.Primitives;
|
||||
using StructureHelperLogics.Services.NdmPrimitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
public class RectanglePrimitive : INdmPrimitive, IRectangleShape, IHasDivisionSize, ISaveable, ICloneable
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public ICenter Center { get; set; }
|
||||
public IShape Shape { get; set; }
|
||||
public IHeadMaterial HeadMaterial { get; set; }
|
||||
public double PrestrainKx { get; set; }
|
||||
public double PrestrainKy { get; set; }
|
||||
public double PrestrainEpsZ { get; set; }
|
||||
public double NdmMaxSize { get; set; }
|
||||
public int NdmMinDivision { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
public double Width { get; set; }
|
||||
public double Height { get; set; }
|
||||
public double Angle { get; set; }
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
RectanglePrimitive primitive = new RectanglePrimitive();
|
||||
NdmPrimitivesService.CopyNdmProperties(this, primitive);
|
||||
NdmPrimitivesService.CopyDivisionProperties(this, primitive);
|
||||
ShapeService.CopyRectangleProperties(this, primitive);
|
||||
return primitive;
|
||||
}
|
||||
|
||||
public IEnumerable<INdm> GetNdms(IMaterial material)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user