internal void CheckClusterConsistency() { foreach (var cluster in RootCluster.AllClustersDepthFirst()) { CheckClusterConsistency(cluster); } }
/// <summary> /// Translates the graph by delta. /// Assumes bounding box is already up to date. /// </summary> public void Translate(Point delta) { var nodeSet = new Set <Node>(Nodes); foreach (var v in Nodes) { v.Center += delta; } foreach (var cluster in RootCluster.AllClustersDepthFirstExcludingSelf()) { foreach (var node in cluster.Nodes.Where(n => !nodeSet.Contains(n))) { node.Center += delta; } cluster.Center += delta; cluster.RectangularBoundary.TranslateRectangle(delta); } foreach (var e in edges) { e.Translate(delta); } BoundingBox = new Rectangle(BoundingBox.Left + delta.X, BoundingBox.Bottom + delta.Y, new Point(BoundingBox.Width, BoundingBox.Height)); }
///<summary> ///</summary> public void SetDebugIds() { int id = 0; foreach (var node in RootCluster.AllClustersDepthFirst()) { node.DebugId = id++; } foreach (var node in Nodes) { if (node.DebugId == null) { node.DebugId = id++; } } }
public HierarchicalModelParameters(RootCluster cluster) { Cluster = cluster; }