diff --git a/AIStudio.Wpf.DiagramDesigner/AIStudio.Wpf.DiagramDesigner.csproj b/AIStudio.Wpf.DiagramDesigner/AIStudio.Wpf.DiagramDesigner.csproj index 461e253..3dbba4a 100644 --- a/AIStudio.Wpf.DiagramDesigner/AIStudio.Wpf.DiagramDesigner.csproj +++ b/AIStudio.Wpf.DiagramDesigner/AIStudio.Wpf.DiagramDesigner.csproj @@ -8,7 +8,7 @@ A.png - 1.0.1 + 1.0.4 一个Wpf的Diagram控件基础库 @@ -58,5 +58,9 @@ Designer + + + + \ No newline at end of file diff --git a/AIStudio.Wpf.DiagramDesigner/Helpers/BoundaryPathFinder.cs b/AIStudio.Wpf.DiagramDesigner/PathGenerators/BoundaryPathFinder.cs similarity index 100% rename from AIStudio.Wpf.DiagramDesigner/Helpers/BoundaryPathFinder.cs rename to AIStudio.Wpf.DiagramDesigner/PathGenerators/BoundaryPathFinder.cs diff --git a/AIStudio.Wpf.DiagramDesigner/Helpers/IPathFinder.cs b/AIStudio.Wpf.DiagramDesigner/PathGenerators/IPathFinder.cs similarity index 100% rename from AIStudio.Wpf.DiagramDesigner/Helpers/IPathFinder.cs rename to AIStudio.Wpf.DiagramDesigner/PathGenerators/IPathFinder.cs diff --git a/AIStudio.Wpf.DiagramDesigner/Helpers/OrthogonalPathFinder.cs b/AIStudio.Wpf.DiagramDesigner/PathGenerators/OrthogonalPathFinder.cs similarity index 100% rename from AIStudio.Wpf.DiagramDesigner/Helpers/OrthogonalPathFinder.cs rename to AIStudio.Wpf.DiagramDesigner/PathGenerators/OrthogonalPathFinder.cs diff --git a/AIStudio.Wpf.DiagramDesigner/Helpers/StraightLinePathFinder.cs b/AIStudio.Wpf.DiagramDesigner/PathGenerators/StraightLinePathFinder.cs similarity index 100% rename from AIStudio.Wpf.DiagramDesigner/Helpers/StraightLinePathFinder.cs rename to AIStudio.Wpf.DiagramDesigner/PathGenerators/StraightLinePathFinder.cs diff --git a/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/PointInfoBase.cs b/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/PointInfoBase.cs index 5f29a04..5454c76 100644 --- a/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/PointInfoBase.cs +++ b/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/PointInfoBase.cs @@ -9,6 +9,8 @@ namespace AIStudio.Wpf.DiagramDesigner { public class PointInfoBase : BindableBase { + public static PointInfoBase Zero { get; } = new PointInfoBase(0, 0); + public PointInfoBase() { ColorViewModel = new ColorViewModel() @@ -24,6 +26,11 @@ namespace AIStudio.Wpf.DiagramDesigner Y = point.Y; } + public PointInfoBase(double x, double y) : this() + { + X = x; + Y = y; + } private double _x; public double X @@ -100,6 +107,36 @@ namespace AIStudio.Wpf.DiagramDesigner } } + public double Dot(PointInfoBase other) => X * other.X + Y * other.Y; + + public PointInfoBase Lerp(PointInfoBase other, double t) + => new PointInfoBase(X * (1.0 - t) + other.X * t, Y * (1.0 - t) + other.Y * t); + + // Maybe just make Points mutable? + public PointInfoBase Add(double value) => new PointInfoBase(X + value, Y + value); + public PointInfoBase Add(double x, double y) => new PointInfoBase(X + x, Y + y); + + public PointInfoBase Substract(double value) => new PointInfoBase(X - value, Y - value); + public PointInfoBase Substract(double x, double y) => new PointInfoBase(X - x, Y - y); + + public double DistanceTo(PointInfoBase other) + => Math.Sqrt(Math.Pow(X - other.X, 2) + Math.Pow(Y - other.Y, 2)); + + public void Deconstruct(out double x, out double y) + { + x = X; + y = Y; + } + + public static PointInfoBase operator -(PointInfoBase a, PointInfoBase b) + { + return new Point(a.X - b.X, a.Y - b.Y); + } + public static PointInfoBase operator +(PointInfoBase a, PointInfoBase b) + { + return new Point(a.X + b.X, a.Y + b.Y); + } + public static implicit operator PointInfoBase(Point point) { return new PointInfoBase(point); @@ -114,5 +151,7 @@ namespace AIStudio.Wpf.DiagramDesigner { return lst.Select(p => (PointInfoBase)p).ToList(); } + + public override string ToString() => $"PointInfoBase(x={X}, y={Y})"; } } diff --git a/AIStudio.Wpf.DiagramHelper/AIStudio.Wpf.DiagramHelper_zsidvaml_wpftmp.csproj b/AIStudio.Wpf.DiagramHelper/AIStudio.Wpf.DiagramHelper_zsidvaml_wpftmp.csproj new file mode 100644 index 0000000..63d727b --- /dev/null +++ b/AIStudio.Wpf.DiagramHelper/AIStudio.Wpf.DiagramHelper_zsidvaml_wpftmp.csproj @@ -0,0 +1,288 @@ + + + AIStudio.Wpf.DiagramHelper + obj\Debug\ + obj\ + F:\aistudio.-wpf.-diagram\AIStudio.Wpf.DiagramHelper\obj\ + <_TargetAssemblyProjectName>AIStudio.Wpf.DiagramHelper + + + + true + true + AIStudio.Wpf.Controls + akwkevin + https://gitee.com/akwkevin + A.png + + + 1.0.1 + 一个Wpf的Diagram控件帮助库 + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AIStudio.Wpf.Flowchart/AIStudio.Wpf.Flowchart.csproj b/AIStudio.Wpf.Flowchart/AIStudio.Wpf.Flowchart.csproj index 8231e00..40c1d27 100644 --- a/AIStudio.Wpf.Flowchart/AIStudio.Wpf.Flowchart.csproj +++ b/AIStudio.Wpf.Flowchart/AIStudio.Wpf.Flowchart.csproj @@ -8,7 +8,7 @@ A.png - 1.0.1 + 1.0.4 一个Wpf的流程图控件 diff --git a/AIStudio.Wpf.Flowchart/ViewModels/FlowNode.cs b/AIStudio.Wpf.Flowchart/ViewModels/FlowNode.cs index b88958e..2604a41 100644 --- a/AIStudio.Wpf.Flowchart/ViewModels/FlowNode.cs +++ b/AIStudio.Wpf.Flowchart/ViewModels/FlowNode.cs @@ -65,7 +65,7 @@ namespace AIStudio.Wpf.Flowchart.ViewModels } } - private string _color; + private string _color = "#1890ff"; [Browsable(false)] public string Color {