当前位置: 首页>>代码示例>>C#>>正文


C# Entry.UpdateBoundingBox方法代码示例

本文整理汇总了C#中Entry.UpdateBoundingBox方法的典型用法代码示例。如果您正苦于以下问题:C# Entry.UpdateBoundingBox方法的具体用法?C# Entry.UpdateBoundingBox怎么用?C# Entry.UpdateBoundingBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Entry的用法示例。


在下文中一共展示了Entry.UpdateBoundingBox方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Insert

 // *** Insertion ***
 private void Insert(Entry entry)
 {
     // I1: find position for new record
     Node leaf = ChooseLeaf(entry);
     // I2: add record to leaf node
     Node leaf2 = null;
     if (leaf.Entries.Count < ENTRIES_PER_NODE)
     {
         leaf.AddEntry(entry);
     }
     else
     {
         leaf2 = SplitNode(leaf, entry);
     }
     // I3: propagate changes upward
     if (leaf == mRoot)
     {
         if (leaf2 != null)
         {
             // I4: grow tree taller
             mRoot = new Node();
             Entry entry1 = new Entry();
             Entry entry2 = new Entry();
             entry1.ChildNode = leaf;
             entry1.UpdateBoundingBox();
             entry2.ChildNode = leaf2;
             entry2.UpdateBoundingBox();
             mRoot.AddEntry(entry1);
             mRoot.AddEntry(entry2);
         }
     }
     else
     {
         AdjustTree(leaf, leaf2);
     }
 }
开发者ID:project-first,项目名称:latino,代码行数:37,代码来源:RTree.cs

示例2: AdjustTree

 private void AdjustTree(Node node1, Node node2)
 {
     while (node1 != mRoot) // AT2: check if done
     {
         Node parent1 = node1.Parent.Owner;
         // AT3: adjust covering rectangle in parent entry
         node1.Parent.UpdateBoundingBox();
         // AT4: propagate node split upward
         if (node2 != null)
         {
             Entry entry = new Entry();
             entry.ChildNode = node2;
             entry.UpdateBoundingBox();
             if (parent1.Entries.Count < ENTRIES_PER_NODE)
             {
                 parent1.AddEntry(entry);
                 node2 = null;
             }
             else
             {
                 Node parent2 = SplitNode(parent1, entry);
                 node2 = parent2;
                 if (parent1 == mRoot)
                 {
                     // (I4: grow tree taller)
                     mRoot = new Node();
                     Entry entry1 = new Entry();
                     Entry entry2 = new Entry();
                     entry1.ChildNode = parent1;
                     entry1.UpdateBoundingBox();
                     entry2.ChildNode = parent2;
                     entry2.UpdateBoundingBox();
                     mRoot.AddEntry(entry1);
                     mRoot.AddEntry(entry2);
                     break;
                 }
             }
         }
         // AT5: move up to next level
         node1 = parent1;
     }
 }
开发者ID:project-first,项目名称:latino,代码行数:42,代码来源:RTree.cs


注:本文中的Entry.UpdateBoundingBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。