Esempio 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>
 /// <param name="itemInterval"></param>
 public void ComputeKey(Interval itemInterval)
 {
     level    = ComputeLevel(itemInterval);
     interval = new Interval();
     ComputeInterval(level, itemInterval);
     // MD - would be nice to have a non-iterative form of this algorithm
     while (!interval.Contains(itemInterval))
     {
         level += 1;
         ComputeInterval(level, itemInterval);
     }
 }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        public void Insert(Node node)
        {
            Assert.IsTrue(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;
            }
        }
Esempio n. 3
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>
 /// <param name="itemInterval"></param>
 public void ComputeKey(Interval itemInterval)
 {
     level = ComputeLevel(itemInterval);
     interval = new Interval();
     ComputeInterval(level, itemInterval);
     // MD - would be nice to have a non-iterative form of this algorithm
     while (!interval.Contains(itemInterval))
     {
         level += 1;
         ComputeInterval(level, itemInterval);
     }
 }