Primitive View Logic for Main View modael was added
This commit is contained in:
@@ -19,6 +19,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
double PrestrainKx { get; set; }
|
||||
double PrestrainKy { get; set; }
|
||||
double PrestrainEpsZ { get; set; }
|
||||
IVisualProperty VisualProperty {get; }
|
||||
|
||||
IEnumerable<INdm> GetNdms(IMaterial material);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
public interface IVisualProperty
|
||||
{
|
||||
bool IsVisible { get; set; }
|
||||
Color Color { get; set; }
|
||||
bool SetMaterialColor { get; set; }
|
||||
int ZIndex { get; set; }
|
||||
double Opacity { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,8 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
public IPoint2D StartPoint { get; set; }
|
||||
public IPoint2D EndPoint { get; set; }
|
||||
public double Thickness { get; set; }
|
||||
|
||||
|
||||
public IVisualProperty VisualProperty => throw new NotImplementedException();
|
||||
|
||||
public LinePrimitive()
|
||||
{
|
||||
|
||||
@@ -25,18 +25,17 @@ namespace StructureHelperLogics.Models.Primitives
|
||||
public double PrestrainKy { get; set; }
|
||||
public double PrestrainEpsZ { get; set; }
|
||||
public double Area { get; set; }
|
||||
|
||||
|
||||
public IVisualProperty VisualProperty { get; }
|
||||
|
||||
public PointPrimitive()
|
||||
{
|
||||
Name = "New Point";
|
||||
Area = 0.0005d;
|
||||
VisualProperty = new VisualProperty();
|
||||
}
|
||||
|
||||
public PointPrimitive(IHeadMaterial material)
|
||||
{
|
||||
HeadMaterial = material;
|
||||
}
|
||||
public PointPrimitive(IHeadMaterial material) : this() { HeadMaterial = material; }
|
||||
|
||||
public IEnumerable<INdm> GetNdms(IMaterial material)
|
||||
{
|
||||
|
||||
@@ -31,11 +31,14 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
public double Height { get; set; }
|
||||
public double Angle { get; set; }
|
||||
|
||||
public IVisualProperty VisualProperty { get; }
|
||||
|
||||
public RectanglePrimitive()
|
||||
{
|
||||
Name = "New Rectangle";
|
||||
NdmMaxSize = 0.01d;
|
||||
NdmMinDivision = 10;
|
||||
VisualProperty = new VisualProperty();
|
||||
}
|
||||
|
||||
public RectanglePrimitive(IHeadMaterial material) : this() { HeadMaterial = material; }
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperCommon.Services.ColorServices;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
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 double Opacity
|
||||
{
|
||||
get { return opacity; }
|
||||
set
|
||||
{
|
||||
if (value < 0d || value > 1d) { throw new StructureHelperException(ErrorStrings.VisualPropertyIsNotRight + nameof(Opacity) + value); }
|
||||
opacity = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public VisualProperty()
|
||||
{
|
||||
IsVisible = true;
|
||||
Color = ColorProcessor.GetRandomColor();
|
||||
SetMaterialColor = true;
|
||||
ZIndex = 0;
|
||||
Opacity = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user