Add polygon to DTO convert strategy

This commit is contained in:
Evgeny Redikultsev
2025-10-19 17:37:17 +05:00
parent 5bf01bcb09
commit ed66da123c
64 changed files with 759 additions and 266 deletions

View File

@@ -11,6 +11,11 @@ namespace DataAccess.DTOs
{
private IRectangleShape shape = new RectangleShapeDTO(Guid.Empty);
public EllipseNdmPrimitiveDTO(Guid id)
{
Id = id;
}
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("Name")]
@@ -42,7 +47,7 @@ namespace DataAccess.DTOs
public object Clone()
{
throw new NotImplementedException();
return this;
}
public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)

View File

@@ -0,0 +1,67 @@
using LoaderCalculator.Data.Ndms;
using Newtonsoft.Json;
using StructureHelperCommon.Models.Shapes;
using StructureHelperLogics.Models.CrossSections;
using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{
public class ShapeNdmPrimitiveDTO : IShapeNdmPrimitive
{
private IShape shape;
[JsonProperty("Id")]
public Guid Id { get; }
[JsonProperty("Name")]
public string? Name { get; set; }
[JsonProperty("Shape")]
public IShape Shape => shape;
[JsonProperty("NdmElement")]
public INdmElement NdmElement { get; set; }
[JsonProperty("Center")]
public IPoint2D Center { get; set; }
[JsonProperty("VisualProperty")]
public IVisualProperty VisualProperty { get; set; }
[JsonProperty("RotationAngle")]
public double RotationAngle { get; set; }
[JsonProperty("DivisionSize")]
public IDivisionSize DivisionSize { get; set; }
[JsonIgnore]
public ICrossSection? CrossSection { get; set; }
public ShapeNdmPrimitiveDTO(Guid id)
{
Id = id;
}
public object Clone()
{
return this;
}
public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)
{
throw new NotImplementedException();
}
public List<INamedAreaPoint> GetValuePoints()
{
throw new NotImplementedException();
}
public bool IsPointInside(IPoint2D point)
{
throw new NotImplementedException();
}
public void SetShape(IShape shape)
{
this.shape = shape;
}
}
}