RemoveUnderlying property for primitives was added
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
{
|
||||
Point,
|
||||
Rectangle,
|
||||
Circle
|
||||
Circle,
|
||||
Reinforcement
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelper.Infrastructure.UI.Converters.Units;
|
||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
@@ -10,7 +11,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
{
|
||||
public class CircleViewPrimitive : PrimitiveBase, IHasDivision, IHasCenter
|
||||
public class CircleViewPrimitive : PrimitiveBase, IHasCenter
|
||||
{
|
||||
ICirclePrimitive primitive;
|
||||
public double Diameter
|
||||
@@ -25,8 +26,6 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
RefreshPlacement();
|
||||
}
|
||||
}
|
||||
public int NdmMinDivision { get; set; }
|
||||
public double NdmMaxSize { get; set; }
|
||||
|
||||
public double PrimitiveLeft => DeltaX - Diameter / 2d;
|
||||
public double PrimitiveTop => DeltaY - Diameter / 2d;
|
||||
@@ -37,7 +36,9 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $"\nExpected: {nameof(ICirclePrimitive)}, But was: {nameof(primitive)}");
|
||||
}
|
||||
this.primitive = primitive as ICirclePrimitive;
|
||||
var circle = primitive as ICirclePrimitive;
|
||||
this.primitive = circle;
|
||||
DivisionViewModel = new HasDivisionViewModel(circle);
|
||||
}
|
||||
|
||||
public override INdmPrimitive GetNdmPrimitive()
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
{
|
||||
internal static class ViewPrimitiveFactory
|
||||
{
|
||||
// to do public static PrimitiveBase GetViewPrimitive() { }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -8,7 +9,6 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
{
|
||||
internal interface IHasDivision
|
||||
{
|
||||
int NdmMinDivision { get; set; }
|
||||
double NdmMaxSize { get; set; }
|
||||
HasDivisionViewModel HasDivisionViewModel { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
using StructureHelper.Infrastructure.Enums;
|
||||
using StructureHelper.Services.Primitives;
|
||||
using StructureHelper.UnitSystem.Systems;
|
||||
using StructureHelper.Windows.MainWindow;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.Models.Primitives;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
{
|
||||
internal class LineViewPrimitive : PrimitiveBase
|
||||
{
|
||||
public LineViewPrimitive(ILinePrimitive primitive) : base(primitive)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//public LineViewPrimitive(double x, double y, MainViewModel ownerVM) : base(x, y, ownerVM)
|
||||
//{
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ using StructureHelperCommon.Services.ColorServices;
|
||||
using StructureHelperLogics.Models.Primitives;
|
||||
using System.Windows.Controls;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
||||
|
||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
{
|
||||
@@ -34,6 +35,7 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
#endregion
|
||||
|
||||
#region Свойства
|
||||
public HasDivisionViewModel DivisionViewModel { get; set; }
|
||||
public INdmPrimitive NdmPrimitive
|
||||
{
|
||||
get => primitive;
|
||||
@@ -68,6 +70,15 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
OnPropertyChanged(nameof(InvertedCenterY));
|
||||
}
|
||||
}
|
||||
public bool Triangulate
|
||||
{
|
||||
get => primitive.Triangulate;
|
||||
set
|
||||
{
|
||||
primitive.Triangulate = value;
|
||||
OnPropertyChanged(nameof(Triangulate));
|
||||
}
|
||||
}
|
||||
public double InvertedCenterY => - CenterY;
|
||||
public double PrestrainKx
|
||||
{ get => primitive.UsersPrestrain.Kx;
|
||||
|
||||
@@ -6,10 +6,13 @@ using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using StructureHelperLogics.Models.Primitives;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
|
||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
{
|
||||
public class RectangleViewPrimitive : PrimitiveBase, IHasDivision, IHasCenter
|
||||
public class RectangleViewPrimitive : PrimitiveBase, IHasCenter
|
||||
{
|
||||
private IRectanglePrimitive primitive;
|
||||
|
||||
@@ -42,28 +45,11 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
{
|
||||
get => DeltaY - primitive.Height / 2d;
|
||||
}
|
||||
public int NdmMinDivision
|
||||
{
|
||||
get => primitive.NdmMinDivision;
|
||||
set
|
||||
{
|
||||
primitive.NdmMinDivision = value;
|
||||
OnPropertyChanged(nameof(NdmMinDivision));
|
||||
}
|
||||
}
|
||||
public double NdmMaxSize
|
||||
{
|
||||
get => primitive.NdmMaxSize;
|
||||
set
|
||||
{
|
||||
primitive.NdmMaxSize = value;
|
||||
OnPropertyChanged(nameof(NdmMaxSize));
|
||||
}
|
||||
}
|
||||
|
||||
public RectangleViewPrimitive(IRectanglePrimitive _primitive) : base(_primitive)
|
||||
{
|
||||
primitive = _primitive;
|
||||
DivisionViewModel = new HasDivisionViewModel(primitive);
|
||||
}
|
||||
|
||||
public override INdmPrimitive GetNdmPrimitive()
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||
{
|
||||
internal class ReinforcementViewPrimitive : PointViewPrimitive
|
||||
{
|
||||
public ReinforcementViewPrimitive(IPointPrimitive _primitive) : base(_primitive)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user