From 717cc43827f61454ca64272eb95597d883576391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=89=BE=E7=AB=B9?= Date: Sat, 14 Jan 2023 21:52:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=BB=E7=BA=BF=E4=BC=98=E5=8C=96=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/FlowchartViewModel.cs | 4 +- .../ViewModels/LogicalViewModel.cs | 4 +- .../ViewModels/SFCViewModel.cs | 4 +- AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml | 28 +- .../ViewModels/TabItem1ViewModel.cs | 2 +- .../Controls/DesignerCanvas.cs | 4 +- .../Enums/DrawMode.cs | 8 +- .../Enums/RouterMode.cs | 4 +- .../PathFinder/BoundaryPathFinder.cs | 179 ------------ .../PathFinder/IPathFinder.cs | 13 - .../PathFinder/StraightLinePathFinder.cs | 35 --- .../PathGenerators/ConnectingLineBoundary.cs | 15 + .../PathGenerators/ConnectingLineCorner.cs | 15 + ...thGenerator.cs => ConnectingLineSmooth.cs} | 2 +- ...Generator.cs => ConnectingLineStraight.cs} | 2 +- .../PathGenerators/PathGenerators.Boundary.cs | 111 ++++++++ .../PathGenerators.Corner.cs} | 267 ++++++------------ .../PathGenerators/PathGenerators.Smooth.cs | 4 +- .../{NormalRouter.cs => RouterNormal.cs} | 2 +- ...rthogonalRouter.cs => RouterOrthogonal.cs} | 2 +- .../AdditionViewModel/DrawModeViewModel.cs | 4 +- .../BaseViewModel/ConnectorViewModel.cs | 43 +-- .../Models/DiagramDataExtention.cs | 2 +- 23 files changed, 283 insertions(+), 471 deletions(-) delete mode 100644 AIStudio.Wpf.DiagramDesigner/PathFinder/BoundaryPathFinder.cs delete mode 100644 AIStudio.Wpf.DiagramDesigner/PathFinder/IPathFinder.cs delete mode 100644 AIStudio.Wpf.DiagramDesigner/PathFinder/StraightLinePathFinder.cs create mode 100644 AIStudio.Wpf.DiagramDesigner/PathGenerators/ConnectingLineBoundary.cs create mode 100644 AIStudio.Wpf.DiagramDesigner/PathGenerators/ConnectingLineCorner.cs rename AIStudio.Wpf.DiagramDesigner/PathGenerators/{SmoothPathGenerator.cs => ConnectingLineSmooth.cs} (88%) rename AIStudio.Wpf.DiagramDesigner/PathGenerators/{StraightPathGenerator.cs => ConnectingLineStraight.cs} (87%) create mode 100644 AIStudio.Wpf.DiagramDesigner/PathGenerators/PathGenerators.Boundary.cs rename AIStudio.Wpf.DiagramDesigner/{PathFinder/OrthogonalPathFinder.cs => PathGenerators/PathGenerators.Corner.cs} (67%) rename AIStudio.Wpf.DiagramDesigner/Routers/{NormalRouter.cs => RouterNormal.cs} (88%) rename AIStudio.Wpf.DiagramDesigner/Routers/{OrthogonalRouter.cs => RouterOrthogonal.cs} (87%) diff --git a/AIStudio.Wpf.DiagramApp/ViewModels/FlowchartViewModel.cs b/AIStudio.Wpf.DiagramApp/ViewModels/FlowchartViewModel.cs index b8c535d..0e89210 100644 --- a/AIStudio.Wpf.DiagramApp/ViewModels/FlowchartViewModel.cs +++ b/AIStudio.Wpf.DiagramApp/ViewModels/FlowchartViewModel.cs @@ -25,7 +25,7 @@ namespace AIStudio.Wpf.Flowchart { FlowchartService.InitData(DiagramViewModel.Items.OfType().ToList(), DiagramViewModel.Items.OfType().ToList(), DiagramViewModel); } - _service.DrawModeViewModel.LineDrawMode = DrawMode.BoundaryConnectingLine; + _service.DrawModeViewModel.LineDrawMode = DrawMode.ConnectingLineSmooth; } protected override void InitDiagramViewModel() @@ -36,7 +36,7 @@ namespace AIStudio.Wpf.Flowchart DiagramViewModel.GridCellSize = new Size(100, 100); DiagramViewModel.CellHorizontalAlignment = CellHorizontalAlignment.Center; DiagramViewModel.CellVerticalAlignment = CellVerticalAlignment.Center; - _service.DrawModeViewModel.LineDrawMode = DrawMode.BoundaryConnectingLine; + _service.DrawModeViewModel.LineDrawMode = DrawMode.ConnectingLineSmooth; } protected override void Init() diff --git a/AIStudio.Wpf.DiagramApp/ViewModels/LogicalViewModel.cs b/AIStudio.Wpf.DiagramApp/ViewModels/LogicalViewModel.cs index a440f93..a0b768f 100644 --- a/AIStudio.Wpf.DiagramApp/ViewModels/LogicalViewModel.cs +++ b/AIStudio.Wpf.DiagramApp/ViewModels/LogicalViewModel.cs @@ -17,7 +17,7 @@ namespace AIStudio.Wpf.Logical } public LogicalViewModel(string filename, DiagramDocument diagramDocument) : base(filename, diagramDocument) { - _service.DrawModeViewModel.LineDrawMode = DrawMode.CornerConnectingLine; + _service.DrawModeViewModel.LineDrawMode = DrawMode.ConnectingLineSmooth; } protected override void InitDiagramViewModel() @@ -31,7 +31,7 @@ namespace AIStudio.Wpf.Logical DiagramViewModel.CellVerticalAlignment = CellVerticalAlignment.None; DiagramViewModel.Items.CollectionChanged += Items_CollectionChanged; - _service.DrawModeViewModel.LineDrawMode = DrawMode.CornerConnectingLine; + _service.DrawModeViewModel.LineDrawMode = DrawMode.ConnectingLineSmooth; } protected override void Init() diff --git a/AIStudio.Wpf.DiagramApp/ViewModels/SFCViewModel.cs b/AIStudio.Wpf.DiagramApp/ViewModels/SFCViewModel.cs index 1715d79..b43e05a 100644 --- a/AIStudio.Wpf.DiagramApp/ViewModels/SFCViewModel.cs +++ b/AIStudio.Wpf.DiagramApp/ViewModels/SFCViewModel.cs @@ -32,7 +32,7 @@ namespace AIStudio.Wpf.Flowchart readDataTimer.Interval = 1000; readDataTimer.AutoReset = false; readDataTimer.Start(); - _service.DrawModeViewModel.LineDrawMode = DrawMode.BoundaryConnectingLine; + _service.DrawModeViewModel.LineDrawMode = DrawMode.ConnectingLineBoundary; } protected override void InitDiagramViewModel() @@ -43,7 +43,7 @@ namespace AIStudio.Wpf.Flowchart DiagramViewModel.GridCellSize = new Size(100, 60); DiagramViewModel.CellHorizontalAlignment = CellHorizontalAlignment.Center; DiagramViewModel.CellVerticalAlignment = CellVerticalAlignment.Center; - _service.DrawModeViewModel.LineDrawMode = DrawMode.BoundaryConnectingLine; + _service.DrawModeViewModel.LineDrawMode = DrawMode.ConnectingLineBoundary; } private System.Timers.Timer readDataTimer = new System.Timers.Timer(); diff --git a/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml b/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml index 9d2bda1..9f0cfab 100644 --- a/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml +++ b/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml @@ -802,10 +802,10 @@ - - - - + + + +