Пример #1
0
        public DiagramLayoutInfo Calculate(IDiagram diagram)
        {
            var layoutStructure     = new DiagramLayoutStructure(diagram);
            var rootLayoutAlgorithm = _layoutAlgorithmSelectionStrategy.GetForRoot();
            var rootLayoutInfo      = LayoutRecursive(layoutStructure, layoutStructure.RootLayoutGroup, rootLayoutAlgorithm);

            return(new DiagramLayoutInfo(rootLayoutInfo.Nodes, rootLayoutInfo.Connectors));
        }
        public GroupLayoutInfo Calculate(IDiagram diagram)
        {
            var layoutStructure = new DiagramLayoutStructure(diagram);

            var rootLayoutAlgorithm = _layoutAlgorithmSelectionStrategy.GetForRoot();

            var relativeLayout = LayoutRecursive(layoutStructure, layoutStructure.RootLayoutGroup, rootLayoutAlgorithm);

            var absoluteLayout = _layoutUnifier.CalculateAbsoluteLayout(relativeLayout);

            var crossGroupLines = CreateDirectRoutes(layoutStructure.CrossLayoutGroupConnectors, diagram, absoluteLayout);

            return(absoluteLayout.AddLineLayoutInfo(crossGroupLines));
        }