using StructureHelperLogics.Data.Shapes; using StructureHelperLogics.NdmCalculations.Entities; using System; using System.Collections.Generic; using System.Text; namespace StructureHelperLogics.NdmCalculations.Triangulations { /// public class RectangleTriangulationOptions : IRectangleTriangulationOptions { /// public ICenter Center { get; } /// public IRectangle Rectangle { get; } /// public double NdmMaxSize { get; } /// 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; } } }