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(); }
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(); }
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(); }
void SetGraphBoundingBox() { graph.BoundingBox = graph.PumpTheBoxToTheGraphWithMargins(); }
void SetGraphBoundingBox(GeometryGraph graph) { graph.BoundingBox = graph.PumpTheBoxToTheGraphWithMargins(); }