diff --git a/FlowForge.sln.DotSettings.user b/FlowForge.sln.DotSettings.user index 38314764b54d7bc9c8ca3de9692c8f321a9f2066..545cac8401665dd28a10fac720bfc22d759b9596 100644 --- a/FlowForge.sln.DotSettings.user +++ b/FlowForge.sln.DotSettings.user @@ -1,7 +1,10 @@ <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> + <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArrowheads_002Ecs_002Fl_003AC_0021_003FUsers_003Ftimon_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Ff33d684d28eda96ce8ff511fd89719957527f5a249bf0c427bba5f237d27d_003FArrowheads_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ABidirectionalGraph_002Ecs_002Fl_003AC_0021_003FUsers_003Fmp455017_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fa8e81c4118651b5932b855cf99986877c2c24685d864158c9053e4f62e213fce_003FBidirectionalGraph_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AEdge_002Ecs_002Fl_003AC_0021_003FUsers_003Ftimon_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fc6dec8134d4e5115e30fcbbde23a657edc52dc4585c5673fe87fae89530f2_003FEdge_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> + <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AGeometryGraph_002Ecs_002Fl_003AC_0021_003FUsers_003Ftimon_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fec51c2d7ba4c960a9dae3716ddab555d654bcbe75d697cc141c3b2c8f247f_003FGeometryGraph_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIDictionary_00602_002Ecs_002Fl_003AC_0021_003FUsers_003Fmp455017_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb756d57b94fb4ab9aa95a9b2a97fce1fa24ea0_003Fa1_003F8276683c_003FIDictionary_00602_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> + <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ALayoutHelpers_002Ecs_002Fl_003AC_0021_003FUsers_003Ftimon_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fd0dd8419a9cbd7bcef7ea0c031796cd8197cb3c658c80b7c71ec2da3918b3_003FLayoutHelpers_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANode_002Ecs_002Fl_003AC_0021_003FUsers_003Ftimon_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F362e998b40631a36346249d25c3c8c712372e68c65f251adc18f8931b4a77a32_003FNode_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANode_002Ecs_002Fl_003AC_0021_003FUsers_003Ftimon_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F50b63217dc36f9d6edcabbd75adb3a7f68f1ebd3b4645b30614b43a9eda189_003FNode_002Ecs_002Fz_003A2_002D1/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASplineRouter_002Ecs_002Fl_003AC_0021_003FUsers_003Ftimon_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fb2961a4f945481bf9a55f7d27e451184c68497a74672874e415414929e5d53a_003FSplineRouter_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> diff --git a/GraphVisualizer.cs b/GraphVisualizer.cs index bd54a96aaf768bf27f15c9d85ebd358aa2ade387..e823878879931c0bcc702c7f7f4f3761a5b6c9df 100644 --- a/GraphVisualizer.cs +++ b/GraphVisualizer.cs @@ -16,7 +16,7 @@ public static class GraphVisualizer foreach (var edge in flowGraph.Graph.Edges) { - if(edge.IsBackwards) continue; + //if(edge.IsBackwards) continue; var msaglEdge = msaglGraph.AddEdge(edge.Source.Id, edge.Target.Id); diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index a1bb900ad1a6f56a364bf5053cce620791ec9ac3..f3884fef038157edbe35e30efb5509da197caa2a 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -4,12 +4,17 @@ using System.Collections.Generic; using System.Linq; using System.Windows; using System.Windows.Forms.Integration; +using Microsoft.Msagl.Core; +using Microsoft.Msagl.Core.Geometry; using Microsoft.Msagl.Core.Geometry.Curves; +using Microsoft.Msagl.Core.Layout; using Microsoft.Msagl.Core.Routing; using MsaglDrawing = Microsoft.Msagl.Drawing; using Microsoft.Msagl.GraphViewerGdi; using Microsoft.Msagl.Layout.Layered; +using Microsoft.Msagl.Layout.MDS; using Microsoft.Msagl.Routing; +using Microsoft.Msagl.Routing.Rectilinear; namespace FlowForge @@ -162,19 +167,39 @@ namespace FlowForge _gViewer.Graph = _msaglGraph; + // Set the graph and check which layout settings are applied by default + _gViewer.Graph = _msaglGraph; + + // Print layout information to debug output + if (_msaglGraph.LayoutAlgorithmSettings is SugiyamaLayoutSettings) + { + Console.WriteLine("Using Sugiyama Layout"); + } + else if (_msaglGraph.LayoutAlgorithmSettings is MdsLayoutSettings) + { + Console.WriteLine("Using MDS Layout"); + } + else + { + Console.WriteLine("Using another layout algorithm"); + } + + if (_nodePositions.Any()) { - var originalScale = _gViewer.ZoomF; - ApplyNodePositions(_msaglGraph); - var sugiyamaSettings = new SugiyamaLayoutSettings - { - - }; + var sugiyamaSettings = new SugiyamaLayoutSettings(); + sugiyamaSettings.NodeSeparation = 10; + //sugiyamaSettings.EdgeRoutingSettings.EdgeRoutingMode = EdgeRoutingMode.RectilinearToCenter; + sugiyamaSettings.EdgeRoutingSettings.EdgeRoutingMode = EdgeRoutingMode.Spline; + sugiyamaSettings.EdgeRoutingSettings.Padding = 1; + sugiyamaSettings.RepetitionCoefficientForOrdering = 100; + sugiyamaSettings.EdgeRoutingSettings.KeepOriginalSpline = false; + Microsoft.Msagl.Miscellaneous.LayoutHelpers.RouteAndLabelEdges(_msaglGraph.GeometryGraph, sugiyamaSettings, _msaglGraph.GeometryGraph.Edges, 100, new CancelToken()); - + /* // Step 3: Apply layout settings to the graph _msaglGraph.LayoutAlgorithmSettings = sugiyamaSettings; @@ -193,13 +218,11 @@ namespace FlowForge // Set the label to the midpoint of the edge path edge.Label.GeometryLabel.Center = edge.GeometryEdge.Curve.BoundingBox.Center; } - } + }*/ //SetStraightLineEdges(_msaglGraph); - _gViewer.ZoomF = originalScale; - - _gViewer.Invalidate(); + //_gViewer.Invalidate(); _gViewer.NeedToCalculateLayout = false; _gViewer.Graph = _msaglGraph; }