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

@@ -4,7 +4,7 @@ namespace StructureHelperCommon.Models.Shapes
{
public class PolygonCalculator : IPolygonCalculator
{
public double GetPerimeter(IPolygonShape polygon)
public double GetPerimeter(ILinePolygonShape polygon)
{
if (polygon.Vertices.Count < 2)
return 0;
@@ -24,7 +24,7 @@ namespace StructureHelperCommon.Models.Shapes
return perimeter;
}
public double GetArea(IPolygonShape polygon)
public double GetArea(ILinePolygonShape polygon)
{
if (!polygon.IsClosed || polygon.Vertices.Count < 3)
return 0;
@@ -41,7 +41,7 @@ namespace StructureHelperCommon.Models.Shapes
return Math.Abs(sum) / 2.0;
}
public bool ContainsPoint(IPolygonShape polygon, IPoint2D point)
public bool ContainsPoint(ILinePolygonShape polygon, IPoint2D point)
{
if (!polygon.IsClosed || polygon.Vertices.Count < 3)
return false;