LinePrimitive and RectanglePrimitive was added
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Infrastructures.Interfaces
|
||||
{
|
||||
public interface ISaveable
|
||||
{
|
||||
int Id { get; set; }
|
||||
void Save();
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,11 @@
|
||||
/// Coordinate of center of rectangle by local axis X, m
|
||||
/// Координата центра вдоль локальной оси X, м
|
||||
/// </summary>
|
||||
double X { get;}
|
||||
double X { get; set; }
|
||||
/// <summary>
|
||||
/// Coordinate of center of rectangle by local axis Y, m
|
||||
/// Координата центра вдоль локальной оси Y, м
|
||||
/// </summary>
|
||||
double Y { get;}
|
||||
double Y { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
15
StructureHelperCommon/Models/Shapes/ILineShape.cs
Normal file
15
StructureHelperCommon/Models/Shapes/ILineShape.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Shapes
|
||||
{
|
||||
public interface ILineShape : IShape
|
||||
{
|
||||
ICenter StartPoint { get; set; }
|
||||
ICenter EndPoint { get; set; }
|
||||
double Thickness { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
namespace StructureHelperCommon.Models.Shapes
|
||||
{
|
||||
public interface IRectangle : IShape
|
||||
public interface IRectangleShape : IShape
|
||||
{
|
||||
/// <summary>
|
||||
/// Width of rectangle, m
|
||||
/// </summary>
|
||||
double Width { get; }
|
||||
double Width { get; set; }
|
||||
/// <summary>
|
||||
/// Height of rectangle, m
|
||||
/// </summary>
|
||||
double Height { get; }
|
||||
double Height { get; set; }
|
||||
/// <summary>
|
||||
/// Angle of rotating rectangle, rad
|
||||
/// </summary>
|
||||
double Angle { get; }
|
||||
double Angle { get; set; }
|
||||
}
|
||||
}
|
||||
26
StructureHelperCommon/Models/Shapes/LineShape.cs
Normal file
26
StructureHelperCommon/Models/Shapes/LineShape.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Shapes
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public class LineShape : ILineShape
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public ICenter StartPoint { get; set; }
|
||||
/// <inheritdoc />
|
||||
public ICenter EndPoint { get; set; }
|
||||
/// <inheritdoc />
|
||||
public double Thickness { get; set; }
|
||||
|
||||
public LineShape()
|
||||
{
|
||||
StartPoint = new Center();
|
||||
EndPoint = new Center();
|
||||
Thickness = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace StructureHelperCommon.Models.Shapes
|
||||
{
|
||||
public class Point : IPoint
|
||||
public class PointShape : IPoint
|
||||
{
|
||||
public double Area { get; set; }
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace StructureHelperCommon.Models.Shapes
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public class Rectangle : IRectangle
|
||||
public class RectangleShape : IRectangleShape
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public double Width { get; set; }
|
||||
27
StructureHelperCommon/Services/ShapeServices/ShapeService.cs
Normal file
27
StructureHelperCommon/Services/ShapeServices/ShapeService.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Services.ShapeServices
|
||||
{
|
||||
public static class ShapeService
|
||||
{
|
||||
public static void CopyLineProperties(ILineShape source, ILineShape target)
|
||||
{
|
||||
target.StartPoint.X = source.StartPoint.X;
|
||||
target.StartPoint.Y = source.StartPoint.Y;
|
||||
target.EndPoint.X = source.EndPoint.X;
|
||||
target.EndPoint.Y = source.EndPoint.Y;
|
||||
}
|
||||
|
||||
public static void CopyRectangleProperties(IRectangleShape source, IRectangleShape target)
|
||||
{
|
||||
target.Width = source.Width;
|
||||
target.Height = source.Height;
|
||||
target.Angle = source.Angle;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,19 +51,23 @@
|
||||
<Compile Include="Infrastructures\Enums\LimitStates.cs" />
|
||||
<Compile Include="Infrastructures\Exceptions\StructureHelperException.cs" />
|
||||
<Compile Include="Infrastructures\Interfaces\IHasParent.cs" />
|
||||
<Compile Include="Infrastructures\Interfaces\ISaveable.cs" />
|
||||
<Compile Include="Infrastructures\Strings\ErrorString.cs" />
|
||||
<Compile Include="Infrastructures\Enums\MaterialTypes.cs" />
|
||||
<Compile Include="Models\Shapes\Center.cs" />
|
||||
<Compile Include="Models\Shapes\ICenter.cs" />
|
||||
<Compile Include="Models\Shapes\ICenterShape.cs" />
|
||||
<Compile Include="Models\Shapes\ICircle.cs" />
|
||||
<Compile Include="Models\Shapes\ILineShape.cs" />
|
||||
<Compile Include="Models\Shapes\IPoint.cs" />
|
||||
<Compile Include="Models\Shapes\IRectangle.cs" />
|
||||
<Compile Include="Models\Shapes\IRectangleShape.cs" />
|
||||
<Compile Include="Models\Shapes\IShape.cs" />
|
||||
<Compile Include="Models\Shapes\Point.cs" />
|
||||
<Compile Include="Models\Shapes\Rectangle.cs" />
|
||||
<Compile Include="Models\Shapes\LineShape.cs" />
|
||||
<Compile Include="Models\Shapes\PointShape.cs" />
|
||||
<Compile Include="Models\Shapes\RectangleShape.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\ColorServices\ColorProcessor.cs" />
|
||||
<Compile Include="Services\ShapeServices\ShapeService.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
Reference in New Issue
Block a user