Circle Primitive Added

This commit is contained in:
Evgeny Redikultsev
2023-02-24 22:17:55 +05:00
parent b05782786c
commit 8fecfb931f
37 changed files with 571 additions and 87 deletions

View File

@@ -0,0 +1,66 @@
using LoaderCalculator.Data.Materials;
using LoaderCalculator.Data.Ndms;
using StructureHelper.Models.Materials;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Services.ShapeServices;
using StructureHelperLogics.NdmCalculations.Triangulations;
using StructureHelperLogics.Services.NdmPrimitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Primitives
{
public class CirclePrimitive : ICirclePrimitive
{
public int Id { get; set; }
public string Name { get; set; }
public double CenterX { get; set; }
public double CenterY { get; set; }
public IHeadMaterial? HeadMaterial { get; set; }
public IStrainTuple UsersPrestrain { get; }
public IStrainTuple AutoPrestrain { get; }
public IVisualProperty VisualProperty { get; }
public double Diameter { get; set; }
public double NdmMaxSize { get; set; }
public int NdmMinDivision { get; set; }
public CirclePrimitive()
{
Name = "New Circle";
NdmMaxSize = 0.01d;
NdmMinDivision = 10;
VisualProperty = new VisualProperty { Opacity = 0.8d };
UsersPrestrain = new StrainTuple();
AutoPrestrain = new StrainTuple();
}
public object Clone()
{
var primitive = new CirclePrimitive();
NdmPrimitivesService.CopyDivisionProperties(this, primitive);
ShapeService.CopyCircleProperties(this, primitive);
return primitive;
}
public IEnumerable<INdm> GetNdms(IMaterial material)
{
var ndms = new List<INdm>();
var options = new CircleTriangulationLogicOptions(this);
var logic = new CircleTriangulationLogic(options);
ndms.AddRange(logic.GetNdmCollection(material));
return ndms;
}
public void Save()
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,13 @@
using StructureHelperCommon.Models.Shapes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Primitives
{
public interface ICirclePrimitive : IHasDivisionSize, ICircleShape
{
}
}

View File

@@ -16,7 +16,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
string Name { get; set; }
double CenterX { get; set; }
double CenterY { get; set; }
IHeadMaterial HeadMaterial { get; set; }
IHeadMaterial? HeadMaterial { get; set; }
IStrainTuple UsersPrestrain { get; }
IStrainTuple AutoPrestrain { get; }
//double PrestrainKx { get; set; }

View File

@@ -22,7 +22,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
public string Name { get; set; }
public double CenterX { get; set; }
public double CenterY { get; set; }
public IHeadMaterial HeadMaterial { get; set; }
public IHeadMaterial? HeadMaterial { get; set; }
public IStrainTuple UsersPrestrain { get; private set; }
public IStrainTuple AutoPrestrain { get; private set; }
public double NdmMaxSize { get; set; }
@@ -47,7 +47,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
public object Clone()
{
RectanglePrimitive primitive = new RectanglePrimitive();
var primitive = new RectanglePrimitive();
NdmPrimitivesService.CopyDivisionProperties(this, primitive);
ShapeService.CopyRectangleProperties(this, primitive);
return primitive;
@@ -55,9 +55,9 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
public IEnumerable<INdm> GetNdms(IMaterial material)
{
List<INdm> ndms = new List<INdm>();
var ndms = new List<INdm>();
var options = new RectangleTriangulationLogicOptions(this);
ITriangulationLogic logic = new RectangleTriangulationLogic(options);
var logic = new RectangleTriangulationLogic(options);
ndms.AddRange(logic.GetNdmCollection(material));
return ndms;
}