private void ShowNode(QuadArea root) { var xMul = ItemsControl.ActualWidth / Tree.Root.Bounds.Width; var yMul = ItemsControl.ActualHeight / Tree.Root.Bounds.Width; var color = GetColor(); if (root.Nodes.Any()) { root.Nodes.ForEach(x => DrawingVisuals.Add(new NodeShape(x, xMul, yMul, color))); } root.SubSpaces.ForEach(x => DrawingVisuals.Add(new SubSpace(x.Bounds, xMul, yMul, color))); root.SubSpaces.ForEach(ShowNode); }
public QuadTree(Rectangle boundingRectangle) { Bounds = boundingRectangle; Root = new QuadArea(Bounds); }