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


C# Cell.GetShape方法代码示例

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


在下文中一共展示了Cell.GetShape方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: VisitLeaf

 /// <exception cref="System.IO.IOException"></exception>
 protected internal override void VisitLeaf(Cell cell)
 {
     //visitRelation is declared as a field, populated by visit() so we don't recompute it
     Debug.Assert(_enclosing.detailLevel != cell.Level);
     Debug.Assert(visitRelation == cell.GetShape().Relate(_enclosing.queryShape));
     if (AllCellsIntersectQuery(cell, visitRelation))
     {
         CollectDocs(inside);
     }
     else
     {
         CollectDocs(outside);
     }
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:15,代码来源:WithinPrefixTreeFilter.cs

示例3: AllCellsIntersectQuery

 /// <summary>
 /// Returns true if the provided cell, and all its sub-cells down to
 /// detailLevel all intersect the queryShape.
 /// </summary>
 /// <remarks>
 /// Returns true if the provided cell, and all its sub-cells down to
 /// detailLevel all intersect the queryShape.
 /// </remarks>
 private bool AllCellsIntersectQuery(Cell cell, SpatialRelation relate)
 {
     if (relate == SpatialRelation.NULL_VALUE)
     {
         relate = cell.GetShape().Relate(_enclosing.queryShape);
     }
     if (cell.Level == _enclosing.detailLevel)
     {
         return relate.Intersects();
     }
     if (relate == SpatialRelation.WITHIN)
     {
         return true;
     }
     if (relate == SpatialRelation.DISJOINT)
     {
         return false;
     }
     // Note: Generating all these cells just to determine intersection is not ideal.
     // It was easy to implement but could be optimized. For example if the docs
     // in question are already marked in the 'outside' bitset then it can be avoided.
     ICollection<Cell> subCells = cell.GetSubCells(null);
     foreach (Cell subCell in subCells)
     {
         if (!AllCellsIntersectQuery(subCell, SpatialRelation.NULL_VALUE))
         {
             //recursion
             return false;
         }
     }
     return true;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:40,代码来源:WithinPrefixTreeFilter.cs

示例4: Visit

 /// <exception cref="System.IO.IOException"></exception>
 protected internal override bool Visit(Cell cell)
 {
     //cell.relate is based on the bufferedQueryShape; we need to examine what
     // the relation is against the queryShape
     visitRelation = cell.GetShape().Relate(_enclosing.queryShape);
     if (visitRelation == SpatialRelation.WITHIN)
     {
         CollectDocs(inside);
         return false;
     }
     else
     {
         if (visitRelation == SpatialRelation.DISJOINT)
         {
             CollectDocs(outside);
             return false;
         }
         else
         {
             if (cell.Level == _enclosing.detailLevel)
             {
                 CollectDocs(inside);
                 return false;
             }
         }
     }
     return true;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:29,代码来源:WithinPrefixTreeFilter.cs


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