Создал опции триангуляции для точки и сделал тест для железобетона
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
interface IPointTiangulationLogic : ITriangulationLogic
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using StructureHelperLogics.Data.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public interface IPointTriangulationLogicOptions : ITriangulationLogicOptions
|
||||
{
|
||||
ICenter Center { get; }
|
||||
double Area { get; }
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
/// Parameter of triangulation of rectangle part of section
|
||||
/// Параметры триангуляции прямоугольного участка сечения
|
||||
/// </summary>
|
||||
public interface IRectangleTriangulationOptions : ITriangulationLogicOptions
|
||||
public interface IRectangleTriangulationLogicOptions : ITriangulationLogicOptions
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
@@ -0,0 +1,35 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperLogics.Data.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public class PointTriangulationLogic : IPointTiangulationLogic
|
||||
{
|
||||
public ITriangulationLogicOptions Options { get; }
|
||||
|
||||
public PointTriangulationLogic(IPointTriangulationLogicOptions options)
|
||||
{
|
||||
Options = options;
|
||||
}
|
||||
|
||||
public IEnumerable<INdm> GetNdmCollection(IMaterial material)
|
||||
{
|
||||
IPointTriangulationLogicOptions options = Options as IPointTriangulationLogicOptions;
|
||||
ICenter center = options.Center;
|
||||
double area = options.Area;
|
||||
List<INdm> ndmCollection = new List<INdm>();
|
||||
INdm ndm = new Ndm() { CenterX = center.X, CenterY = center.Y, Area = area, Material = material };
|
||||
ndmCollection.Add(ndm);
|
||||
return ndmCollection;
|
||||
}
|
||||
|
||||
public void ValidateOptions(ITriangulationLogicOptions options)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using StructureHelperLogics.Data.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class PointTriangulationLogicOptions : IPointTriangulationLogicOptions
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public ICenter Center { get; }
|
||||
|
||||
public double Area { get; }
|
||||
|
||||
public PointTriangulationLogicOptions(ICenter center, double area)
|
||||
{
|
||||
Center = center;
|
||||
Area = area;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
|
||||
public IEnumerable<INdm> GetNdmCollection(IMaterial material)
|
||||
{
|
||||
IRectangleTriangulationOptions rectangleOptions = Options as IRectangleTriangulationOptions;
|
||||
IRectangleTriangulationLogicOptions rectangleOptions = Options as IRectangleTriangulationLogicOptions;
|
||||
double width = rectangleOptions.Rectangle.Width;
|
||||
double height = rectangleOptions.Rectangle.Height;
|
||||
double ndmMaxSize = rectangleOptions.NdmMaxSize;
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Text;
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public class RectangleTriangulationOptions : IRectangleTriangulationOptions
|
||||
public class RectangleTriangulationLogicOptions : IRectangleTriangulationLogicOptions
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public ICenter Center { get; }
|
||||
@@ -18,7 +18,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
/// <inheritdoc />
|
||||
public int NdmMinDivision { get; }
|
||||
|
||||
public RectangleTriangulationOptions(ICenter center, IRectangle rectangle, double ndmMaxSize, int ndmMinDivision)
|
||||
public RectangleTriangulationLogicOptions(ICenter center, IRectangle rectangle, double ndmMaxSize, int ndmMinDivision)
|
||||
{
|
||||
Center = center;
|
||||
Rectangle = rectangle;
|
||||
@@ -26,7 +26,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
NdmMinDivision = ndmMinDivision;
|
||||
}
|
||||
|
||||
public RectangleTriangulationOptions(INdmPrimitive primitive)
|
||||
public RectangleTriangulationLogicOptions(INdmPrimitive primitive)
|
||||
{
|
||||
if (! (primitive.Shape is IRectangle)) { throw new Exception("Shape type is not valid"); }
|
||||
Center = primitive.Center;
|
||||
@@ -63,7 +63,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
if (shape is IRectangle)
|
||||
{
|
||||
IRectangle rectangle = shape as IRectangle;
|
||||
options = new RectangleTriangulationOptions(primitive);
|
||||
options = new RectangleTriangulationLogicOptions(primitive);
|
||||
IRectangleTriangulationLogic logic = new RectangleTriangulationLogic(options);
|
||||
ndms.AddRange(logic.GetNdmCollection(material));
|
||||
}
|
||||
@@ -71,7 +71,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
return ndms;
|
||||
}
|
||||
|
||||
private static IMaterial GetMaterial(IPrimitiveMaterial primitiveMaterial, ITriangulationOptions options)
|
||||
public static IMaterial GetMaterial(IPrimitiveMaterial primitiveMaterial, ITriangulationOptions options)
|
||||
{
|
||||
IMaterial material;
|
||||
if (primitiveMaterial.MaterialType == MaterialTypes.Concrete) { material = GetConcreteMaterial(primitiveMaterial, options); }
|
||||
|
||||
Reference in New Issue
Block a user