Add series to graph
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -12,13 +13,20 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
private List<IPoint2D> surroundList;
|
||||
|
||||
public SurroundData SurroundData { get; set; }
|
||||
public int PointCount { get; set; }
|
||||
|
||||
public RectSurroundProc()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public List<IPoint2D> GetPoints()
|
||||
{
|
||||
CheckParameters();
|
||||
var xRadius = (SurroundData.XMax - SurroundData.XMin) / 2;
|
||||
var yRadius = (SurroundData.YMax - SurroundData.YMin) / 2;
|
||||
surroundList = new();
|
||||
var pointCount = Convert.ToInt32(Math.Ceiling(SurroundData.PointCount / 8d));
|
||||
var pointCount = Convert.ToInt32(Math.Ceiling(PointCount / 8d));
|
||||
double xStep = xRadius / pointCount;
|
||||
double yStep = yRadius / pointCount;
|
||||
double x, y;
|
||||
@@ -49,5 +57,17 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
surroundList.Add(surroundList[0].Clone() as IPoint2D);
|
||||
return surroundList;
|
||||
}
|
||||
|
||||
private void CheckParameters()
|
||||
{
|
||||
//if (surroundList is null || surroundList.Count == 0)
|
||||
//{
|
||||
// throw new StructureHelperException(ErrorStrings.ParameterIsNull);
|
||||
//}
|
||||
if (PointCount < 12)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Point count must be grater than 12, but was {PointCount}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user