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


C# Cell.IsLeaf方法代码示例

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


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

示例1: VisitScanned

 /// <exception cref="System.IO.IOException"></exception>
 protected internal override void VisitScanned(Cell cell)
 {
     Shape cShape;
     //if this cell represents a point, use the cell center vs the box
     // TODO this behavior is debatable; might want to be configurable
     // (points never have isLeaf())
     if (cell.Level == _enclosing.grid.MaxLevels && !cell.IsLeaf())
     {
         cShape = cell.GetCenter();
     }
     else
     {
         cShape = cell.GetShape();
     }
     if (_enclosing.queryShape.Relate(cShape).Intersects())
     {
         CollectDocs(results);
     }
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:20,代码来源:IntersectsPrefixTreeFilter.cs

示例2: RecursiveGetCells

 /// <summary>Returns true if cell was added as a leaf.</summary>
 /// <remarks>
 /// Returns true if cell was added as a leaf. If it wasn't it recursively
 /// descends.
 /// </remarks>
 private bool RecursiveGetCells(Cell cell, Shape shape, int
      detailLevel, bool inclParents, bool simplify, IList<Cell> result)
 {
     if (cell.Level == detailLevel)
     {
         cell.SetLeaf();
     }
     //FYI might already be a leaf
     if (cell.IsLeaf())
     {
         result.Add(cell);
         return true;
     }
     if (inclParents && cell.Level != 0)
     {
         result.Add(cell);
     }
     ICollection<Cell> subCells = cell.GetSubCells(shape);
     int leaves = 0;
     foreach (Cell subCell in subCells)
     {
         if (RecursiveGetCells(subCell, shape, detailLevel, inclParents, simplify, result))
         {
             leaves++;
         }
     }
     //can we simplify?
     if (simplify && leaves == cell.GetSubCellsSize() && cell.Level != 0)
     {
         do
         {
             //Optimization: substitute the parent as a leaf instead of adding all
             // children as leaves
             //remove the leaves
             result.RemoveAt(result.Count - 1);
         }
         while (--leaves > 0);
         //remove last
         //add cell as the leaf
         cell.SetLeaf();
         if (!inclParents)
         {
             // otherwise it was already added up above
             result.Add(cell);
         }
         return true;
     }
     return false;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:54,代码来源:SpatialPrefixTree.cs


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