Пример #1
0
        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);
        }
Пример #2
0
 public QuadTree(Rectangle boundingRectangle)
 {
     Bounds = boundingRectangle;
     Root   = new QuadArea(Bounds);
 }