Ejemplo n.º 1
0
 /// <summary> return a square envelope containing the argument envelope,
 /// whose extent is a power of two and which is based at a power of 2
 /// </summary>
 public void ComputeKey(Interval itemInterval)
 {
     level         = ComputeLevel(itemInterval);
     m_objInterval = new Interval();
     ComputeInterval(level, itemInterval);
     // MD - would be nice to have a non-iterative form of this algorithm
     while (!m_objInterval.Contains(itemInterval))
     {
         level += 1;
         ComputeInterval(level, itemInterval);
     }
 }
Ejemplo n.º 2
0
        internal void Insert(Node node)
        {
            Debug.Assert(interval == null || interval.Contains(node.interval));
            int index = GetSubnodeIndex(node.interval, centre);

            if (node.level == level - 1)
            {
                subnode[index] = node;
            }
            else
            {
                // the node is not a direct child, so make a new child node to contain it
                // and recursively insert the node
                Node childNode = CreateSubnode(index);
                childNode.Insert(node);
                subnode[index] = childNode;
            }
        }