Add EllipsePrimitive to DTO Converter
This commit is contained in:
@@ -9,11 +9,22 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
/// <inheritdoc/>
|
||||
public class DivisionSize : IDivisionSize
|
||||
{
|
||||
public Guid Id { get; }
|
||||
/// <inheritdoc/>
|
||||
public double NdmMaxSize { get; set; } = 0.01d;
|
||||
/// <inheritdoc/>
|
||||
public int NdmMinDivision { get; set; } = 10;
|
||||
/// <inheritdoc/>
|
||||
public bool ClearUnderlying { get; set; } = false;
|
||||
|
||||
public DivisionSize(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public DivisionSize() : this (Guid.NewGuid())
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.Models.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -11,7 +12,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
/// <summary>
|
||||
/// Include parameters of triangulation for shapes
|
||||
/// </summary>
|
||||
public interface IDivisionSize
|
||||
public interface IDivisionSize : ISaveable
|
||||
{
|
||||
/// <summary>
|
||||
/// Maximum size of Ndm part
|
||||
|
||||
@@ -24,10 +24,10 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
/// <summary>
|
||||
/// Prestrain assigned from user
|
||||
/// </summary>
|
||||
StrainTuple UsersPrestrain { get; }
|
||||
IForceTuple UsersPrestrain { get; }
|
||||
/// <summary>
|
||||
/// Prestrain assigned from calculations
|
||||
/// </summary>
|
||||
StrainTuple AutoPrestrain { get; }
|
||||
IForceTuple AutoPrestrain { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -7,7 +8,7 @@ using System.Windows.Media;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
public interface IVisualProperty
|
||||
public interface IVisualProperty : ISaveable
|
||||
{
|
||||
/// <summary>
|
||||
/// Flag of visibility
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
public class LinePrimitive : ILinePrimitive
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public Guid Id { get;}
|
||||
public string Name { get; set; }
|
||||
public double CenterX { get; set; }
|
||||
public double CenterY { get; set; }
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
internal class DivisionPropsUpdateStrategy : IUpdateStrategy<IDivisionSize>
|
||||
public class DivisionSizeUpdateStrategy : IUpdateStrategy<IDivisionSize>
|
||||
{
|
||||
public void Update(IDivisionSize targetObject, IDivisionSize sourceObject)
|
||||
{
|
||||
@@ -5,7 +5,7 @@ using StructureHelperCommon.Services;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
internal class EllipsePrimitiveUpdateStrategy : IUpdateStrategy<IEllipsePrimitive>
|
||||
public class EllipsePrimitiveUpdateStrategy : IUpdateStrategy<IEllipsePrimitive>
|
||||
{
|
||||
private IUpdateStrategy<INdmPrimitive> basePrimitiveUpdateStrategy;
|
||||
private IUpdateStrategy<IDivisionSize> divisionPropsUpdateStrategy;
|
||||
@@ -22,7 +22,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
public EllipsePrimitiveUpdateStrategy() : this(
|
||||
new BaseUpdateStrategy(),
|
||||
new ShapeUpdateStrategy(),
|
||||
new DivisionPropsUpdateStrategy())
|
||||
new DivisionSizeUpdateStrategy())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
public RectanglePrimitiveUpdateStrategy() : this(
|
||||
new BaseUpdateStrategy(),
|
||||
new ShapeUpdateStrategy(),
|
||||
new DivisionPropsUpdateStrategy())
|
||||
new DivisionSizeUpdateStrategy())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
/// <inheritdoc/>
|
||||
public bool Triangulate { get; set; } = true;
|
||||
/// <inheritdoc/>
|
||||
public StrainTuple UsersPrestrain { get; } = new();
|
||||
public IForceTuple UsersPrestrain { get; } = new StrainTuple();
|
||||
/// <inheritdoc/>
|
||||
public StrainTuple AutoPrestrain { get; } = new();
|
||||
public IForceTuple AutoPrestrain { get; } = new StrainTuple();
|
||||
|
||||
public NdmElement(Guid id)
|
||||
{
|
||||
|
||||
@@ -12,11 +12,15 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
public class VisualProperty : IVisualProperty
|
||||
{
|
||||
|
||||
public bool IsVisible { get; set; }
|
||||
public Color Color { get; set; }
|
||||
public bool SetMaterialColor { get; set; }
|
||||
public int ZIndex { get; set; }
|
||||
private double opacity;
|
||||
public Guid Id { get; }
|
||||
|
||||
|
||||
|
||||
public bool IsVisible { get; set; } = true;
|
||||
public Color Color { get; set; } = ColorProcessor.GetRandomColor();
|
||||
public bool SetMaterialColor { get; set; } = true;
|
||||
public int ZIndex { get; set; } = 0;
|
||||
private double opacity = 1d;
|
||||
|
||||
public double Opacity
|
||||
{
|
||||
@@ -28,14 +32,14 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public VisualProperty()
|
||||
public VisualProperty(Guid id)
|
||||
{
|
||||
IsVisible = true;
|
||||
Color = ColorProcessor.GetRandomColor();
|
||||
SetMaterialColor = true;
|
||||
ZIndex = 0;
|
||||
Opacity = 1;
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public VisualProperty() : this (Guid.NewGuid())
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user