Files
StructureHelper/StructureHelperLogics/NdmCalculations/Triangulations/RectangleTriangulationOptions.cs
2022-06-21 22:07:42 +05:00

39 lines
1.3 KiB
C#

using StructureHelperLogics.Data.Shapes;
using StructureHelperLogics.NdmCalculations.Entities;
using System;
using System.Collections.Generic;
using System.Text;
namespace StructureHelperLogics.NdmCalculations.Triangulations
{
/// <inheritdoc />
public class RectangleTriangulationOptions : IRectangleTriangulationOptions
{
/// <inheritdoc />
public ICenter Center { get; }
/// <inheritdoc />
public IRectangle Rectangle { get; }
/// <inheritdoc />
public double NdmMaxSize { get; }
/// <inheritdoc />
public int NdmMinDivision { get; }
public RectangleTriangulationOptions(ICenter center, IRectangle rectangle, double ndmMaxSize, int ndmMinDivision)
{
Center = center;
Rectangle = rectangle;
NdmMaxSize = ndmMaxSize;
NdmMinDivision = ndmMinDivision;
}
public RectangleTriangulationOptions(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;
}
}
}