Восстановил проект Logic

This commit is contained in:
Evgeny Redikultsev
2022-06-20 18:44:24 +05:00
parent 0695dfb917
commit 068b865a89
13 changed files with 235 additions and 8 deletions

View File

@@ -7,10 +7,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StructureHelper", "Structur
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StructureHelperTests", "StructureHelperTests\StructureHelperTests.csproj", "{7AC480BB-8A34-4913-B7AA-C6A5D7F35509}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StructureHelperTests", "StructureHelperTests\StructureHelperTests.csproj", "{7AC480BB-8A34-4913-B7AA-C6A5D7F35509}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{23138426-7994-46A7-834D-08AFB9741A86} = {23138426-7994-46A7-834D-08AFB9741A86} {330BEF5B-15BE-4D2C-A750-B1AE50FB2BE3} = {330BEF5B-15BE-4D2C-A750-B1AE50FB2BE3}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StructureHelperLogics", "..\StructureHelperLogics\StructureHelperLogics\StructureHelperLogics.csproj", "{23138426-7994-46A7-834D-08AFB9741A86}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StructureHelperLogics", "StructureHelperLogics\StructureHelperLogics.csproj", "{330BEF5B-15BE-4D2C-A750-B1AE50FB2BE3}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -26,10 +26,10 @@ Global
{7AC480BB-8A34-4913-B7AA-C6A5D7F35509}.Debug|Any CPU.Build.0 = Debug|Any CPU {7AC480BB-8A34-4913-B7AA-C6A5D7F35509}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7AC480BB-8A34-4913-B7AA-C6A5D7F35509}.Release|Any CPU.ActiveCfg = Release|Any CPU {7AC480BB-8A34-4913-B7AA-C6A5D7F35509}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7AC480BB-8A34-4913-B7AA-C6A5D7F35509}.Release|Any CPU.Build.0 = Release|Any CPU {7AC480BB-8A34-4913-B7AA-C6A5D7F35509}.Release|Any CPU.Build.0 = Release|Any CPU
{23138426-7994-46A7-834D-08AFB9741A86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {330BEF5B-15BE-4D2C-A750-B1AE50FB2BE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23138426-7994-46A7-834D-08AFB9741A86}.Debug|Any CPU.Build.0 = Debug|Any CPU {330BEF5B-15BE-4D2C-A750-B1AE50FB2BE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23138426-7994-46A7-834D-08AFB9741A86}.Release|Any CPU.ActiveCfg = Release|Any CPU {330BEF5B-15BE-4D2C-A750-B1AE50FB2BE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23138426-7994-46A7-834D-08AFB9741A86}.Release|Any CPU.Build.0 = Release|Any CPU {330BEF5B-15BE-4D2C-A750-B1AE50FB2BE3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace StructureHelperLogics.Data.Shapes
{
/// <inheritdoc />
public class Center : ICenter
{
/// <inheritdoc />
public double CenterX { get; set; }
/// <inheritdoc />
public double CenterY { get; set; }
}
}

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace StructureHelperLogics.Data.Shapes
{
/// <summary>
/// Interface for point of center of some shape
/// Интерфейс для точки центра некоторой формы
/// </summary>
public interface ICenter
{
/// <summary>
/// Coordinate of center of rectangle by local axis X, m
/// Координата центра вдоль локальной оси X, м
/// </summary>
double CenterX { get;}
/// <summary>
/// Coordinate of center of rectangle by local axis Y, m
/// Координата центра вдоль локальной оси Y, м
/// </summary>
double CenterY { get;}
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace StructureHelperLogics.Data.Shapes
{
public interface IRectangle
{
/// <summary>
/// Width of rectangle, m
/// </summary>
double Width { get; }
/// <summary>
/// Height of rectangle, m
/// </summary>
double Height { get; }
/// <summary>
/// Angle of rotating rectangle, rad
/// </summary>
double Angle { get; }
}
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace StructureHelperLogics.Data.Shapes
{
/// <inheritdoc />
public class Rectangle : IRectangle
{
/// <inheritdoc />
public double Width { get; set; }
/// <inheritdoc />
public double Height { get; set; }
/// <inheritdoc />
public double Angle { get; set; }
}
}

View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace StructureHelperLogics.NdmCalculations.Triangulations
{
public interface IRectangleTriangulationLogic : ITriangulationLogic
{
}
}

View File

@@ -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; }
}
}

View File

@@ -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);
}
}

View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace StructureHelperLogics.NdmCalculations.Triangulations
{
public interface ITriangulationLogicOptions
{
}
}

View File

@@ -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;
}
}
}

View File

@@ -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;
}
}
}

View File

@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Reference Include="LoaderCalculator">
<HintPath>..\..\StructureHelper\Libraries\LoaderCalculator.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View File

@@ -73,8 +73,8 @@
<Folder Include="FunctionalTests\" /> <Folder Include="FunctionalTests\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\StructureHelperLogics\StructureHelperLogics\StructureHelperLogics.csproj"> <ProjectReference Include="..\StructureHelperLogics\StructureHelperLogics.csproj">
<Project>{23138426-7994-46a7-834d-08afb9741a86}</Project> <Project>{330bef5b-15be-4d2c-a750-b1ae50fb2be3}</Project>
<Name>StructureHelperLogics</Name> <Name>StructureHelperLogics</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>