Files
StructureHelper/StructureHelperLogics/NdmCalculations/Triangulations/RectangleTriangulationLogicOptions.cs
NickAppLab d9cb4fe3b8 Добавлены сервисы CalculationService, PrimitiveService, Common-сборка с типами
Необходимо реализовать в дальнейшем GetInnerPoints в PrimitiveService
2022-07-26 03:53:57 +05:00

37 lines
1.2 KiB
C#

using System;
using StructureHelperCommon.Models.Entities;
using StructureHelperCommon.Models.Shapes;
namespace StructureHelperLogics.NdmCalculations.Triangulations
{
/// <inheritdoc />
public class RectangleTriangulationLogicOptions : IRectangleTriangulationLogicOptions
{
/// <inheritdoc />
public ICenter Center { get; }
/// <inheritdoc />
public IRectangle Rectangle { get; }
/// <inheritdoc />
public double NdmMaxSize { get; }
/// <inheritdoc />
public int NdmMinDivision { get; }
public RectangleTriangulationLogicOptions(ICenter center, IRectangle rectangle, double ndmMaxSize, int ndmMinDivision)
{
Center = center;
Rectangle = rectangle;
NdmMaxSize = ndmMaxSize;
NdmMinDivision = ndmMinDivision;
}
public RectangleTriangulationLogicOptions(INdmPrimitive primitive)
{
if (! (primitive.Shape is IRectangle)) { throw new Exception("Shape type is not valid"); }
Center = primitive.Center;
Rectangle = primitive.Shape as IRectangle;
NdmMaxSize = primitive.NdmMaxSize;
NdmMinDivision = primitive.NdmMinDivision;
}
}
}