Add triangulation of polygon
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class DivisionSizeFromDTOConvertStrategy : ConvertStrategy<IDivisionSize, IDivisionSize>
|
||||
{
|
||||
IUpdateStrategy<IDivisionSize> updateStrategy;
|
||||
|
||||
public DivisionSizeFromDTOConvertStrategy(IUpdateStrategy<IDivisionSize> updateStrategy)
|
||||
{
|
||||
this.updateStrategy = updateStrategy;
|
||||
}
|
||||
|
||||
public DivisionSizeFromDTOConvertStrategy(IBaseConvertStrategy baseConvertStrategy) : base(baseConvertStrategy)
|
||||
{
|
||||
updateStrategy = new DivisionSizeUpdateStrategy();
|
||||
}
|
||||
|
||||
public override IDivisionSize GetNewItem(IDivisionSize source)
|
||||
{
|
||||
if (source is not DivisionSizeDTO sourceDTO)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(source));
|
||||
}
|
||||
NewItem = new DivisionSize(source.Id);
|
||||
updateStrategy.Update(NewItem, sourceDTO);
|
||||
return NewItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ namespace DataAccess.DTOs
|
||||
private void InitializeStrategies()
|
||||
{
|
||||
updateStrategy ??= new ForceCombinationFromFileUpdateStrategy();
|
||||
pointConvertStrategy = new Point2DFromDTOConvertStrategy() { ReferenceDictionary = ReferenceDictionary, TraceLogger = TraceLogger};
|
||||
pointConvertStrategy = new Point2DFromDTOConvertStrategy(this);
|
||||
combinationPropertyConvertStrategy = new FactoredCombinationPropertyFromDTOConvertStrategy(ReferenceDictionary, TraceLogger);
|
||||
fileConvertStrategy ??= new ColumnedFilePropertyFromDTOConvertStrategy() { ReferenceDictionary = ReferenceDictionary, TraceLogger = TraceLogger };
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace DataAccess.DTOs
|
||||
{
|
||||
baseUpdateStrategy ??= new ForceActionBaseUpdateStrategy();
|
||||
updateStrategy ??= new ForceCombinationListUpdateStrategy();
|
||||
pointConvertStrategy ??= new Point2DFromDTOConvertStrategy() { ReferenceDictionary = ReferenceDictionary, TraceLogger = TraceLogger};
|
||||
pointConvertStrategy ??= new Point2DFromDTOConvertStrategy(this);
|
||||
designTupleConvertStrategy ??= new DesignForceTupleFromDTOConvertStrategy() { ReferenceDictionary = ReferenceDictionary, TraceLogger = TraceLogger };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace DataAccess.DTOs
|
||||
{
|
||||
baseUpdateStrategy ??= new ForceActionBaseUpdateStrategy();
|
||||
updateStrategy ??= new ForceFactoredListUpdateStrategy();
|
||||
pointConvertStrategy ??= new Point2DFromDTOConvertStrategy() { ReferenceDictionary = ReferenceDictionary, TraceLogger = TraceLogger};
|
||||
pointConvertStrategy ??= new Point2DFromDTOConvertStrategy(this);
|
||||
forceTupleConvertStrategy ??= new ForceTupleFromDTOConvertStrategy() { ReferenceDictionary = ReferenceDictionary, TraceLogger = TraceLogger };
|
||||
combinationPropertyConvertStrategy ??= new FactoredCombinationPropertyFromDTOConvertStrategy(ReferenceDictionary, TraceLogger);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs.Converters
|
||||
{
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives.Logics;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class NdmElementFromDTOConvertStrategy : ConvertStrategy<INdmElement, INdmElement>
|
||||
{
|
||||
private IUpdateStrategy<INdmElement> updateStrategy;
|
||||
private IUpdateStrategy<IForceTuple> forceUpdateStrategy = new ForceTupleUpdateStrategy();
|
||||
private NdmElement newItem;
|
||||
|
||||
public NdmElementFromDTOConvertStrategy(IBaseConvertStrategy baseConvertStrategy) : base(baseConvertStrategy)
|
||||
{
|
||||
}
|
||||
|
||||
public override INdmElement GetNewItem(INdmElement source)
|
||||
{
|
||||
if (source is not NdmElementDTO sourceDTO)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(source));
|
||||
}
|
||||
newItem = new NdmElement(sourceDTO.Id);
|
||||
updateStrategy = new NdmElementUpdateStrategy() { UpdateChildren = false};
|
||||
updateStrategy.Update(newItem, sourceDTO);
|
||||
forceUpdateStrategy.Update(newItem.UsersPrestrain, source.UsersPrestrain);
|
||||
//newItem.UsersPrestrain.Id = source.UsersPrestrain.Id;
|
||||
//forceUpdateStrategy.Update(newItem.AutoPrestrain, source.AutoPrestrain);
|
||||
//(newItem.AutoPrestrain as ForceTupleDTO).Id = source.AutoPrestrain.Id;
|
||||
NewItem = newItem;
|
||||
return NewItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,16 +54,20 @@ namespace DataAccess.DTOs
|
||||
updateStrategy.Update(newItem, source);
|
||||
headMaterialConvertStrategy.ReferenceDictionary = ReferenceDictionary;
|
||||
headMaterialConvertStrategy.TraceLogger = TraceLogger;
|
||||
var convertLogic = new DictionaryConvertStrategy<HeadMaterialDTO, IHeadMaterial>(this, headMaterialConvertStrategy);
|
||||
var headMaterialLogic = new DictionaryConvertStrategy<HeadMaterialDTO, IHeadMaterial>(this, headMaterialConvertStrategy);
|
||||
if (source.HeadMaterial != null)
|
||||
{
|
||||
var headMaterial = convertLogic.Convert(source.HeadMaterial);
|
||||
var headMaterial = headMaterialLogic.Convert(source.HeadMaterial);
|
||||
newItem.HeadMaterial = headMaterial;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newItem.HeadMaterial = null;
|
||||
}
|
||||
forceUpdateStrategy.Update(newItem.UsersPrestrain, source.UsersPrestrain);
|
||||
(newItem.UsersPrestrain as ForceTupleDTO).Id = source.UsersPrestrain.Id;
|
||||
forceUpdateStrategy.Update(newItem.AutoPrestrain, source.AutoPrestrain);
|
||||
(newItem.AutoPrestrain as ForceTupleDTO).Id = source.AutoPrestrain.Id;
|
||||
//forceUpdateStrategy.Update(newItem.AutoPrestrain, source.AutoPrestrain);
|
||||
//(newItem.AutoPrestrain as ForceTupleDTO).Id = source.AutoPrestrain.Id;
|
||||
return newItem;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,9 +45,12 @@ namespace DataAccess.DTOs
|
||||
|
||||
public override INdmPrimitive GetNewItem(INdmPrimitive source)
|
||||
{
|
||||
GetMaterial(source.NdmElement.HeadMaterial);
|
||||
INdmPrimitive newItem = GetNewPrimitive(source);
|
||||
newItem.NdmElement.HeadMaterial = headMaterial;
|
||||
if (source.NdmElement.HeadMaterial != null)
|
||||
{
|
||||
GetMaterial(source.NdmElement.HeadMaterial);
|
||||
newItem.NdmElement.HeadMaterial = headMaterial;
|
||||
}
|
||||
return newItem;
|
||||
}
|
||||
|
||||
@@ -69,11 +72,23 @@ namespace DataAccess.DTOs
|
||||
{
|
||||
return GetRectangle(rectangle);
|
||||
}
|
||||
if (source is ShapeNdmPrimitiveDTO shape)
|
||||
{
|
||||
return GetShape(shape);
|
||||
}
|
||||
string errorString = ErrorStrings.ObjectTypeIsUnknownObj(source);
|
||||
TraceLogger.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
|
||||
private INdmPrimitive GetShape(ShapeNdmPrimitiveDTO shape)
|
||||
{
|
||||
TraceLogger?.AddMessage($"{PrimitiveIs} shape ndm primitive");
|
||||
ShapeNdmPrimitiveFromDTOConvertStrategy convertStrategy = new(this);
|
||||
IShapeNdmPrimitive shapeNdmPrimitive = convertStrategy.Convert(shape);
|
||||
return shapeNdmPrimitive;
|
||||
}
|
||||
|
||||
private void GetMaterial(IHeadMaterial source)
|
||||
{
|
||||
HeadMaterialFromDTOConvertStrategy convertStrategy = new()
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class ShapeNdmPrimitiveFromDTOConvertStrategy : ConvertStrategy<IShapeNdmPrimitive, IShapeNdmPrimitive>
|
||||
{
|
||||
IUpdateStrategy<IShapeNdmPrimitive> updateStrategy;
|
||||
private IConvertStrategy<IShape, IShape> shapeConvertStrategy;
|
||||
private IConvertStrategy<INdmElement, INdmElement> ndmElementConvertStrategy;
|
||||
private IConvertStrategy<Point2D, Point2DDTO> pointConvertStrategy;
|
||||
private IConvertStrategy<IVisualProperty, VisualPropertyDTO> visualPropsConvertStrategy;
|
||||
private IConvertStrategy<IDivisionSize, IDivisionSize> divisionConvertStrategy;
|
||||
|
||||
private ShapeNdmPrimitive newItem;
|
||||
|
||||
public ShapeNdmPrimitiveFromDTOConvertStrategy(IBaseConvertStrategy baseConvertStrategy) : base(baseConvertStrategy)
|
||||
{
|
||||
updateStrategy = new ShapeNdmPrimitiveUpdateStrategy() { UpdateChildren = false };
|
||||
shapeConvertStrategy = new ShapeFromDTOConvertStrategy(this);
|
||||
ndmElementConvertStrategy = new NdmElementFromDTOConvertStrategy(this);
|
||||
pointConvertStrategy = new Point2DFromDTOConvertStrategy(this);
|
||||
visualPropsConvertStrategy = new VisualPropertyFromDTOConvertStrategy(this);
|
||||
divisionConvertStrategy = new DivisionSizeFromDTOConvertStrategy(this);
|
||||
}
|
||||
|
||||
public override IShapeNdmPrimitive GetNewItem(IShapeNdmPrimitive source)
|
||||
{
|
||||
ChildClass = this;
|
||||
if (source is not ShapeNdmPrimitiveDTO sourceDTO)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(source) + ": source shape is not DTO object");
|
||||
}
|
||||
newItem = new(source.Id);
|
||||
updateStrategy.Update(newItem, sourceDTO);
|
||||
updateChildProperties(sourceDTO);
|
||||
NewItem = newItem;
|
||||
return NewItem;
|
||||
}
|
||||
private void updateChildProperties(ShapeNdmPrimitiveDTO source)
|
||||
{
|
||||
newItem.SetShape(shapeConvertStrategy.Convert(source.Shape));
|
||||
newItem.NdmElement = ndmElementConvertStrategy.Convert(source.NdmElement);
|
||||
newItem.Center = pointConvertStrategy.Convert(source.Center as Point2DDTO);
|
||||
newItem.VisualProperty = visualPropsConvertStrategy.Convert(source.VisualProperty as VisualPropertyDTO);
|
||||
newItem.DivisionSize = divisionConvertStrategy.Convert(source.DivisionSize);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class LinePolygonFromDTOConvertStrategy : ConvertStrategy<ILinePolygonShape, ILinePolygonShape>
|
||||
{
|
||||
private IUpdateStrategy<ILinePolygonShape> updateStrategy;
|
||||
private IConvertStrategy<IVertex, IVertex> vertexConvertStrategy;
|
||||
private LinePolygonShape newItem;
|
||||
|
||||
public LinePolygonFromDTOConvertStrategy(IUpdateStrategy<ILinePolygonShape> updateStrategy)
|
||||
{
|
||||
this.updateStrategy = updateStrategy;
|
||||
}
|
||||
|
||||
public LinePolygonFromDTOConvertStrategy(IBaseConvertStrategy baseConvertStrategy) : base(baseConvertStrategy)
|
||||
{
|
||||
updateStrategy = new LinePolygonShapeUpdateStrategy() { UpdateChildren = false };
|
||||
vertexConvertStrategy = new VertexFtomDTOConvertStrategy(this);
|
||||
}
|
||||
|
||||
public override ILinePolygonShape GetNewItem(ILinePolygonShape source)
|
||||
{
|
||||
ChildClass = this;
|
||||
if (source is not LinePolygonShapeDTO sourceDTO)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(source) + ": source line polygon is not DTO object");
|
||||
}
|
||||
newItem = new(sourceDTO.Id);
|
||||
updateStrategy.Update(newItem, sourceDTO);
|
||||
newItem.Clear();
|
||||
foreach (var item in source.Vertices)
|
||||
{
|
||||
IVertex newVertex = vertexConvertStrategy.Convert(item);
|
||||
newItem.AddVertex(newVertex);
|
||||
}
|
||||
NewItem = newItem;
|
||||
return NewItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,24 +12,26 @@ namespace DataAccess.DTOs
|
||||
{
|
||||
private IUpdateStrategy<ILinePolygonShape> updateStrategy;
|
||||
private IConvertStrategy<VertexDTO, IVertex> vertexConvertStrategy;
|
||||
private LinePolygonShapeDTO newItem;
|
||||
|
||||
public LinePolygonToDTOConvertStrategy(IBaseConvertStrategy baseConvertStrategy) : base(baseConvertStrategy)
|
||||
{
|
||||
updateStrategy = new LinePolygonShapeUpdateStrategy() { UpdateChildren = false };
|
||||
vertexConvertStrategy = new VertexToDTOConvertStrategy(this);
|
||||
}
|
||||
|
||||
public override LinePolygonShapeDTO GetNewItem(ILinePolygonShape source)
|
||||
{
|
||||
ChildClass = this;
|
||||
NewItem = new(source.Id);
|
||||
updateStrategy = new LinePolygonShapeUpdateStrategy() { UpdateChildren = false };
|
||||
vertexConvertStrategy = new VertexToDTOConvertStrategy(this);
|
||||
updateStrategy.Update(NewItem, source);
|
||||
NewItem.Clear();
|
||||
newItem = new(source.Id);
|
||||
updateStrategy.Update(newItem, source);
|
||||
newItem.Clear();
|
||||
foreach (var item in source.Vertices)
|
||||
{
|
||||
VertexDTO newVertex = vertexConvertStrategy.Convert(item);
|
||||
NewItem.AddVertex(newVertex);
|
||||
newItem.AddVertex(newVertex);
|
||||
}
|
||||
NewItem = newItem;
|
||||
return NewItem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
@@ -24,27 +17,16 @@ namespace DataAccess.DTOs
|
||||
|
||||
}
|
||||
|
||||
public override Point2D GetNewItem(Point2DDTO source)
|
||||
public Point2DFromDTOConvertStrategy(IBaseConvertStrategy baseConvertStrategy) : base(baseConvertStrategy)
|
||||
{
|
||||
TraceLogger?.AddMessage("Point 2D converting has been started");
|
||||
try
|
||||
{
|
||||
Point2D newItem = GetNewItemBySource(source);
|
||||
TraceLogger?.AddMessage("Point 2D converting has been finished");
|
||||
return newItem;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Logic: {LoggerStrings.LogicType(this)} made error: {ex.Message}", TraceLogStatuses.Error);
|
||||
throw;
|
||||
}
|
||||
updateStrategy = new Point2DUpdateStrategy();
|
||||
}
|
||||
|
||||
private Point2D GetNewItemBySource(Point2DDTO source)
|
||||
public override Point2D GetNewItem(Point2DDTO source)
|
||||
{
|
||||
Point2D newItem = new(source.Id);
|
||||
updateStrategy.Update(newItem, source);
|
||||
return newItem;
|
||||
NewItem = new(source.Id);
|
||||
updateStrategy.Update(NewItem, source);
|
||||
return NewItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,12 @@ namespace DataAccess.DTOs
|
||||
(this, new CircleShapeFromDTOConvertStrategy(this));
|
||||
NewItem = circleConvertStrategy.Convert(circleShapeDTO);
|
||||
}
|
||||
else if (source is LinePolygonShapeDTO linePolygonDTO)
|
||||
{
|
||||
var polygonConvertStrategy = new DictionaryConvertStrategy<ILinePolygonShape, ILinePolygonShape>
|
||||
(this, new LinePolygonFromDTOConvertStrategy(this));
|
||||
NewItem = polygonConvertStrategy.Convert(linePolygonDTO);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(source) + ": shape is unknown");
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class VertexFtomDTOConvertStrategy : ConvertStrategy<IVertex, IVertex>
|
||||
{
|
||||
private IUpdateStrategy<IVertex> updateStrategy;
|
||||
private IConvertStrategy<Point2D, Point2DDTO> pointConvertStrategy;
|
||||
private Vertex newItem;
|
||||
|
||||
public VertexFtomDTOConvertStrategy(IBaseConvertStrategy baseConvertStrategy) : base(baseConvertStrategy)
|
||||
{
|
||||
updateStrategy = new VertexUpdateStrategy() { UpdateChildren = false };
|
||||
pointConvertStrategy = new Point2DFromDTOConvertStrategy(this);
|
||||
}
|
||||
|
||||
public override IVertex GetNewItem(IVertex source)
|
||||
{
|
||||
ChildClass = this;
|
||||
if (source is not VertexDTO sourceDTO)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(source) + ": source vertex is not DTO object");
|
||||
}
|
||||
newItem = new(sourceDTO.Id);
|
||||
updateStrategy.Update(newItem, sourceDTO);
|
||||
newItem.Point = pointConvertStrategy.Convert(sourceDTO.Point as Point2DDTO);
|
||||
NewItem = newItem;
|
||||
return NewItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class VisualPropertyFromDTOConvertStrategy : ConvertStrategy<IVisualProperty, VisualPropertyDTO>
|
||||
{
|
||||
IUpdateStrategy<IVisualProperty> updateStrategy;
|
||||
|
||||
public VisualPropertyFromDTOConvertStrategy(IUpdateStrategy<IVisualProperty> updateStrategy)
|
||||
{
|
||||
this.updateStrategy = updateStrategy;
|
||||
}
|
||||
|
||||
public VisualPropertyFromDTOConvertStrategy(IBaseConvertStrategy baseConvertStrategy) : base(baseConvertStrategy)
|
||||
{
|
||||
updateStrategy = new VisualPropsUpdateStrategy();
|
||||
}
|
||||
|
||||
public override IVisualProperty GetNewItem(VisualPropertyDTO source)
|
||||
{
|
||||
NewItem = new VisualProperty(source.Id);
|
||||
updateStrategy.Update(NewItem, source);
|
||||
return NewItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace DataAccess.DTOs
|
||||
public bool Triangulate { get; set; }
|
||||
[JsonProperty("UsersPrestrain")]
|
||||
public IForceTuple UsersPrestrain { get; set; } = new ForceTupleDTO(Guid.NewGuid());
|
||||
[JsonProperty("AutoPrestrain")]
|
||||
[JsonIgnore]
|
||||
public IForceTuple AutoPrestrain { get; set; } = new ForceTupleDTO(Guid.NewGuid());
|
||||
|
||||
public NdmElementDTO(Guid id)
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace DataAccess.DTOs
|
||||
[JsonProperty("Name")]
|
||||
public string? Name { get; set; }
|
||||
[JsonProperty("Shape")]
|
||||
public IShape Shape => shape;
|
||||
public IShape Shape { get => shape; set => shape = value; }
|
||||
[JsonProperty("NdmElement")]
|
||||
public INdmElement NdmElement { get; set; }
|
||||
[JsonProperty("Center")]
|
||||
|
||||
@@ -9,10 +9,11 @@ namespace DataAccess.DTOs
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; }
|
||||
[JsonProperty("Vertices")]
|
||||
public IReadOnlyList<IVertex> Vertices => _vertices;
|
||||
public List<IVertex> VerticesList {get => _vertices;}
|
||||
[JsonProperty("IsClosed")]
|
||||
public bool IsClosed { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public IReadOnlyList<IVertex> Vertices => _vertices;
|
||||
|
||||
public LinePolygonShapeDTO(Guid id)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ using StructureHelperCommon.Models.Analyses;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
@@ -34,70 +35,117 @@ namespace DataAccess.DTOs
|
||||
List<(Type type, string name)> newList = new List<(Type type, string name)>
|
||||
{
|
||||
{ (typeof(AccuracyDTO), "Accuracy") },
|
||||
{ (typeof(CircleShapeDTO), "CircleShape") },
|
||||
{ (typeof(ConcreteLibMaterialDTO), "ConcreteLibMaterial") },
|
||||
{ (typeof(ColumnFilePropertyDTO), "ColumnFileProperty") },
|
||||
{ (typeof(ColumnedFilePropertyDTO), "ColumnedFileProperty") },
|
||||
{ (typeof(CompressedMemberDTO), "CompressedMember") },
|
||||
{ (typeof(CrackCalculatorDTO), "CrackCalculator") },
|
||||
{ (typeof(CrackCalculatorInputDataDTO), "CrackCalculatorInputData") },
|
||||
{ (typeof(CrossSectionDTO), "CrossSection") },
|
||||
{ (typeof(CrossSectionNdmAnalysisDTO), "CrossSectionNdmAnalysis") },
|
||||
{ (typeof(CrossSectionRepositoryDTO), "CrossSectionRepository") },
|
||||
{ (typeof(DateVersionDTO), "DateVersion") },
|
||||
{ (typeof(DesignForceTupleDTO), "DesignForceTuple") },
|
||||
{ (typeof(DivisionSizeDTO), "DivisionSize") },
|
||||
{ (typeof(ElasticMaterialDTO), "ElasticMaterial") },
|
||||
{ (typeof(EllipseNdmPrimitiveDTO), "EllipseNdmPrimitive") },
|
||||
{ (typeof(FileVersionDTO), "FileVersion") },
|
||||
{ (typeof(ForceCalculatorDTO), "ForceCalculator") },
|
||||
{ (typeof(ForceCalculatorInputDataDTO), "ForceCalculatorInputData") },
|
||||
{ (typeof(FRMaterialDTO), "FRMaterial") },
|
||||
{ (typeof(HeadMaterialDTO), "HeadMaterial") },
|
||||
{ (typeof(MaterialSafetyFactorDTO), "MaterialSafetyFactor") },
|
||||
{ (typeof(NdmElementDTO), "NdmElement") },
|
||||
{ (typeof(IVisualAnalysis), "IVisualAnalysis") },
|
||||
{ (typeof(List<CalcTerms>), "ListOfCalcTerms") },
|
||||
{ (typeof(List<IColumnFileProperty>), "ColumnFileProperties") },
|
||||
{ (typeof(List<IColumnedFileProperty>), "ColumnedFileProperties") },
|
||||
{ (typeof(List<ICalculator>), "ListOfICalculator") },
|
||||
{ (typeof(List<IDateVersion>), "ListOfIDateVersion") },
|
||||
{ (typeof(List<IDesignForceTuple>), "ListOfIDesignForceTuple") },
|
||||
{ (typeof(List<IForceAction>), "ListOfIForceAction") },
|
||||
{ (typeof(List<IForceTuple>), "ListOfIForceTuple") },
|
||||
{ (typeof(List<IHeadMaterial>), "ListOfIHeadMaterial") },
|
||||
{ (typeof(List<LimitStates>), "ListOfLimitState") },
|
||||
{ (typeof(List<IMaterialSafetyFactor>), "ListOfMaterialSafetyFactor") },
|
||||
{ (typeof(List<IMaterialPartialFactor>), "ListOfMaterialPartialFactor") },
|
||||
{ (typeof(List<INdmPrimitive>), "ListOfINdmPrimitive") },
|
||||
{ (typeof(List<IPartialFactor>), "ListOfPartialFactor") },
|
||||
{ (typeof(List<IVisualAnalysis>), "ListOfIVisualAnalysis") },
|
||||
{ (typeof(Point2DDTO), "Point2D") },
|
||||
{ (typeof(PointNdmPrimitiveDTO), "PointNdmPrimitive") },
|
||||
{ (typeof(PrimitiveVisualPropertyDTO), "PrimitiveVisualProperty") },
|
||||
{ (typeof(ProjectDTO), "Project") },
|
||||
{ (typeof(RebarNdmPrimitiveDTO), "RebarNdmPrimitive") },
|
||||
{ (typeof(RebarSectionDTO), "RebarSection") },
|
||||
{ (typeof(RectangleNdmPrimitiveDTO), "RectangleNdmPrimitive") },
|
||||
{ (typeof(RectangleShapeDTO), "RectangleShape") },
|
||||
{ (typeof(ReinforcementLibMaterialDTO), "ReinforcementLibMaterial") },
|
||||
{ (typeof(RootObjectDTO), "RootObject") },
|
||||
{ (typeof(MaterialPartialFactorDTO), "MaterialPartialFactor") },
|
||||
{ (typeof(VersionProcessorDTO), "VersionProcessor") },
|
||||
{ (typeof(VisualAnalysisDTO), "VisualAnalysis") },
|
||||
{ (typeof(VisualPropertyDTO), "VisualProperty") },
|
||||
{ (typeof(UserCrackInputDataDTO), "UserCrackInputData") },
|
||||
{ (typeof(WorkPlanePropertyDTO), "WorkPlanePropertyDTO") },
|
||||
};
|
||||
newList.AddRange(GetProjectList());
|
||||
newList.AddRange(GetGeometryShapeList());
|
||||
newList.AddRange(GetForceList());
|
||||
newList.AddRange(GetListForBeamShear());
|
||||
newList.AddRange(GetMaterialList());
|
||||
newList.AddRange(GetCalculatorList());
|
||||
newList.AddRange(GetNdmPrimitiveList());
|
||||
newList.AddRange(GetBeamShearList());
|
||||
return newList;
|
||||
}
|
||||
|
||||
private static List<(Type type, string name)> GetProjectList()
|
||||
{
|
||||
List<(Type type, string name)> newList = new()
|
||||
{
|
||||
{ (typeof(List<IVisualAnalysis>), "ListOfIVisualAnalysis") },
|
||||
{ (typeof(List<IDateVersion>), "ListOfIDateVersion") },
|
||||
{ (typeof(RootObjectDTO), "RootObject") },
|
||||
{ (typeof(ProjectDTO), "Project") },
|
||||
{ (typeof(VersionProcessorDTO), "VersionProcessor") },
|
||||
{ (typeof(DateVersionDTO), "DateVersion") },
|
||||
{ (typeof(IVisualAnalysis), "IVisualAnalysis") },
|
||||
{ (typeof(VisualAnalysisDTO), "VisualAnalysis") },
|
||||
{ (typeof(FileVersionDTO), "FileVersion") },
|
||||
|
||||
};
|
||||
return newList;
|
||||
}
|
||||
private static List<(Type type, string name)> GetMaterialList()
|
||||
{
|
||||
List<(Type type, string name)> newList = new()
|
||||
{
|
||||
{ (typeof(List<IMaterialPartialFactor>), "ListOfMaterialPartialFactor") },
|
||||
{ (typeof(ConcreteLibMaterialDTO), "ConcreteLibMaterial") },
|
||||
{ (typeof(ElasticMaterialDTO), "ElasticMaterial") },
|
||||
{ (typeof(FRMaterialDTO), "FRMaterial") },
|
||||
{ (typeof(HeadMaterialDTO), "HeadMaterial") },
|
||||
{ (typeof(List<IHeadMaterial>), "ListOfIHeadMaterial") },
|
||||
{ (typeof(MaterialSafetyFactorDTO), "MaterialSafetyFactor") },
|
||||
{ (typeof(List<IMaterialSafetyFactor>), "ListOfMaterialSafetyFactor") },
|
||||
{ (typeof(MaterialPartialFactorDTO), "MaterialPartialFactor") },
|
||||
{ (typeof(ReinforcementLibMaterialDTO), "ReinforcementLibMaterial") },
|
||||
};
|
||||
return newList;
|
||||
}
|
||||
private static List<(Type type, string name)> GetCalculatorList()
|
||||
{
|
||||
List<(Type type, string name)> newList = new()
|
||||
{
|
||||
{ (typeof(List<ICalculator>), "ListOfICalculator") },
|
||||
{ (typeof(ForceCalculatorDTO), "ForceCalculator") },
|
||||
{ (typeof(ForceCalculatorInputDataDTO), "ForceCalculatorInputData") },
|
||||
{ (typeof(CrackCalculatorDTO), "CrackCalculator") },
|
||||
{ (typeof(CrackCalculatorInputDataDTO), "CrackCalculatorInputData") },
|
||||
{ (typeof(UserCrackInputDataDTO), "UserCrackInputData") },
|
||||
|
||||
};
|
||||
return newList;
|
||||
}
|
||||
private static List<(Type type, string name)> GetNdmPrimitiveList()
|
||||
{
|
||||
List<(Type type, string name)> newList = new()
|
||||
{
|
||||
{ (typeof(List<INdmPrimitive>), "ListOfINdmPrimitive") },
|
||||
{ (typeof(CrossSectionNdmAnalysisDTO), "CrossSectionNdmAnalysis") },
|
||||
{ (typeof(CrossSectionDTO), "CrossSection") },
|
||||
{ (typeof(CrossSectionRepositoryDTO), "CrossSectionRepository") },
|
||||
{ (typeof(NdmElementDTO), "NdmElement") },
|
||||
{ (typeof(PointNdmPrimitiveDTO), "PointNdmPrimitive") },
|
||||
{ (typeof(RebarNdmPrimitiveDTO), "RebarNdmPrimitive") },
|
||||
{ (typeof(RectangleNdmPrimitiveDTO), "RectangleNdmPrimitive") },
|
||||
{ (typeof(EllipseNdmPrimitiveDTO), "EllipseNdmPrimitive") },
|
||||
{ (typeof(ShapeNdmPrimitiveDTO), "ShapeNdmPrimitive") },
|
||||
{ (typeof(PrimitiveVisualPropertyDTO), "PrimitiveVisualProperty") },
|
||||
|
||||
};
|
||||
return newList;
|
||||
}
|
||||
private static List<(Type type, string name)> GetGeometryShapeList()
|
||||
{
|
||||
List<(Type type, string name)> newList = new()
|
||||
{
|
||||
{ (typeof(List<IVertex>), "ListOfVertex2D") },
|
||||
{ (typeof(Point2DDTO), "Point2D") },
|
||||
{ (typeof(VertexDTO), "Vertex2D") },
|
||||
{ (typeof(RectangleShapeDTO), "RectangleShape") },
|
||||
{ (typeof(CircleShapeDTO), "CircleShape") },
|
||||
{ (typeof(LinePolygonShapeDTO), "LinePolygonShape") },
|
||||
};
|
||||
return newList;
|
||||
}
|
||||
private static List<(Type type, string name)> GetForceList()
|
||||
{
|
||||
List<(Type type, string name)> newList = new()
|
||||
{
|
||||
{ (typeof(List<IForceAction>), "ListOfIForceAction") },
|
||||
{ (typeof(List<IDesignForceTuple>), "ListOfIDesignForceTuple") },
|
||||
{ (typeof(List<IForceTuple>), "ListOfIForceTuple") },
|
||||
{ (typeof(DesignForceTupleDTO), "DesignForceTuple") },
|
||||
{ (typeof(ConcentratedForceDTO), "ConcentratedForce") },
|
||||
{ (typeof(DistributedLoadDTO), "DistributedLoad") },
|
||||
{ (typeof(FactoredForceTupleDTO), "FactoredForceTuple") },
|
||||
@@ -110,8 +158,7 @@ namespace DataAccess.DTOs
|
||||
};
|
||||
return newList;
|
||||
}
|
||||
|
||||
private static List<(Type type, string name)> GetListForBeamShear()
|
||||
private static List<(Type type, string name)> GetBeamShearList()
|
||||
{
|
||||
List<(Type type, string name)> newList = new()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user