Восстановил проект Logic
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public interface IRectangleTriangulationLogic : ITriangulationLogic
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using StructureHelperLogics.Data.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
/// <summary>
|
||||
/// Parameter of triangulation of rectangle part of section
|
||||
/// Параметры триангуляции прямоугольного участка сечения
|
||||
/// </summary>
|
||||
public interface IRectangleTriangulationOptions : ITriangulationLogicOptions
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
ICenter Center { get; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
IRectangle Rectangle { get; }
|
||||
/// <summary>
|
||||
/// Maximum size (width or height) of ndm part after triangulation
|
||||
/// </summary>
|
||||
double NdmMaxSize { get; }
|
||||
/// <summary>
|
||||
/// Minimum quantity of division of side of rectangle after triangulation
|
||||
/// </summary>
|
||||
int NdmMinDivision { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Data.Materials;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public interface ITriangulationLogic
|
||||
{
|
||||
ITriangulationLogicOptions Options { get; }
|
||||
IEnumerable<INdm> GetNdmCollection(IMaterial material);
|
||||
void ValidateOptions(ITriangulationLogicOptions options);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public interface ITriangulationLogicOptions
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using LoaderCalculator.Data.Ndms.Transformations;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public class RectangleTriangulationLogic : IRectangleTriangulationLogic
|
||||
{
|
||||
public ITriangulationLogicOptions Options { get; }
|
||||
|
||||
public IEnumerable<INdm> GetNdmCollection(IMaterial material)
|
||||
{
|
||||
IRectangleTriangulationOptions rectangleOptions = Options as IRectangleTriangulationOptions;
|
||||
double width = rectangleOptions.Rectangle.Width;
|
||||
double height = rectangleOptions.Rectangle.Height;
|
||||
double ndmMaxSize = rectangleOptions.NdmMaxSize;
|
||||
int ndmMinDivision = rectangleOptions.NdmMinDivision;
|
||||
LoaderCalculator.Triangulations.RectangleTriangulationLogicOptions logicOptions = new LoaderCalculator.Triangulations.RectangleTriangulationLogicOptions(width, height, ndmMaxSize, ndmMinDivision);
|
||||
var logic = LoaderCalculator.Triangulations.Triangulation.GetLogicInstance(logicOptions);
|
||||
var ndmCollection = logic.GetNdmCollection(new LoaderCalculator.Data.Planes.RectangularPlane { Material = material });
|
||||
double dX = rectangleOptions.Center.CenterX;
|
||||
double dY = rectangleOptions.Center.CenterY;
|
||||
NdmTransform.Move(ndmCollection, dX, dY);
|
||||
double angle = rectangleOptions.Rectangle.Angle;
|
||||
NdmTransform.Rotate(ndmCollection, angle);
|
||||
return ndmCollection;
|
||||
}
|
||||
|
||||
public void ValidateOptions(ITriangulationLogicOptions options)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public RectangleTriangulationLogic(ITriangulationLogicOptions options)
|
||||
{
|
||||
Options = options;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using StructureHelperLogics.Data.Shapes;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user