Пример #1
0
        private void GraphArea_Setup()
        {
            var logicCore = new GraphLogicCore()
            {
                Graph = Graph_Setup()
            };
            var layoutAlgorithm = new VertexLayoutAlgorithm(logicCore.Graph);

            //logicCore.ExternalLayoutAlgorithm = layoutAlgorithm;
            //logicCore.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.Custom;
            //logicCore.DefaultLayoutAlgorithmParams = logicCore.AlgorithmFactory.CreateLayoutParameters(LayoutAlgorithmTypeEnum.KK);
            //((KKLayoutParameters)logicCore.DefaultLayoutAlgorithmParams).MaxIterations = 100;
            logicCore.ExternalLayoutAlgorithm = layoutAlgorithm;

            logicCore.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA;

            logicCore.DefaultOverlapRemovalAlgorithmParams.HorizontalGap = 80;
            logicCore.DefaultOverlapRemovalAlgorithmParams.VerticalGap   = 80;
            logicCore.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.SimpleER;
            logicCore.AsyncAlgorithmCompute       = false;
            Area.LogicCore = logicCore;
            foreach (var vertex in Area.VertexList)
            {
                var converter = new System.Windows.Media.BrushConverter();

                vertex.Value.Foreground = (System.Windows.Media.Brush)converter.ConvertFromString("#000000");
                vertex.Value.SetPosition(vertex.Key.location.longitude, vertex.Key.location.latitude, false);
            }

            Area.RelayoutGraph(true);
        }
Пример #2
0
        private void GraphArea_Setup()
        {
            var logicCore = new GraphLogicCore() { Graph = Graph_Setup() };
            var layoutAlgorithm = new VertexLayoutAlgorithm(logicCore.Graph);
            //logicCore.ExternalLayoutAlgorithm = layoutAlgorithm;
            //logicCore.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.Custom;
            //logicCore.DefaultLayoutAlgorithmParams = logicCore.AlgorithmFactory.CreateLayoutParameters(LayoutAlgorithmTypeEnum.KK);
            //((KKLayoutParameters)logicCore.DefaultLayoutAlgorithmParams).MaxIterations = 100;
            logicCore.ExternalLayoutAlgorithm = layoutAlgorithm;

            logicCore.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA;

            logicCore.DefaultOverlapRemovalAlgorithmParams.HorizontalGap = 80;
            logicCore.DefaultOverlapRemovalAlgorithmParams.VerticalGap = 80;
            logicCore.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.SimpleER;
            logicCore.AsyncAlgorithmCompute = false;
            Area.LogicCore = logicCore;
            foreach (var vertex in Area.VertexList)
            {
                var converter = new System.Windows.Media.BrushConverter();

                vertex.Value.Foreground =(System.Windows.Media.Brush) converter.ConvertFromString("#000000");
                vertex.Value.SetPosition(vertex.Key.location.longitude, vertex.Key.location.latitude, false);

            }

            Area.RelayoutGraph(true);
        }