Exemplo n.º 1
0
        public void add(InPlay obj)
        {
            bool haveAdded = false;

            if (!AdditionalMath.contains(Area, obj.getRekt()) && parent != null)
            {
                parent.add(obj);
                return;
            }
            for (int x = 0; x < 2; x++)
            {
                for (int y = 0; y < 2; y++)
                {
                    RectangleF rect = obj.getRekt();
                    if (AdditionalMath.contains(innerQuads[x, y], rect))
                    {
                        haveAdded = true;
                        if (children[x, y] == null && Area.Height * Area.Width * .25 > minimum)
                        {
                            children[x, y] = new QuadNode(this, innerQuads[x, y], minimum, quadLevel + 1);
                        }

                        children[x, y].add(obj);
                    }
                }
            }
            if (!haveAdded)
            {
                dict.Add(obj);
            }
        }
Exemplo n.º 2
0
 public void add(InPlay obj)
 {
     rootNode.add(obj);
 }