示例#1
0
        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);
            }
        }
示例#2
0
 public GraphLayoutOptions()
 {
     showAllEdgesLabels          = false;
     layoutAlgorithm             = LayoutAlgorithmTypeEnum.FR;
     overlapRemovalAlgorithm     = OverlapRemovalAlgorithmTypeEnum.FSA;
     overlapRemovalHorizontalGap = 100;
     overlapRemovalVerticalGap   = 100;
     edgeRoutingAlgorithm        = EdgeRoutingAlgorithmTypeEnum.SimpleER;
 }
示例#3
0
        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);
            }
        }
示例#4
0
        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();
        }
示例#5
0
        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);
            }
        }