-
Notifications
You must be signed in to change notification settings - Fork 1
/
GraphLayout.vb
30 lines (28 loc) · 1.31 KB
/
GraphLayout.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Imports DevExpress.Diagram.Core
Imports DevExpress.Diagram.Core.Layout
Imports DevExpress.Diagram.Core.Routing
Imports Microsoft.Msagl.Core.Layout
Imports Microsoft.Msagl.Core.Routing
Imports System.Collections.Generic
Namespace MsaglHelpers
Public Class GraphLayout
Private Property GeometryGraph() As GeometryGraph
Private ReadOnly Property RoutingMode() As EdgeRoutingMode
Get
Return LayoutCalculator.LayoutAlgorithmSettings.EdgeRoutingSettings.EdgeRoutingMode
End Get
End Property
Protected Property LayoutCalculator() As ILayoutCalculator
Public Sub New(ByVal layoutCalculator As ILayoutCalculator)
Me.LayoutCalculator = layoutCalculator
End Sub
Public Overridable Function RelayoutGraphNodesPosition(ByVal graph As Graph(Of IDiagramItem)) As IEnumerable(Of PositionInfo(Of IDiagramItem))
GeometryGraph = MsaglGeometryGraphHelpers.CreateGeometryGraph(graph)
LayoutCalculator.CalculateLayout(GeometryGraph)
Return MsaglGeometryGraphHelpers.GetGetNodesPositionInfo(GeometryGraph)
End Function
Public Function GetDiagramConnectorType() As ConnectorType
Return RoutingHelper.GetDiagramConnectorType(RoutingMode)
End Function
End Class
End Namespace