Add calculators saving
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
@@ -13,9 +14,9 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public class CircleTriangulationLogicOptions : IShapeTriangulationLogicOptions
|
||||
{
|
||||
public ICircleShape Circle { get; }
|
||||
public ICircleShape Circle { get;}
|
||||
|
||||
public IPoint2D Center { get; }
|
||||
public IPoint2D Center { get; set; }
|
||||
|
||||
public double NdmMaxSize { get; }
|
||||
|
||||
@@ -24,8 +25,9 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
public StrainTuple Prestrain { get; set; }
|
||||
public ITriangulationOptions triangulationOptions { get; set; }
|
||||
public IHeadMaterial HeadMaterial { get; set; }
|
||||
public double RotationAngle { get; set; }
|
||||
|
||||
public CircleTriangulationLogicOptions(IEllipsePrimitive primitive)
|
||||
public CircleTriangulationLogicOptions(IEllipseNdmPrimitive primitive)
|
||||
{
|
||||
Center = primitive.Center.Clone() as Point2D;
|
||||
//to do change to ellipse
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -7,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public interface IShapeTriangulationLogicOptions : ITriangulationLogicOptions
|
||||
public interface IShapeTriangulationLogicOptions : ITriangulationLogicOptions, IHasCenter2D
|
||||
{
|
||||
/// <summary>
|
||||
/// Center of shape
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
public PointTriangulationLogicOptions(IPointPrimitive primitive)
|
||||
public PointTriangulationLogicOptions(IPointNdmPrimitive primitive)
|
||||
{
|
||||
Center = primitive.Center.Clone() as Point2D;
|
||||
Area = primitive.Area;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public RebarTriangulationLogicOptions(RebarPrimitive primitive)
|
||||
public RebarTriangulationLogicOptions(RebarNdmPrimitive primitive)
|
||||
{
|
||||
Center = primitive.Center.Clone() as Point2D;
|
||||
Area = primitive.Area;
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
Material = options.HeadMaterial.GetLoaderMaterial(options.triangulationOptions.LimiteState, options.triangulationOptions.CalcTerm)
|
||||
});
|
||||
TriangulationService.CommonTransform(ndmCollection, options);
|
||||
double angle = options.Rectangle.Angle;
|
||||
double angle = options.RotationAngle;
|
||||
NdmTransform.Rotate(ndmCollection, angle);
|
||||
TriangulationService.SetPrestrain(ndmCollection, options.Prestrain);
|
||||
return ndmCollection;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
@@ -10,7 +11,9 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
public class RectangleTriangulationLogicOptions : IShapeTriangulationLogicOptions
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public IPoint2D Center { get; }
|
||||
public IPoint2D Center { get; set; }
|
||||
/// <inheritdoc />
|
||||
public double RotationAngle { get; set; } = 0d;
|
||||
/// <inheritdoc />
|
||||
public IRectangleShape Rectangle { get; }
|
||||
/// <inheritdoc />
|
||||
@@ -31,9 +34,10 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
Prestrain = new StrainTuple();
|
||||
}
|
||||
|
||||
public RectangleTriangulationLogicOptions(IRectanglePrimitive primitive)
|
||||
public RectangleTriangulationLogicOptions(IRectangleNdmPrimitive primitive)
|
||||
{
|
||||
Center = new Point2D() {X = primitive.Center.X, Y = primitive.Center.Y };
|
||||
RotationAngle = primitive.RotationAngle;
|
||||
Rectangle = primitive;
|
||||
NdmMaxSize = primitive.DivisionSize.NdmMaxSize;
|
||||
NdmMinDivision = primitive.DivisionSize.NdmMinDivision;
|
||||
|
||||
Reference in New Issue
Block a user