Пример #1
0
        private void CreateAndRunSugiyamaLayout(Dictionary <DiagramShape, Size> sizeDictionary, BidirectionalGraph <DiagramShape, IEdge <DiagramShape> > graph, SugiyamaLayoutParameters parameters)
        {
            layoutAlgorithm =
                new SugiyamaLayoutAlgorithm <DiagramShape, IEdge <DiagramShape>, IBidirectionalGraph <DiagramShape, IEdge <DiagramShape> > >(
                    graph, sizeDictionary, parameters, e => EdgeTypes.Hierarchical);

            layoutAlgorithm.Compute();
        }
Пример #2
0
        private void CreateAndRunEfficentSugiyamaLayout(Dictionary <DiagramShape, Size> sizeDictionary, BidirectionalGraph <DiagramShape, IEdge <DiagramShape> > graph)
        {
            layoutAlgorithm =
                new EfficientSugiyamaLayoutAlgorithm <DiagramShape, IEdge <DiagramShape>, IBidirectionalGraph <DiagramShape, IEdge <DiagramShape> > >(
                    graph, new EfficientSugiyamaLayoutParameters(), sizeDictionary);

            layoutAlgorithm.Compute();
        }
Пример #3
0
        private void CreateAndRunKamadaKawaiiLayout(BidirectionalGraph <DiagramShape, IEdge <DiagramShape> > graph, double width, double height)
        {
            layoutAlgorithm =
                new KKLayoutAlgorithm <DiagramShape, IEdge <DiagramShape>, IBidirectionalGraph <DiagramShape, IEdge <DiagramShape> > >(
                    graph, new KKLayoutParameters {
                Width = width, Height = height
            });

            layoutAlgorithm.Compute();
        }
Пример #4
0
 public void Layout()
 {
     LayoutAlgorithm = new EfficientSugiyamaLayoutAlgorithm <AbstractBlock, Connection, YoloGraph>(this,
                                                                                                   new EfficientSugiyamaLayoutParameters()
     {
         VertexDistance = 20
     },
                                                                                                   new Dictionary <AbstractBlock, Size>());
     LayoutAlgorithm.Compute();
 }
Пример #5
0
        private void CreateAndRunFruchtermanReingoldLayout(BidirectionalGraph <DiagramShape, IEdge <DiagramShape> > graph, double width, double height)
        {
            var positionDictionary = new Dictionary <DiagramShape, Point>();

            foreach (var vertex in graph.Vertices)
            {
                positionDictionary.Add(vertex, vertex.Location);
            }
            var parameters = new BoundedFRLayoutParameters()
            {
                Width = width, Height = height, RepulsiveMultiplier = 2
            };

            layoutAlgorithm =
                new FRLayoutAlgorithm <DiagramShape, IEdge <DiagramShape>, IBidirectionalGraph <DiagramShape, IEdge <DiagramShape> > >(
                    graph, positionDictionary, parameters);

            layoutAlgorithm.Compute();
        }
Пример #6
0
        private void CreateAndRunFruchtermanReingoldLayout(BidirectionalGraph<DiagramShape, IEdge<DiagramShape>> graph, double width, double height)
        {
            var positionDictionary = new Dictionary<DiagramShape, Point>();

            foreach (var vertex in graph.Vertices)
            {
                positionDictionary.Add(vertex, vertex.Location);
            }
            var parameters = new BoundedFRLayoutParameters(){Width = width, Height = height, RepulsiveMultiplier = 2};
            layoutAlgorithm =
                new FRLayoutAlgorithm<DiagramShape, IEdge<DiagramShape>, IBidirectionalGraph<DiagramShape, IEdge<DiagramShape>>>(
                    graph, positionDictionary, parameters);

            layoutAlgorithm.Compute();
        }
Пример #7
0
        private void CreateAndRunEfficentSugiyamaLayout(Dictionary<DiagramShape, Size> sizeDictionary, BidirectionalGraph<DiagramShape, IEdge<DiagramShape>> graph)
        {
            layoutAlgorithm =
                new EfficientSugiyamaLayoutAlgorithm<DiagramShape, IEdge<DiagramShape>, IBidirectionalGraph<DiagramShape, IEdge<DiagramShape>>>(
                    graph, new EfficientSugiyamaLayoutParameters(), sizeDictionary);

            layoutAlgorithm.Compute();
        }
Пример #8
0
        private void CreateAndRunSugiyamaLayout(Dictionary<DiagramShape, Size> sizeDictionary, BidirectionalGraph<DiagramShape, IEdge<DiagramShape>> graph, SugiyamaLayoutParameters parameters)
        {
            layoutAlgorithm =
                new SugiyamaLayoutAlgorithm<DiagramShape, IEdge<DiagramShape>, IBidirectionalGraph<DiagramShape, IEdge<DiagramShape>>>(
                    graph, sizeDictionary, parameters, e => EdgeTypes.Hierarchical);

            layoutAlgorithm.Compute();
        }
Пример #9
0
        private void CreateAndRunKamadaKawaiiLayout(BidirectionalGraph<DiagramShape, IEdge<DiagramShape>> graph, double width, double height)
        {
            layoutAlgorithm =
                new KKLayoutAlgorithm<DiagramShape, IEdge<DiagramShape>, IBidirectionalGraph<DiagramShape, IEdge<DiagramShape>>>(
                    graph, new KKLayoutParameters { Width = width, Height = height });

            layoutAlgorithm.Compute();
        }