コード例 #1
0
        void LayoutConnectedGraphWithMds(GeometryGraph compGraph)
        {
            double[] x, y;

            LayoutGraphWithMds(compGraph, settings, out x, out y);
            if (settings.RotationAngle != 0)
            {
                Transform.Rotate(x, y, settings.RotationAngle);
            }

            double scaleX = settings.ScaleX;
            double scaleY = settings.ScaleY;
            int    index  = 0;

            foreach (Node node in compGraph.Nodes)
            {
                node.Center = new Point(x[index] * scaleX, y[index] * scaleY);
                index++;
                if ((index % 100) == 0)
                {
                    ProgressStep();
                }
            }
            if (settings.AdjustScale)
            {
                AdjustScale(compGraph.Nodes);
            }

            if (settings.RemoveOverlaps)
            {
                GTreeOverlapRemoval.RemoveOverlaps(compGraph.Nodes.ToArray(), settings.NodeSeparation);
            }
            compGraph.BoundingBox = compGraph.PumpTheBoxToTheGraphWithMargins();
        }
コード例 #2
0
ファイル: Modeller.cs プロジェクト: j-prox/blueprint41
        internal void UpdateEdgesPlacement()
        {
            if (DisplayedSubmodel.Node.Count <= 0)
            {
                return;
            }

            GeometryGraph geomGraph = GeometryGraph ?? GraphEditor.Viewer.Graph.GeometryGraph;

            geomGraph.BoundingBox = geomGraph.PumpTheBoxToTheGraphWithMargins();
            EdgeLabelPlacement placement = new EdgeLabelPlacement(geomGraph);

            placement.Run();
        }
コード例 #3
0
        void LayoutConnectedGraphWithMds(GeometryGraph compGraph)
        {
            Console.WriteLine("LayoutConnectedGraphWithMds: nodes {0} edges {1}", compGraph.Nodes.Count(), compGraph.Edges.Count());

            double[] x, y;

            LayoutGraphWithMds(compGraph, settings, out x, out y);
            if (settings.RotationAngle != 0)
            {
                Transform.Rotate(x, y, settings.RotationAngle);
            }

            double scaleX = settings.ScaleX;
            double scaleY = settings.ScaleY;
            int    index  = 0;

            foreach (Node node in compGraph.Nodes)
            {
                node.Center = new Point(x[index] * scaleX, y[index] * scaleY);
                index++;
                if ((index % 100) == 0)
                {
                    ProgressStep();
                }
            }
            if (settings.AdjustScale)
            {
                AdjustScale(compGraph.Nodes);
            }

            if (settings.RemoveOverlaps)
            {
                switch (settings.OverlapRemovalMethod)
                {
                case OverlapRemovalMethod.Prism:
                    ProximityOverlapRemoval.RemoveOverlaps(compGraph, settings.NodeSeparation);
                    break;

                case OverlapRemovalMethod.Pmst:
                    OverlapRemoval.RemoveOverlaps(compGraph, settings.NodeSeparation);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
            compGraph.BoundingBox = compGraph.PumpTheBoxToTheGraphWithMargins();
        }
コード例 #4
0
  void SetGraphBoundingBox() {
     graph.BoundingBox = graph.PumpTheBoxToTheGraphWithMargins();
 }
コード例 #5
0
 void SetGraphBoundingBox(GeometryGraph graph)
 {
     graph.BoundingBox = graph.PumpTheBoxToTheGraphWithMargins();
 }