Exemple #1
0
        private void CalcBundling()
        {
            //perform edge routing
            IExternalEdgeRouting <DataVertex, DataEdge> era = null;
            IEdgeRoutingParameters prms = null;

            switch ((EdgeRoutingAlgorithmTypeEnum)erg_eralgo.SelectedItem)
            {
            case EdgeRoutingAlgorithmTypeEnum.Bundling:
                prms = erg_BundleEdgeRoutingParameters;
                era  = new BundleEdgeRouting <DataVertex, DataEdge, GraphExample>(erg_Area.ContentSize, erg_Area.LogicCore.Graph as GraphExample, erg_Area.GetVertexPositions(), erg_Area.GetVertexSizeRectangles(), prms);
                break;

            /*case EdgeRoutingAlgorithmTypeEnum.SimpleER:
             *  prms = erg_SimpleERParameters;
             *  era = new SimpleEdgeRouting<DataVertex, DataEdge, GraphExample>(graph, VertexPositions, erg_Area.GetVertexSizeRectangles(VertexPositions), prms);
             *  break;*/
            case EdgeRoutingAlgorithmTypeEnum.None:
                break;
            }
            if (era != null)
            {
                era.Compute();
                foreach (var item in erg_Area.LogicCore.Graph.Edges)
                {
                    if (era.EdgeRoutes.ContainsKey(item))
                    {
                        item.RoutingPoints = era.EdgeRoutes[item];
                    }
                }
            }
        }
        void tst_but_gen_Click(object sender, RoutedEventArgs e)
        {
            var graph = GenerateTestGraph();
            var logic = new LogicCoreExample {
                Graph = graph
            };

            logic.EnableParallelEdges  = false;
            logic.ParallelEdgeDistance = 15;

            tst_Area.ShowAllEdgesArrows(false);
            tst_Area.LogicCore = logic;
            var layParams = new LinLogLayoutParameters {
                IterationCount = 100
            };

            logic.DefaultLayoutAlgorithm       = LayoutAlgorithmTypeEnum.Tree;
            logic.DefaultLayoutAlgorithmParams = layParams;
            var overlapParams = new OverlapRemovalParameters {
                HorizontalGap = 100, VerticalGap = 100
            };

            logic.DefaultOverlapRemovalAlgorithm       = OverlapRemovalAlgorithmTypeEnum.FSA;
            logic.DefaultOverlapRemovalAlgorithmParams = overlapParams;
            IExternalEdgeRouting <DataVertex, DataEdge> erParams = null;

            //logic.ExternalEdgeRoutingAlgorithm =

            tst_Area.GenerateGraph(graph, true);
            //tst_Area.VertexList[v1].Visibility = System.Windows.Visibility.Collapsed;
            //tst_Area.VertexList[v2].Visibility = System.Windows.Visibility.Collapsed;
            //tst_Area.VertexList[v3].Visibility = System.Windows.Visibility.Collapsed;
            //tst_Area.VertexList[v4].SetPosition(new Point(0, 0));
            tst_Area.ShowAllEdgesLabels();
            tst_Area.AlignAllEdgesLabels();
            tst_zoomctrl.ZoomToFill();

            /* var img = new BitmapImage(new Uri(@"pack://application:,,,/ShowcaseExample;component/Images/birdy.png", UriKind.Absolute)) { CacheOption = BitmapCacheOption.OnLoad };
             * GraphAreaBase.SetX(img, -100);
             * GraphAreaBase.SetY(img, -100);
             * var image = new Image() { Source = img, Width = 100, Height = 100 };
             * var border = new Border() { BorderBrush = Brushes.Black, BorderThickness = new Thickness(2), Background = Brushes.Black, Width = 100, Height = 100 };
             * image.Visibility = System.Windows.Visibility.Visible;
             * border.Visibility = System.Windows.Visibility.Visible;
             * tst_Area.InsertCustomChildControl(0, image);
             * tst_Area.InsertCustomChildControl(0, border);*/
        }
 public AlgorithmStorage(IExternalOverlapRemoval <TVertex> or, IExternalEdgeRouting <TVertex, TEdge> er)
 {
     OverlapRemoval = or; EdgeRouting = er;
 }
Exemple #4
0
 public void CreateNewAlgorithmStorage(IExternalLayout <TVertex> layout, IExternalOverlapRemoval <TVertex> or, IExternalEdgeRouting <TVertex, TEdge> er)
 {
     AlgorithmStorage = new AlgorithmStorage <TVertex, TEdge>(layout, or, er);
 }