public IExternalEdgeRouting <TVertex, TEdge> CreateEdgeRoutingAlgorithm(EdgeRoutingAlgorithmTypeEnum newAlgorithmType, Rect graphArea, TGraph iGraph, IDictionary <TVertex, Point> positions, IDictionary <TVertex, Rect> rectangles, IEdgeRoutingParameters parameters = null) { //if (Rectangles == null) return null; if (parameters == null) { parameters = CreateEdgeRoutingParameters(newAlgorithmType); } IMutableBidirectionalGraph <TVertex, TEdge> graph = iGraph.CopyToBidirectionalGraph(); graph.RemoveEdgeIf(a => a.SkipProcessing == ProcessingOptionEnum.Exclude); graph.RemoveVertexIf(a => a.SkipProcessing == ProcessingOptionEnum.Exclude); switch (newAlgorithmType) { case EdgeRoutingAlgorithmTypeEnum.SimpleER: return(new SimpleEdgeRouting <TVertex, TEdge, TGraph>((TGraph)graph, positions, rectangles, parameters)); case EdgeRoutingAlgorithmTypeEnum.Bundling: return(new BundleEdgeRouting <TVertex, TEdge, TGraph>(graphArea, (TGraph)graph, positions, rectangles, parameters)); case EdgeRoutingAlgorithmTypeEnum.PathFinder: return(new PathFinderEdgeRouting <TVertex, TEdge, TGraph>((TGraph)graph, positions, rectangles, parameters)); default: return(null); } }
public GraphLayoutOptions() { showAllEdgesLabels = false; layoutAlgorithm = LayoutAlgorithmTypeEnum.FR; overlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA; overlapRemovalHorizontalGap = 100; overlapRemovalVerticalGap = 100; edgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.SimpleER; }
public IEdgeRoutingParameters CreateEdgeRoutingParameters(EdgeRoutingAlgorithmTypeEnum algorithmType) { switch (algorithmType) { case EdgeRoutingAlgorithmTypeEnum.SimpleER: return(new SimpleERParameters()); case EdgeRoutingAlgorithmTypeEnum.Bundling: return(new BundleEdgeRoutingParameters()); case EdgeRoutingAlgorithmTypeEnum.PathFinder: return(new PathFinderEdgeRoutingParameters()); default: return(null); } }
public void SetDefaultEdgeRoutingAlgorithm(EdgeRoutingAlgorithmTypeEnum algorithm) { this.DefaultEdgeRoutingAlgorithm = algorithm; if (this.DefaultEdgeRoutingAlgorithm == EdgeRoutingAlgorithmTypeEnum.Bundling) { BundleEdgeRoutingParameters prm = new BundleEdgeRoutingParameters(); this.DefaultEdgeRoutingAlgorithmParams = prm; prm.Iterations = 200; prm.SpringConstant = 5; prm.Threshold = .1f; this.EdgeCurvingEnabled = true; } else { this.EdgeCurvingEnabled = false; } this.NotifyParent(); }
public IExternalEdgeRouting <TVertex, TEdge> CreateEdgeRoutingAlgorithm(EdgeRoutingAlgorithmTypeEnum newAlgorithmType, Rect graphArea, TGraph Graph, IDictionary <TVertex, Point> Positions, IDictionary <TVertex, Rect> Rectangles, IEdgeRoutingParameters parameters = null) { //if (Rectangles == null) return null; if (parameters == null) { parameters = CreateEdgeRoutingParameters(newAlgorithmType); } switch (newAlgorithmType) { case EdgeRoutingAlgorithmTypeEnum.SimpleER: return(new SimpleEdgeRouting <TVertex, TEdge, TGraph>(Graph, Positions, Rectangles, parameters)); case EdgeRoutingAlgorithmTypeEnum.Bundling: return(new BundleEdgeRouting <TVertex, TEdge, TGraph>(graphArea, Graph, Positions, Rectangles, parameters)); case EdgeRoutingAlgorithmTypeEnum.PathFinder: return(new PathFinderEdgeRouting <TVertex, TEdge, TGraph>(Graph, Positions, Rectangles, parameters)); default: return(null); } }