Add primitive visual property
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
@@ -10,13 +12,23 @@ namespace DataAccess.DTOs
|
||||
[JsonProperty("Name")]
|
||||
public string? Name { get; set; } = string.Empty;
|
||||
[JsonProperty("StirrupDensity")]
|
||||
public double StirrupDensity { get; set; }
|
||||
public double StirrupDensity { get; set; } = 30000;
|
||||
[JsonProperty("CompressedGap")]
|
||||
public double CompressedGap { get; set; }
|
||||
public double CompressedGap { get; set; } = 0;
|
||||
[JsonProperty("StartCoordinate")]
|
||||
public double StartCoordinate { get; set; } = 0;
|
||||
[JsonProperty("EndCoordinate")]
|
||||
public double EndCoordinate { get; set; } = 100;
|
||||
[JsonProperty("VisualProperty")]
|
||||
public IPrimitiveVisualProperty VisualProperty { get; set; }
|
||||
|
||||
public StirrupByDensityDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
VisualProperty = new PrimitiveVisualPropertyDTO(Guid.NewGuid())
|
||||
{
|
||||
Color = (Color)ColorConverter.ConvertFromString("Black")
|
||||
};
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
@@ -22,11 +24,16 @@ namespace DataAccess.DTOs
|
||||
public double LegCount { get; set; }
|
||||
[JsonProperty("RebarSection")]
|
||||
public IRebarSection RebarSection { get; set; }
|
||||
|
||||
[JsonProperty("VisualProperty")]
|
||||
public IPrimitiveVisualProperty VisualProperty { get; set; }
|
||||
|
||||
public StirrupByInclinedRebarDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
VisualProperty = new PrimitiveVisualPropertyDTO(Guid.NewGuid())
|
||||
{
|
||||
Color = (Color)ColorConverter.ConvertFromString("Black")
|
||||
};
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
@@ -9,23 +11,33 @@ namespace DataAccess.DTOs
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; }
|
||||
[JsonProperty("Name")]
|
||||
public string? Name { get; set; }
|
||||
public string? Name { get; set; } = string.Empty;
|
||||
[JsonProperty("LegCount")]
|
||||
public double LegCount { get; set; }
|
||||
public double LegCount { get; set; } = 2;
|
||||
[JsonProperty("Diameter")]
|
||||
public double Diameter { get; set; }
|
||||
public double Diameter { get; set; } = 0.008;
|
||||
[JsonProperty("Material")]
|
||||
public IReinforcementLibMaterial Material { get; set; }
|
||||
[JsonProperty("Spacing")]
|
||||
public double Spacing { get; set; }
|
||||
public double Spacing { get; set; } = 0.1;
|
||||
[JsonProperty("CompressedGap")]
|
||||
public double CompressedGap { get; set; }
|
||||
public double CompressedGap { get; set; } = 0;
|
||||
[JsonProperty("IsSpiral")]
|
||||
public bool IsSpiral { get; set; } = false;
|
||||
[JsonProperty("StartCoordinate")]
|
||||
public double StartCoordinate { get; set; } = 0;
|
||||
[JsonProperty("EndCoordinate")]
|
||||
public double EndCoordinate { get; set; } = 100;
|
||||
[JsonProperty("VisualProperty")]
|
||||
public IPrimitiveVisualProperty VisualProperty { get; set; }
|
||||
|
||||
public StirrupByRebarDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
VisualProperty = new PrimitiveVisualPropertyDTO(Guid.NewGuid())
|
||||
{
|
||||
Color = (Color)ColorConverter.ConvertFromString("Black")
|
||||
};
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
@@ -8,20 +11,27 @@ namespace DataAccess.DTOs
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; }
|
||||
[JsonProperty("Name")]
|
||||
public string? Name { get; set; }
|
||||
public string? Name { get; set; } = string.Empty;
|
||||
[JsonProperty("CompressedGap")]
|
||||
public double CompressedGap { get; set; }
|
||||
public double CompressedGap { get; set; } = 0;
|
||||
[JsonProperty("Stirrups")]
|
||||
public List<IStirrup> Stirrups { get; } = new();
|
||||
[JsonProperty("VisualProperty")]
|
||||
public IPrimitiveVisualProperty VisualProperty { get; set; }
|
||||
|
||||
public StirrupGroupDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
VisualProperty = new PrimitiveVisualPropertyDTO(Guid.NewGuid())
|
||||
{
|
||||
Color = (Color)ColorConverter.ConvertFromString("Black")
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
32
DataAccess/DTOs/DTOEntities/PrimitiveVisualPropertyDTO.cs
Normal file
32
DataAccess/DTOs/DTOEntities/PrimitiveVisualPropertyDTO.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using StructureHelperCommon.Services.ColorServices;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class PrimitiveVisualPropertyDTO : IPrimitiveVisualProperty
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; }
|
||||
[JsonProperty("IsVisible")]
|
||||
public bool IsVisible { get; set; } = true;
|
||||
[JsonProperty("Color")]
|
||||
public Color Color { get; set; } = ColorProcessor.GetRandomColor();
|
||||
[JsonProperty("Zindex")]
|
||||
public int ZIndex { get; set; } = 0;
|
||||
[JsonProperty("Opacity")]
|
||||
public double Opacity { get; set; } = 1;
|
||||
|
||||
|
||||
public PrimitiveVisualPropertyDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,6 +74,7 @@ namespace DataAccess.DTOs
|
||||
{ (typeof(List<IVisualAnalysis>), "ListOfIVisualAnalysis") },
|
||||
{ (typeof(Point2DDTO), "Point2D") },
|
||||
{ (typeof(PointNdmPrimitiveDTO), "PointNdmPrimitive") },
|
||||
{ (typeof(PrimitiveVisualPropertyDTO), "PrimitiveVisualProperty") },
|
||||
{ (typeof(ProjectDTO), "Project") },
|
||||
{ (typeof(RebarNdmPrimitiveDTO), "RebarNdmPrimitive") },
|
||||
{ (typeof(RebarSectionDTO), "RebarSection") },
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
@@ -24,5 +19,9 @@ namespace DataAccess.DTOs
|
||||
[JsonProperty("Opacity")]
|
||||
public double Opacity { get; set; }
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user